Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/km.py @ 5356:a5291a126e24
Enforce two dimensional point geometries
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 20 Mar 2013 19:02:42 +0100 |
parents | f0c47b4beded |
children |
comparison
equal
deleted
inserted
replaced
5355:480d2f1f61cc | 5356:a5291a126e24 |
---|---|
32 return name.lower() == "km" | 32 return name.lower() == "km" |
33 | 33 |
34 | 34 |
35 def createNewFeature(self, featureDef, feat, **args): | 35 def createNewFeature(self, featureDef, feat, **args): |
36 newFeat = ogr.Feature(featureDef) | 36 newFeat = ogr.Feature(featureDef) |
37 newFeat.SetGeometry(feat.GetGeometryRef()) | 37 |
38 geometry = feat.GetGeometryRef() | |
39 geometry.SetCoordinateDimension(2) | |
40 newFeat.SetGeometry(geometry) | |
41 | |
38 newFeat.SetField("name", args['name']) | 42 newFeat.SetField("name", args['name']) |
39 | 43 |
40 if self.IsFieldSet(feat, "river_id"): | 44 if self.IsFieldSet(feat, "river_id"): |
41 newFeat.SetField("river_id", feat.GetField("river_id")) | 45 newFeat.SetField("river_id", feat.GetField("river_id")) |
42 else: | 46 else: |