-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly parse KMZ files (#1205)
* chore: add sample KMZ files * chore: add kmz parsing test * fix: correctly pass file buffer and not file path to parse_kml_file * style: add missing newline * chore: add trailing newlines to sample JSON and KML files
- Loading branch information
1 parent
70dd3a9
commit 65266a7
Showing
10 changed files
with
191 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,4 +159,4 @@ | |
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1205,4 +1205,4 @@ | |
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ | |
</Polygon> | ||
</Placemark> | ||
</Document> | ||
</kml> | ||
</kml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ | |
} | ||
} | ||
] | ||
} | ||
} |
Binary file not shown.
162 changes: 162 additions & 0 deletions
162
terraso_backend/tests/resources/gis/kmz_sample_1_geojson.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
{ | ||
"type":"FeatureCollection", | ||
"features":[ | ||
{ | ||
"type":"Feature", | ||
"properties":{ | ||
"Name":"2023/10/18", | ||
"description":"<style>\ntable{border-collapse:collapse; margin:5 5 10 0px;}\ntable td{border: 1px solid #e0e0e0; padding:5px;}\ntable .head {font-weight: bold; background-color:#f9f8f8;}\ntable .light {background-color: #f9f8f8;}\ntable .dark {background-color: #f3f2f2;}\n.datatablebox table {max-width=600px; margin:5 5 5 0px;}\n</style>\n<div id=\"com.miocool.mapplus.subtitle\">\n297 m, 12 min\n</div>\n<br/>\n<div id=\"mapplus-base-properties\" class=\"datatablebox\">\n<table>\n <tr style=\"background-color: #f9f8f8;\">\n <td><b>Distance</b></td>\n <td>297 m</td>\n </tr>\n <tr style=\"background-color: #f3f2f2;\">\n <td><b>Start</b></td>\n <td>18 October 2023 at 13:08:28 GMT+2</td>\n </tr>\n <tr style=\"background-color: #f9f8f8;\">\n <td><b>Stop</b></td>\n <td>18 October 2023 at 13:20:52 GMT+2</td>\n </tr>\n <tr style=\"background-color: #f3f2f2;\">\n <td><b>Duration</b></td>\n <td>12 minutes</td>\n </tr>\n <tr style=\"background-color: #f9f8f8;\">\n <td><b>Avg. Speed</b></td>\n <td>1,4 kmph</td>\n </tr>\n <tr style=\"background-color: #f3f2f2;\">\n <td><b>Elev. Max</b></td>\n <td>159 m</td>\n </tr>\n <tr style=\"background-color: #f9f8f8;\">\n <td><b>Elev. Min</b></td>\n <td>151 m</td>\n </tr>\n <tr style=\"background-color: #f3f2f2;\">\n <td><b>Elev. Gain</b></td>\n <td>5,32 m</td>\n </tr>\n <tr style=\"background-color: #f9f8f8;\">\n <td><b>Elev. Loss</b></td>\n <td>-4,93 m</td>\n </tr>\n <tr style=\"background-color: #f3f2f2;\">\n <td><b>Points</b></td>\n <td>29</td>\n </tr>\n</table>\n</div>\n<br/>\n<div id=\"com.miocool.mapplus.recorder\" style=\"color:#b7b7b7;font-size:11px;line-height:30px\">\nRecorded By <a href=\"https://itunes.apple.com/us/app/id438868200?mt=8\">Map Plus</a><br/>\n\n</div>" | ||
}, | ||
"geometry":{ | ||
"type":"LineString", | ||
"coordinates":[ | ||
[ | ||
22.59663677, | ||
-33.98605253, | ||
155.633652 | ||
], | ||
[ | ||
22.5966076, | ||
-33.98595971, | ||
154.259445 | ||
], | ||
[ | ||
22.59660618, | ||
-33.98586526, | ||
152.609299 | ||
], | ||
[ | ||
22.59650336, | ||
-33.98580228, | ||
153.185974 | ||
], | ||
[ | ||
22.59639406, | ||
-33.98576777, | ||
153.788025 | ||
], | ||
[ | ||
22.59627639, | ||
-33.9857417, | ||
155.774704 | ||
], | ||
[ | ||
22.59618089, | ||
-33.98568352, | ||
156.403198 | ||
], | ||
[ | ||
22.59610081, | ||
-33.98561315, | ||
157.046158 | ||
], | ||
[ | ||
22.59603216, | ||
-33.98553925, | ||
156.952423 | ||
], | ||
[ | ||
22.59592388, | ||
-33.98548113, | ||
157.632202 | ||
], | ||
[ | ||
22.5958389, | ||
-33.98541891, | ||
158.116058 | ||
], | ||
[ | ||
22.59580311, | ||
-33.98532135, | ||
157.234528 | ||
], | ||
[ | ||
22.59571012, | ||
-33.98525727, | ||
158.816055 | ||
], | ||
[ | ||
22.59584222, | ||
-33.98529332, | ||
156.142609 | ||
], | ||
[ | ||
22.59595874, | ||
-33.98529793, | ||
153.434128 | ||
], | ||
[ | ||
22.59600202, | ||
-33.9853111, | ||
153.49176 | ||
], | ||
[ | ||
22.59609239, | ||
-33.98536789, | ||
153.464493 | ||
], | ||
[ | ||
22.59614266, | ||
-33.98545746, | ||
153.648254 | ||
], | ||
[ | ||
22.59627174, | ||
-33.98553563, | ||
152.890488 | ||
], | ||
[ | ||
22.59637918, | ||
-33.98557102, | ||
151.717392 | ||
], | ||
[ | ||
22.59646774, | ||
-33.98563175, | ||
150.707565 | ||
], | ||
[ | ||
22.59654701, | ||
-33.98569996, | ||
150.843887 | ||
], | ||
[ | ||
22.59662362, | ||
-33.98577448, | ||
150.770142 | ||
], | ||
[ | ||
22.59669836, | ||
-33.98584456, | ||
151.435516 | ||
], | ||
[ | ||
22.5968001, | ||
-33.98590725, | ||
151.944595 | ||
], | ||
[ | ||
22.59682657, | ||
-33.98600427, | ||
152.788086 | ||
], | ||
[ | ||
22.59671285, | ||
-33.98607463, | ||
154.425354 | ||
], | ||
[ | ||
22.59671103, | ||
-33.986171, | ||
156.02887 | ||
], | ||
[ | ||
22.59671103, | ||
-33.986171, | ||
156.02887 | ||
] | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters