line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::GoogleEarth::Pluggable::Contrib::Polygon; |
2
|
5
|
|
|
5
|
|
843
|
use base qw{Geo::GoogleEarth::Pluggable::Placemark}; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
469
|
|
3
|
5
|
|
|
5
|
|
29
|
use XML::LibXML::LazyBuilder qw{E}; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
190
|
|
4
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
109
|
|
5
|
5
|
|
|
5
|
|
21
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
1082
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION='0.17'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Geo::GoogleEarth::Pluggable::Contrib::Polygon - Geo::GoogleEarth::Pluggable Polygon Object |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Geo::GoogleEarth::Pluggable; |
16
|
|
|
|
|
|
|
my $document=Geo::GoogleEarth::Pluggable->new(); |
17
|
|
|
|
|
|
|
$document->Polygon(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Geo::GoogleEarth::Pluggable::Contrib::Polygon is a L. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 USAGE |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $placemark=$document->Polygon( |
26
|
|
|
|
|
|
|
name => "Polygon Name", |
27
|
|
|
|
|
|
|
coordinates => [ |
28
|
|
|
|
|
|
|
[ #outerBoundaryIs |
29
|
|
|
|
|
|
|
[lon, lat ,alt], |
30
|
|
|
|
|
|
|
[lon, lat ,alt], |
31
|
|
|
|
|
|
|
[lon, lat ,alt], |
32
|
|
|
|
|
|
|
... |
33
|
|
|
|
|
|
|
], |
34
|
|
|
|
|
|
|
[ #innerBoundaryIs |
35
|
|
|
|
|
|
|
[lon, lat ,alt], |
36
|
|
|
|
|
|
|
[lon, lat ,alt], |
37
|
|
|
|
|
|
|
[lon, lat ,alt], |
38
|
|
|
|
|
|
|
] |
39
|
|
|
|
|
|
|
], |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $placemark=$document->Polygon(); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 METHODS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 subnode |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub subnode { |
53
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
54
|
1
|
|
|
|
|
4
|
my %data = %$self; |
55
|
1
|
50
|
|
|
|
4
|
$data{"tessellate"} = 1 unless defined $data{"tessellate"}; |
56
|
1
|
50
|
|
|
|
8
|
my $polygon = $data{"coordinates"} or die("Error: Polygon coordinates required"); |
57
|
1
|
50
|
|
|
|
3
|
die("Error: Polygon coordinates must be an array reference") unless ref($polygon) eq "ARRAY"; |
58
|
1
|
|
|
|
|
4
|
my @elements = (E(tessellate=>{}, $data{"tessellate"})); |
59
|
1
|
|
|
|
|
26
|
my $first = 1; |
60
|
1
|
|
|
|
|
2
|
foreach my $boundary (@$polygon) { |
61
|
2
|
50
|
|
|
|
6
|
die("Error: Polygon coordinates boundary must be an array reference") unless ref($boundary) eq "ARRAY"; |
62
|
2
|
|
|
|
|
6
|
my $string = $self->coordinates_stringify($boundary); |
63
|
2
|
100
|
|
|
|
8
|
push @elements, E(($first ? "outerBoundaryIs" : "innerBoundaryIs"), {}, E(LinearRing=>{}, E(coordinates=>{}, $string))); |
64
|
2
|
|
|
|
|
66
|
$first = 0; |
65
|
|
|
|
|
|
|
} |
66
|
1
|
|
|
|
|
12
|
return E(Polygon=>{}, @elements); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 BUGS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Please log on RT and send to the geo-perl email list. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SUPPORT |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Try geo-perl email list. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Michael R. Davis (mrdvt92) |
80
|
|
|
|
|
|
|
CPAN ID: MRDVT |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 COPYRIGHT |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This program is free software licensed under the... |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
The BSD License |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SEE ALSO |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L, L, L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |