line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cartography::Projection::GCTP; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
24200
|
use 5.0.8; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
121
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
1
|
|
|
1
|
|
2495
|
use AutoLoader; |
|
1
|
|
|
|
|
1667
|
|
|
1
|
|
|
|
|
6
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
14
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
15
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# This allows declaration use Cartography::Projection::GCTP ':all'; |
18
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
19
|
|
|
|
|
|
|
# will save memory. |
20
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
21
|
|
|
|
|
|
|
P_GEO P_UTM P_SPCS P_ALBERS P_LAMCC P_MERCAT P_PS P_POLYC P_EQUIDC |
22
|
|
|
|
|
|
|
P_TM P_STEREO P_LAMAZ P_AZMEQD P_GNOMON P_ORTHO P_GVNSP P_SNSOID P_EQRECT |
23
|
|
|
|
|
|
|
P_MILLER P_VGRINT P_HOM P_ROBIN P_SOM P_ALASKA P_GOOD P_MOLL P_IMOLL |
24
|
|
|
|
|
|
|
P_HAMMER P_WAGIV P_WAGVII P_OBEQA P_USDEF |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
D_WGS84 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
U_RADIAN U_FEET U_METER U_SECOND U_DEGREE U_INT_FEET U_STPLN_TABLE |
29
|
|
|
|
|
|
|
) ] ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our @EXPORT = qw( |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub AUTOLOAD { |
40
|
|
|
|
|
|
|
# This AUTOLOAD is used to 'autoload' constants from the constant() |
41
|
|
|
|
|
|
|
# XS function. |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
|
|
my $constname; |
44
|
0
|
|
|
|
|
|
our $AUTOLOAD; |
45
|
0
|
|
|
|
|
|
($constname = $AUTOLOAD) =~ s/.*:://; |
46
|
0
|
0
|
|
|
|
|
croak "&Cartography::Projection::GCTP::constant not defined" if $constname eq 'constant'; |
47
|
0
|
|
|
|
|
|
my ($error, $val) = constant($constname); |
48
|
0
|
0
|
|
|
|
|
if ($error) { croak $error; } |
|
0
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
{ |
50
|
1
|
|
|
1
|
|
229
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
109
|
|
|
0
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# Fixed between 5.005_53 and 5.005_61 |
52
|
|
|
|
|
|
|
#XXX if ($] >= 5.00561) { |
53
|
|
|
|
|
|
|
#XXX *$AUTOLOAD = sub () { $val }; |
54
|
|
|
|
|
|
|
#XXX } |
55
|
|
|
|
|
|
|
#XXX else { |
56
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub { $val }; |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
#XXX } |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
goto &$AUTOLOAD; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
require XSLoader; |
63
|
|
|
|
|
|
|
XSLoader::load('Cartography::Projection::GCTP', $VERSION); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# Preloaded methods go here. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
###################################################### |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
1
|
|
4
|
use constant P_GEO => 0; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
78
|
|
72
|
1
|
|
|
1
|
|
5
|
use constant P_UTM => 1; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
73
|
1
|
|
|
1
|
|
5
|
use constant P_SPCS => 2; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
74
|
1
|
|
|
1
|
|
5
|
use constant P_ALBERS => 3; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
75
|
1
|
|
|
1
|
|
5
|
use constant P_LAMCC => 4; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
76
|
1
|
|
|
1
|
|
5
|
use constant P_MERCAT => 5; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
77
|
1
|
|
|
1
|
|
4
|
use constant P_PS => 6; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
78
|
1
|
|
|
1
|
|
5
|
use constant P_POLYC => 7; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
79
|
1
|
|
|
1
|
|
5
|
use constant P_EQUIDC => 8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
80
|
1
|
|
|
1
|
|
5
|
use constant P_TM => 9; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
81
|
1
|
|
|
1
|
|
4
|
use constant P_STEREO => 10; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
82
|
1
|
|
|
1
|
|
6
|
use constant P_LAMAZ => 11; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
83
|
1
|
|
|
1
|
|
6
|
use constant P_AZMEQD => 12; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
84
|
1
|
|
|
1
|
|
4
|
use constant P_GNOMON => 13; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
85
|
1
|
|
|
1
|
|
5
|
use constant P_ORTHO => 14; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
86
|
1
|
|
|
1
|
|
5
|
use constant P_GVNSP => 15; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
87
|
1
|
|
|
1
|
|
10
|
use constant P_SNSOID => 16; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
88
|
1
|
|
|
1
|
|
6
|
use constant P_EQRECT => 17; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
89
|
1
|
|
|
1
|
|
5
|
use constant P_MILLER => 18; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
90
|
1
|
|
|
1
|
|
5
|
use constant P_VGRINT => 19; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
91
|
1
|
|
|
1
|
|
6
|
use constant P_HOM => 20; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
92
|
1
|
|
|
1
|
|
5
|
use constant P_ROBIN => 21; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
93
|
1
|
|
|
1
|
|
6
|
use constant P_SOM => 22; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
94
|
1
|
|
|
1
|
|
5
|
use constant P_ALASKA => 23; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
95
|
1
|
|
|
1
|
|
6
|
use constant P_GOOD => 24; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
425
|
|
96
|
1
|
|
|
1
|
|
7
|
use constant P_MOLL => 25; |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
49
|
|
97
|
1
|
|
|
1
|
|
5
|
use constant P_IMOLL => 26; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
98
|
1
|
|
|
1
|
|
6
|
use constant P_HAMMER => 27; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
99
|
1
|
|
|
1
|
|
23
|
use constant P_WAGIV => 28; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
100
|
1
|
|
|
1
|
|
6
|
use constant P_WAGVII => 29; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
101
|
1
|
|
|
1
|
|
5
|
use constant P_OBEQA => 30; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
47
|
|
102
|
1
|
|
|
1
|
|
4
|
use constant P_USDEF => 99; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
103
|
|
|
|
|
|
|
|
104
|
1
|
|
|
1
|
|
5
|
use constant U_RADIAN => 0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
105
|
1
|
|
|
1
|
|
5
|
use constant U_FEET => 1; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
106
|
1
|
|
|
1
|
|
5
|
use constant U_METER => 2; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
47
|
|
107
|
1
|
|
|
1
|
|
5
|
use constant U_SECOND => 3; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
108
|
1
|
|
|
1
|
|
5
|
use constant U_DEGREE => 4; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
109
|
1
|
|
|
1
|
|
5
|
use constant U_INT_FEET => 5; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
56
|
|
110
|
1
|
|
|
1
|
|
5
|
use constant U_STPLN_TABLE => 6; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
111
|
|
|
|
|
|
|
|
112
|
1
|
|
|
1
|
|
12
|
use constant D_WGS84 => 12; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
###################################################### |
116
|
|
|
|
|
|
|
|
117
|
1
|
|
|
1
|
|
5
|
use vars qw[$ERROR_CODE]; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
336
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub projectCoordinatePair { |
120
|
|
|
|
|
|
|
my( |
121
|
0
|
|
|
0
|
0
|
|
$proto, |
122
|
|
|
|
|
|
|
$in_x, $in_y, |
123
|
|
|
|
|
|
|
$in_sys, $in_zone, $in_params, $in_unit, $in_datum, |
124
|
|
|
|
|
|
|
$out_sys, $out_zone, $out_params, $out_unit, $out_datum |
125
|
|
|
|
|
|
|
) = @_; |
126
|
|
|
|
|
|
|
#print STDERR "params=[", (join ';', @_), "]\n"; |
127
|
0
|
|
|
|
|
|
$ERROR_CODE = 0; |
128
|
0
|
|
|
|
|
|
my($out_x, $out_y) = (0, 0); |
129
|
0
|
|
|
|
|
|
_exec_gctp_interface( |
130
|
|
|
|
|
|
|
$in_x, $in_y, $in_sys, $in_zone, |
131
|
|
|
|
|
|
|
$in_params->[0], $in_params->[1], $in_params->[2], $in_params->[3], |
132
|
|
|
|
|
|
|
$in_params->[4], $in_params->[5], $in_params->[6], $in_params->[7], |
133
|
|
|
|
|
|
|
$in_params->[8], $in_params->[9], $in_params->[10], $in_params->[11], |
134
|
|
|
|
|
|
|
$in_params->[12], $in_params->[13], $in_params->[14], |
135
|
|
|
|
|
|
|
$in_unit, $in_datum, |
136
|
|
|
|
|
|
|
$out_x, $out_y, $out_sys, $out_zone, |
137
|
|
|
|
|
|
|
$out_params->[0], $out_params->[1], $out_params->[2], $out_params->[3], |
138
|
|
|
|
|
|
|
$out_params->[4], $out_params->[5], $out_params->[6], $out_params->[7], |
139
|
|
|
|
|
|
|
$out_params->[8], $out_params->[9], $out_params->[10], $out_params->[11], |
140
|
|
|
|
|
|
|
$out_params->[12], $out_params->[13], $out_params->[14], |
141
|
|
|
|
|
|
|
$out_unit, $out_datum, |
142
|
|
|
|
|
|
|
$ERROR_CODE |
143
|
|
|
|
|
|
|
); |
144
|
0
|
0
|
|
|
|
|
return if $ERROR_CODE; |
145
|
0
|
|
|
|
|
|
return($out_x, $out_y); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub getErrorCode { |
149
|
0
|
|
|
0
|
0
|
|
return $ERROR_CODE; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
1; |
159
|
|
|
|
|
|
|
__END__ |