| 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<Geo::OSM::Render>. | ||
| 7 | |||
| 8 | =cut | ||
| 9 | package Geo::OSM::Render::Projection::Ident; | ||
| 10 | #_} | ||
| 11 | #_{ use … | ||
| 12 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 3 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 3 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 3 | ▶ | use Geo::OSM::Render::Projection; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 3 | our @ISA = qw(Geo::OSM::Render::Projection); | |
| 19 | |||
| 20 | #_} | ||
| 21 | 3 | our $VERSION = 0.01; | |
| 22 | #_{ Synopsis | ||
| 23 | |||
| 24 | =head1 SYNOPSIS | ||
| 25 | |||
| 26 | This class derives from L<<Geo::OSM::Render::Projection>>. It performs an ident projection. | ||
| 27 | |||
| 28 | =cut | ||
| 29 | #_} | ||
| 30 | #_{ Overview | ||
| 31 | |||
| 32 | =head1 OVERVIEW | ||
| 33 | |||
| 34 | See L<Geo::OSM::Render::Projection/OVERVIEW>. | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | #_} | ||
| 39 | #_{ Methods | ||
| 40 | #_{ POD | ||
| 41 | =head1 METHODS | ||
| 42 | =cut | ||
| 43 | #_} | ||
| 44 | 3 | ▶ | sub new { #_{ |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 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 | my $class = shift; | |
| 57 | 3 | my $self = $class->SUPER::new(); | |
| 58 | 3 | return $self; | |
| 59 | |||
| 60 | } #_} | ||
| 61 | 10 | ▶ | sub lat_lon_to_x_y { #_{ |
|
Subroutine
lat_lon_to_x_y: called CC=1 SCAR=0.0
Pod
documented
| |||
| 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 | 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 | return ($_[1], $_[0]); | |
| 78 | |||
| 79 | } #_} | ||
| 80 | #_} | ||
| 81 | #_{ POD: Author | ||
| 82 | |||
| 83 | =head1 AUTHOR | ||
| 84 | |||
| 85 | René Nyffenegger <rene.nyffenegger at adp-gmbh.ch> | ||
| 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<http://www.perlfoundation.org/artistic_license_2_0> | ||
| 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 | 3 | 'tq84'; | |