Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/utils.py @ 5296:55122db34cd0
merge
author | Bettina Gruenbauer <bettina@intevation.de> |
---|---|
date | Thu, 14 Mar 2013 12:53:36 +0100 |
parents | 3f35d9db48c1 |
children |
comparison
equal
deleted
inserted
replaced
5295:ee7b0306b2bf | 5296:55122db34cd0 |
---|---|
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 |