comparison flys-backend/contrib/shpimporter/utils.py @ 5294:3f35d9db48c1

Force UESG to multipolygon and import source field for messungen
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 14 Mar 2013 12:45:51 +0100
parents 40dc001594e4
children
comparison
equal deleted inserted replaced
5293:8aae8c26844f 5294:3f35d9db48c1
106 srs = geometry.GetSpatialReference() 106 srs = geometry.GetSpatialReference()
107 geometry = ogr.ForceToMultiLineString(geometry) 107 geometry = ogr.ForceToMultiLineString(geometry)
108 geometry.AssignSpatialReference(srs) 108 geometry.AssignSpatialReference(srs)
109 feature.SetGeometry(geometry) 109 feature.SetGeometry(geometry)
110 return feature 110 return feature
111
112 def convertToMultiPolygon(feature):
113 """
114 Converts a feature to a multiline feature.
115 """
116 geometry = feature.GetGeometryRef()
117 # SRS information is lost while forcing to multiline
118 srs = geometry.GetSpatialReference()
119 geometry = ogr.ForceToMultiPolygon(geometry)
120 geometry.AssignSpatialReference(srs)
121 feature.SetGeometry(geometry)
122 return feature

http://dive4elements.wald.intevation.org