Mercurial > dive4elements > river
diff flys-backend/contrib/shpimporter/hws.py @ 4934:11b459a3eb5c dami
Importer: Import hws_points based on geom type
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 31 Jan 2013 12:21:59 +0100 |
parents | 03989fa957fc |
children | c0a58558b817 |
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/hws.py Thu Jan 31 12:07:40 2013 +0100 +++ b/flys-backend/contrib/shpimporter/hws.py Thu Jan 31 12:21:59 2013 +0100 @@ -113,10 +113,12 @@ return "HWS_POINTS" def isGeometryValid(self, geomType): - return geomType == 1 + return geomType == ogr.wkbPoint or geomType == ogr.wkbPoint25D def isShapeRelevant(self, name, path): - if "punkte" in os.path.basename(path).lower(): + shp = ogr.Open(path) + if shp.GetLayerByName(name).GetGeomType() == ogr.wkbPoint or \ + shp.GetLayerByName(name).GetGeomType() == ogr.wkbPoint25D: return True else: return False