| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Encoding and name #_{ |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf8 |
|
4
|
|
|
|
|
|
|
=head1 NAME |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Geo::OSM::Render::Projection::Ident - Project OSM latitudes and longitudes into x, y coordinate pairs to be rendered by L. |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=cut |
|
9
|
|
|
|
|
|
|
package Geo::OSM::Render::Projection::Ident; |
|
10
|
|
|
|
|
|
|
#_} |
|
11
|
|
|
|
|
|
|
#_{ use … |
|
12
|
3
|
|
|
3
|
|
205413
|
use warnings; |
|
|
3
|
|
|
|
|
12
|
|
|
|
3
|
|
|
|
|
136
|
|
|
13
|
3
|
|
|
3
|
|
25
|
use strict; |
|
|
3
|
|
|
|
|
11
|
|
|
|
3
|
|
|
|
|
93
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
1047
|
use utf8; |
|
|
3
|
|
|
|
|
41
|
|
|
|
3
|
|
|
|
|
20
|
|
|
16
|
3
|
|
|
3
|
|
114
|
use Carp; |
|
|
3
|
|
|
|
|
12
|
|
|
|
3
|
|
|
|
|
223
|
|
|
17
|
3
|
|
|
3
|
|
1086
|
use Geo::OSM::Render::Projection; |
|
|
3
|
|
|
|
|
40
|
|
|
|
3
|
|
|
|
|
538
|
|
|
18
|
|
|
|
|
|
|
our @ISA = qw(Geo::OSM::Render::Projection); |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#_} |
|
21
|
|
|
|
|
|
|
our $VERSION = 0.01; |
|
22
|
|
|
|
|
|
|
#_{ Synopsis |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This class derives from L<>. It performs an ident projection. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
#_} |
|
30
|
|
|
|
|
|
|
#_{ Overview |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 OVERVIEW |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
See L. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#_} |
|
39
|
|
|
|
|
|
|
#_{ Methods |
|
40
|
|
|
|
|
|
|
#_{ POD |
|
41
|
|
|
|
|
|
|
=head1 METHODS |
|
42
|
|
|
|
|
|
|
=cut |
|
43
|
|
|
|
|
|
|
#_} |
|
44
|
|
|
|
|
|
|
sub new { #_{ |
|
45
|
|
|
|
|
|
|
#_{ POD |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 new |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $proj = Geo::OSM::Render::Projection::Ident->new(); |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#_} |
|
55
|
|
|
|
|
|
|
|
|
56
|
3
|
|
|
3
|
1
|
575
|
my $class = shift; |
|
57
|
3
|
|
|
|
|
37
|
my $self = $class->SUPER::new(); |
|
58
|
3
|
|
|
|
|
11
|
return $self; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} #_} |
|
61
|
|
|
|
|
|
|
sub lat_lon_to_x_y { #_{ |
|
62
|
|
|
|
|
|
|
#_{ POD |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 lat_lon_to_x_y |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my ($x, $y) = $projection->lat_lon_to_x_y($lat, $lon); |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
#_} |
|
71
|
|
|
|
|
|
|
|
|
72
|
10
|
|
|
10
|
1
|
19
|
my $self = shift; |
|
73
|
|
|
|
|
|
|
# |
|
74
|
|
|
|
|
|
|
# Must return the passed parameters lat and lon in reverse order because |
|
75
|
|
|
|
|
|
|
# lat goes in upward direction, lon goes in sideward direction, but x and |
|
76
|
|
|
|
|
|
|
# y is vice versa: |
|
77
|
10
|
|
|
|
|
58
|
return ($_[1], $_[0]); |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} #_} |
|
80
|
|
|
|
|
|
|
#_} |
|
81
|
|
|
|
|
|
|
#_{ POD: Author |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
René Nyffenegger |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#_} |
|
90
|
|
|
|
|
|
|
#_{ POD: Copyright and License |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
93
|
|
|
|
|
|
|
Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved. |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
96
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
|
97
|
|
|
|
|
|
|
copy of the full license at: L |
|
98
|
|
|
|
|
|
|
=cut |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
#_} |
|
101
|
|
|
|
|
|
|
#_{ POD: Source Code |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 Source Code |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
The source code is on L<< github|https://github.com/ReneNyffenegger/perl-Geo-OSM-Render >>. Meaningful pull requests are welcome. |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
#_} |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
'tq84'; |