# HG changeset patch # User Andre Heinecke # Date 1363802562 -3600 # Node ID a5291a126e2401f50f0ed38e48aec82f5a357aae # Parent 480d2f1f61cc2a74bd47c9dc73a9ff7357f3bf4c Enforce two dimensional point geometries diff -r 480d2f1f61cc -r a5291a126e24 flys-backend/contrib/shpimporter/fixpoints.py --- 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"): diff -r 480d2f1f61cc -r a5291a126e24 flys-backend/contrib/shpimporter/km.py --- 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"):