Debian Codegraph @

t/04.kml2wkt_realcase.t

raw
1 use strict;
2 use warnings;
3 use Test::Base;
4
5 use Geo::Converter::WKT2KML;
6
7 plan tests => 1*blocks;
8
9 filters {
10 input => [qw/chomp/],
11 expected => [qw/chomp/],
12 };
13
14 run {
15 my $block = shift;
16
17 is (kml2wkt($block->input),$block->expected);
18 };
19
20 __END__
21
22 === test point
23 --- input
24 <LineString>
25 <extrude>1</extrude>
26 <tessellate>1</tessellate>
27 <altitudeMode>absolute</altitudeMode>
28 <coordinates> -112.2550785337791,36.07954952145647,2357
29 -112.2549277039738,36.08117083492122,2357
30 -112.2552505069063,36.08260761307279,2357
31 </coordinates>
32 </LineString>
33 --- expected
34 LINESTRING(-112.2550785337791 36.07954952145647 2357,-112.2549277039738 36.08117083492122 2357,-112.2552505069063 36.08260761307279 2357)
35
36 === test point
37 --- input
38 <Polygon>
39 <extrude>1</extrude>
40 <altitudeMode>relativeToGround</altitudeMode>
41 <outerBoundaryIs>
42 <LinearRing>
43 <coordinates>
44 -77.05788457660967,38.87253259892824,100
45 -77.05465973756702,38.87291016281703,100
46 -77.05315536854791,38.87053267794386,100
47 </coordinates>
48 </LinearRing>
49 </outerBoundaryIs>
50 <innerBoundaryIs>
51 <LinearRing>
52 <coordinates>
53 -77.05668055019126,38.87154239798456,100
54 -77.05542625960818,38.87167890344077,100
55 -77.05485125901024,38.87076535397792,100
56 </coordinates>
57 </LinearRing>
58 </innerBoundaryIs>
59 </Polygon>
60 --- expected
61 POLYGON((-77.05788457660967 38.87253259892824 100,-77.05465973756702 38.87291016281703 100,-77.05315536854791 38.87053267794386 100),(-77.05668055019126 38.87154239798456 100,-77.05542625960818 38.87167890344077 100,-77.05485125901024 38.87076535397792 100))
62
63 === test point
64 --- input
65 <MultiGeometry>
66 <LineString>
67 <!-- north wall -->
68 <coordinates>
69 -122.4425587930444,37.80666418607323,0
70 -122.4428379594768,37.80663578323093,0
71 </coordinates>
72 </LineString>
73 <LineString>
74 <!-- south wall -->
75 <coordinates>
76 -122.4425509770566,37.80662588061205,0
77 -122.4428340530617,37.8065999493009,0
78 </coordinates>
79 </LineString>
80 </MultiGeometry>
81 --- expected
82 MULTILINESTRING((-122.4425587930444 37.80666418607323 0,-122.4428379594768 37.80663578323093 0),(-122.4425509770566 37.80662588061205 0,-122.4428340530617 37.8065999493009 0))
83