[Dive4elements-commits] [PATCH] Importer: When a hws linestring was two dimensional import it with z=9999

Wald Commits scm-commit at wald.intevation.org
Thu Feb 28 13:16:03 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1362053742 -3600
# Node ID 76db0e48dbc003c8c053a201d859805f67ff02c8
# Parent  fc0cdcae8f07a82dd3eb9e281ae86c7429386ef4
Importer: When a hws linestring was two dimensional import it with z=9999

diff -r fc0cdcae8f07 -r 76db0e48dbc0 flys-backend/contrib/shpimporter/hws.py
--- a/flys-backend/contrib/shpimporter/hws.py	Thu Feb 28 13:09:26 2013 +0100
+++ b/flys-backend/contrib/shpimporter/hws.py	Thu Feb 28 13:15:42 2013 +0100
@@ -194,6 +194,10 @@
         geometry = feat.GetGeometryRef()
         if geometry.GetCoordinateDimension() == 2:
             geometry.SetCoordinateDimension(3)
+            for i in range(0, geometry.GetPointCount()):
+                x,y,z = geometry.GetPoint(i)
+                z = 9999
+                geometry.SetPoint(i, x, y, z)
         newFeat.SetGeometry(geometry)
 
         return utils.convertToMultiLine(newFeat)


More information about the Dive4elements-commits mailing list