File: Geo-GoogleEarth-Pluggable-LinearRing.pl

package info (click to toggle)
libgeo-googleearth-pluggable-perl 0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 882; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
use strict;
use warnings;
use Geo::GoogleEarth::Pluggable;

=head1 NAME

Geo-GoogleEarth-Pluggable-LinearRing.pl - Geo::GoogleEarth::Pluggable LinearRing Example

=cut

my $type=shift || "kml";
my $document=Geo::GoogleEarth::Pluggable->new(name=>"My Document");
my @pt=(
         {lat=>38.5, lon=>-77.1},
         {lat=>38.6, lon=>-77.2},
         {lat=>38.7, lon=>-77.2},
         {lat=>38.8, lon=>-77.1},
       );

push @pt, $pt[0]; #ring last = first

$document->LinearRing(name=>"My LinearRing", coordinates=>\@pt);
#use Data::Dumper qw{Dumper};
#print Dumper($document->structure);
if ($type eq "kmz") {
  print $document->archive;
} else {
  print $document->render;
}