changeset 5356:a5291a126e24

Enforce two dimensional point geometries
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 20 Mar 2013 19:02:42 +0100
parents 480d2f1f61cc
children 776427b5aa76
files flys-backend/contrib/shpimporter/fixpoints.py flys-backend/contrib/shpimporter/km.py
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/fixpoints.py	Wed Mar 20 19:02:10 2013 +0100
+++ b/flys-backend/contrib/shpimporter/fixpoints.py	Wed Mar 20 19:02:42 2013 +0100
@@ -37,9 +37,11 @@
 
     def createNewFeature(self, featureDef, feat, **args):
         newFeat  = ogr.Feature(featureDef)
+
         geometry = feat.GetGeometryRef()
+        geometry.SetCoordinateDimension(2)
+        newFeat.SetGeometry(geometry)
 
-        newFeat.SetGeometry(geometry)
         newFeat.SetField("name", args['name'])
 
         if self.IsFieldSet(feat, "river_id"):
--- a/flys-backend/contrib/shpimporter/km.py	Wed Mar 20 19:02:10 2013 +0100
+++ b/flys-backend/contrib/shpimporter/km.py	Wed Mar 20 19:02:42 2013 +0100
@@ -34,7 +34,11 @@
 
     def createNewFeature(self, featureDef, feat, **args):
         newFeat = ogr.Feature(featureDef)
-        newFeat.SetGeometry(feat.GetGeometryRef())
+
+        geometry = feat.GetGeometryRef()
+        geometry.SetCoordinateDimension(2)
+        newFeat.SetGeometry(geometry)
+
         newFeat.SetField("name", args['name'])
 
         if self.IsFieldSet(feat, "river_id"):

http://dive4elements.wald.intevation.org