line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::JSON::Types; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.006'; # VERSION |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: Type::Tiny data types for Geo::JSON classes |
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
118226
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
260
|
|
8
|
6
|
|
|
6
|
|
35
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
386
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BEGIN { |
11
|
6
|
|
|
|
|
97
|
use Type::Library -base, -declare => qw/ |
12
|
|
|
|
|
|
|
CRS |
13
|
|
|
|
|
|
|
Feature |
14
|
|
|
|
|
|
|
Features |
15
|
|
|
|
|
|
|
Geometry |
16
|
|
|
|
|
|
|
LinearRing |
17
|
|
|
|
|
|
|
LineString |
18
|
|
|
|
|
|
|
LineStrings |
19
|
|
|
|
|
|
|
Polygon |
20
|
|
|
|
|
|
|
Polygons |
21
|
|
|
|
|
|
|
Position |
22
|
|
|
|
|
|
|
Positions |
23
|
6
|
|
|
6
|
|
2533
|
/; |
|
6
|
|
|
|
|
124773
|
|
24
|
6
|
|
|
6
|
|
15360
|
use Type::Utils; |
|
6
|
|
|
|
|
30037
|
|
|
6
|
|
|
|
|
65
|
|
25
|
6
|
|
|
6
|
|
12532
|
use Types::Standard -types; |
|
6
|
|
|
|
|
154964
|
|
|
6
|
|
|
|
|
1207
|
|
26
|
|
|
|
|
|
|
|
27
|
6
|
|
|
6
|
|
40450
|
use Geo::JSON::Utils qw/ compare_positions /; |
|
6
|
|
|
|
|
19
|
|
|
6
|
|
|
|
|
3077
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
declare Position, # |
30
|
|
|
|
|
|
|
as ArrayRef [Num], # |
31
|
6
|
|
|
6
|
|
34
|
where { @{$_} >= 2 }; |
|
1809
|
|
|
|
|
219835
|
|
|
1809
|
|
|
|
|
4517
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
declare Positions, # |
34
|
|
|
|
|
|
|
as ArrayRef [Position], # |
35
|
6
|
|
|
|
|
26742
|
where { @{$_} > 0 }; |
|
59
|
|
|
|
|
804
|
|
|
59
|
|
|
|
|
183
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
declare LineString, # |
38
|
|
|
|
|
|
|
as Positions, # |
39
|
6
|
|
|
|
|
6904
|
where { @{$_} >= 2 }; |
|
51
|
|
|
|
|
360
|
|
|
51
|
|
|
|
|
154
|
|
40
|
|
|
|
|
|
|
|
41
|
6
|
|
|
|
|
4284
|
declare LineStrings, # |
42
|
|
|
|
|
|
|
as ArrayRef [LineString]; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
declare LinearRing, # |
45
|
|
|
|
|
|
|
as LineString, # |
46
|
6
|
50
|
|
|
|
8232
|
where { @{$_} >= 4 && compare_positions( $_->[0], $_->[-1] ) }; |
|
30
|
|
|
|
|
213
|
|
|
30
|
|
|
|
|
253
|
|
47
|
|
|
|
|
|
|
|
48
|
6
|
|
|
|
|
4033
|
declare Polygon, # |
49
|
|
|
|
|
|
|
as ArrayRef [LinearRing]; |
50
|
|
|
|
|
|
|
|
51
|
6
|
|
|
|
|
6467
|
declare Polygons, # |
52
|
|
|
|
|
|
|
as ArrayRef [Polygon]; |
53
|
|
|
|
|
|
|
|
54
|
6
|
|
|
|
|
7018
|
declare Geometry, as Object, where { $_->does("Geo::JSON::Role::Geometry") }; |
|
47
|
|
|
|
|
47828
|
|
55
|
|
|
|
|
|
|
|
56
|
6
|
|
|
|
|
4584
|
class_type CRS, { class => 'Geo::JSON::CRS' }; |
57
|
6
|
|
|
|
|
24895
|
class_type Feature, { class => 'Geo::JSON::Feature' }; |
58
|
|
|
|
|
|
|
# class_type Geometry, { class => 'Geo::JSON::Geometry' }; |
59
|
|
|
|
|
|
|
|
60
|
6
|
|
|
|
|
4590
|
coerce CRS, from HashRef, q{ 'Geo::JSON::CRS'->new($_) }; |
61
|
|
|
|
|
|
|
|
62
|
6
|
|
|
|
|
1609
|
coerce Feature, from HashRef, q{ 'Geo::JSON'->load( $_ ) }; |
63
|
|
|
|
|
|
|
|
64
|
6
|
|
|
|
|
1165
|
coerce Geometry, from HashRef, q{ 'Geo::JSON'->load( $_ ) }; |
65
|
|
|
|
|
|
|
|
66
|
6
|
|
|
|
|
1194
|
declare Features, as ArrayRef [Feature], coercion => 1; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |