comparison flys-backend/contrib/shpimporter/boundaries.py @ 3654:59ca5dab2782

Shape importer: use python's OptionParse to read user specific configuration from command line. flys-backend/trunk@5231 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 22 Aug 2012 11:55:55 +0000
parents b0132e1b9719
children 5a0225ddae2b
comparison
equal deleted inserted replaced
3653:20d249e1589f 3654:59ca5dab2782
3 from importer import Importer 3 from importer import Importer
4 4
5 TABLE_NAME="hydr_boundaries" 5 TABLE_NAME="hydr_boundaries"
6 TABLE_NAME_POLY="hydr_boundaries_poly" 6 TABLE_NAME_POLY="hydr_boundaries_poly"
7 PATH="Hydrologie/Hydr.Grenzen/Linien" 7 PATH="Hydrologie/Hydr.Grenzen/Linien"
8 NAME="Hydr. Boundaries"
8 9
9 10
10 class HydrBoundary(Importer): 11 class HydrBoundary(Importer):
11 12
12 def getPath(self, base): 13 def getPath(self, base):
13 return "%s/%s" % (base, PATH) 14 return "%s/%s" % (base, PATH)
14 15
15 16
16 def getTablename(self): 17 def getTablename(self):
17 return TABLE_NAME 18 return TABLE_NAME
19
20
21 def getName(self):
22 return NAME
18 23
19 24
20 def isGeometryValid(self, geomType): 25 def isGeometryValid(self, geomType):
21 return geomType == 2 26 return geomType == 2
22 27
56 61
57 def getTablename(self): 62 def getTablename(self):
58 return TABLE_NAME_POLY 63 return TABLE_NAME_POLY
59 64
60 65
66 def getName(self):
67 return "%s (Polygons)" % NAME
68
69
61 def isGeometryValid(self, geomType): 70 def isGeometryValid(self, geomType):
62 return geomType == 3 or geomType == 6 71 return geomType == 3 or geomType == 6
63 72
64 73
65 def createNewFeature(self, featureDef, feat, **args): 74 def createNewFeature(self, featureDef, feat, **args):

http://dive4elements.wald.intevation.org