comparison 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
comparison
equal deleted inserted replaced
4933:03989fa957fc 4934:11b459a3eb5c
111 111
112 def getName(self): 112 def getName(self):
113 return "HWS_POINTS" 113 return "HWS_POINTS"
114 114
115 def isGeometryValid(self, geomType): 115 def isGeometryValid(self, geomType):
116 return geomType == 1 116 return geomType == ogr.wkbPoint or geomType == ogr.wkbPoint25D
117 117
118 def isShapeRelevant(self, name, path): 118 def isShapeRelevant(self, name, path):
119 if "punkte" in os.path.basename(path).lower(): 119 shp = ogr.Open(path)
120 if shp.GetLayerByName(name).GetGeomType() == ogr.wkbPoint or \
121 shp.GetLayerByName(name).GetGeomType() == ogr.wkbPoint25D:
120 return True 122 return True
121 else: 123 else:
122 return False 124 return False
123 125
124 def createNewFeature(self, featureDef, feat, **args): 126 def createNewFeature(self, featureDef, feat, **args):

http://dive4elements.wald.intevation.org