line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::GoogleEarth::Pluggable::Contrib::Point; |
2
|
1
|
|
|
1
|
|
1330
|
use base qw{Geo::GoogleEarth::Pluggable::Placemark}; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
71
|
|
3
|
|
|
|
|
|
|
use XML::LibXML::LazyBuilder qw{E}; |
4
|
|
|
|
|
|
|
use warnings; |
5
|
|
|
|
|
|
|
use strict; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION='0.13'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Geo::GoogleEarth::Pluggable::Contrib::Point - Geo::GoogleEarth::Pluggable Point Object |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Geo::GoogleEarth::Pluggable; |
16
|
|
|
|
|
|
|
my $document=Geo::GoogleEarth::Pluggable->new(); |
17
|
|
|
|
|
|
|
$document->Point(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Geo::GoogleEarth::Pluggable::Contrib::Point is a L with a few other methods. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 USAGE |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $placemark=$document->Point(name=>"Point Name", |
26
|
|
|
|
|
|
|
lat=>$lat, |
27
|
|
|
|
|
|
|
lon=>$lon, |
28
|
|
|
|
|
|
|
alt=>$alt); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 new |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $placemark=$document->Point( |
35
|
|
|
|
|
|
|
name => "White House", |
36
|
|
|
|
|
|
|
lat => 38.89769, #signed decimal degrees WGS-84 |
37
|
|
|
|
|
|
|
lon => -77.036549, #signed decimal degrees WGS-84 |
38
|
|
|
|
|
|
|
alt => 30, #meters above ellipsoid WGS-84 |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 METHODS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 subnode |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub subnode { |
48
|
|
|
|
|
|
|
my $self=shift; |
49
|
|
|
|
|
|
|
my $coordinates=join(",", $self->lon+0, $self->lat+0, $self->alt+0); |
50
|
|
|
|
|
|
|
return E(Point=>{}, E(coordinates=>{}, $coordinates)); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 lat |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Sets or returns latitude. The format is signed decimal degrees WGS-84. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $lat=$placemark->lat; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub lat { |
62
|
|
|
|
|
|
|
my $self=shift; |
63
|
|
|
|
|
|
|
$self->{'lat'}=shift if @_; |
64
|
|
|
|
|
|
|
return $self->{'lat'}; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 lon |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Sets or returns longitude. The format is signed decimal degrees WGS-84. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
my $lon=$placemark->lon; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub lon { |
76
|
|
|
|
|
|
|
my $self=shift; |
77
|
|
|
|
|
|
|
$self->{'lon'}=shift if @_; |
78
|
|
|
|
|
|
|
return $self->{'lon'}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 alt |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Sets or returns altitude. The units are meters above the ellipsoid WGS-84. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $alt=$placemark->alt; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Typically, Google Earth "snaps" Placemarks to the surface regardless of how the altitude is set. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub alt { |
92
|
|
|
|
|
|
|
my $self=shift; |
93
|
|
|
|
|
|
|
$self->{'alt'}=shift if @_; |
94
|
|
|
|
|
|
|
$self->{'alt'}||=0; |
95
|
|
|
|
|
|
|
return $self->{'alt'}; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 BUGS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Please log on RT and send to the geo-perl email list. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 SUPPORT |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
DavisNetworks.com supports all Perl applications including this package. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHOR |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Michael R. Davis (mrdvt92) |
109
|
|
|
|
|
|
|
CPAN ID: MRDVT |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This program is free software licensed under the... |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
The BSD License |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 SEE ALSO |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
L, L, L |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |