aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-10-19 16:27:53 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-10-19 16:27:56 +0200
commite61fd88fe81363d8f84e8f9c42b52c64314c4286 (patch)
treec889f85e50c72c36ab0ff49fdfcb3ac985fa322c
parent3799bc620b2e1865e5e2a7c5938050ca21acf204 (diff)
webmap-publish: Flatten geometry to 2D before exporting.
The webmap ignores elevation, so we might as well flatten geometries to save space.
-rwxr-xr-xwebmap-publish1
1 files changed, 1 insertions, 0 deletions
diff --git a/webmap-publish b/webmap-publish
index 36bed88..1c1e9a2 100755
--- a/webmap-publish
+++ b/webmap-publish
@@ -302,6 +302,7 @@ def exportLayer(lyr_dst, lyr_src, srs=None, clip=None, layername=None,
geom = feature.GetGeometryRef().Clone()
if ct is not None and geom.Transform(ct) != ogr.OGRERR_NONE:
raise Exception('Could not apply coordinate transformation')
+ geom.FlattenTo2D()
if metadata is not None:
# serialize the feature to JSON and save it