Render/Viewport.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 2 / 2 totaltotal 92.3% 24 / 26 CC 1 SCAR 1.5
CC
1
Cov
94%
x_y_to_map_x_y
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Render/Projection.pm ↑ Summary Render/Projection/CH_LV03.pm »
1 # Encoding and name #_{
2  
3 =encoding utf8
4 =head1 NAME
5  
6 Geo::OSM::Render::Viewport - 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::Viewport;
10 #_}
11 #_{ use …
12 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 #_}
19 4 our $VERSION = 0.01;
20 #_{ Synopsis
21  
22 =head1 SYNOPSIS
23  
24 This is an abstract base class. So, I am hard pressed to write a synopsis here.
25  
26  
27 =cut
28 #_}
29 #_{ Overview
30  
31 =head1 OVERVIEW
32  
33 After projecting OSM coordinates onto a coordinate system with L<< Geo::OSM::Render::Projection >>, the resulting
34 coordinates migth be translated onto the coordinate system of the map.
35 This can be done with an instance of C<< viewport >>.
36  
37 =cut
38  
39 #_}
40 #_{ Methods
41 #_{ POD
42 =head1 METHODS
43 =cut
44 #_}
45 4 ▶sub new { #_{
Subroutine new: called CC=1 SCAR=0.0
Pod documented
46 #_{ POD
47  
48 =head2 new
49  
50 my $vp = Geo::OSM::Render::Viewport->new();
51  
52 Create an instance of a viewport. Use it in a derived class.
53  
54 =cut
55  
56 #_}
57  
58 4 my $class = shift;
59 4 my $self = {};
60 4 bless $self, $class;
61  
62 } #_}
63 0 ▶sub x_y_to_map_x_y { #_{
Subroutine x_y_to_map_x_y: not called CC=1 SCAR=6.9
Pod documented
64 #_{ POD
65  
66 =head2 x_y_to_map_x_y
67  
68 my ($map_x, $map_y) = $vp->x_y_to_map_x_y($x, $$y);
69  
70 Because this is an abstract base class, calling this method on C<<Geo::OSM::Render::Viewport>> just
71 croaks.
72  
73 =cut
74  
75 #_}
76  
77 0 croak ('Override this method in a descendant');
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 4 'tq84';
« Render/Projection.pm ↑ Summary Render/Projection/CH_LV03.pm »