Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/axis.py @ 5128:a020100ee6a1
SCHEME CHANGE: Merge branch dami into default.
A summary on the scheme changes:
HWS and Lines tables are dropped and will be replaced by HWS_Lines and
HWS_Points.
The catchment table removed and will be replaced
by a WMS Service.
Hydr_boundaries has an added reference to boundary_kind sectie_kind
and sobek_kind objects.
Dem has a new column srid.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 28 Feb 2013 11:48:17 +0100 |
parents | c5187ab9f571 |
children | 04eb62eae722 |
comparison
equal
deleted
inserted
replaced
5126:e37b25628dd4 | 5128:a020100ee6a1 |
---|---|
1 import ogr | 1 try: |
2 from osgeo import ogr | |
3 except ImportError: | |
4 import ogr | |
2 | 5 |
3 from importer import Importer | 6 from importer import Importer |
4 import shpimporter | |
5 | 7 |
6 NAME="Axis" | 8 NAME="Axis" |
7 TABLE_NAME="river_axes" | 9 TABLE_NAME="river_axes" |
8 PATH="Geodaesie/Flussachse+km" | 10 PATH="Geodaesie/Flussachse+km" |
9 | 11 |
25 def isGeometryValid(self, geomType): | 27 def isGeometryValid(self, geomType): |
26 return geomType == 2 | 28 return geomType == 2 |
27 | 29 |
28 | 30 |
29 def isShapeRelevant(self, name, path): | 31 def isShapeRelevant(self, name, path): |
30 return name == "achse" or name.find("achse") >= 0 | 32 return "achse" in name.lower() |
31 | 33 |
32 | 34 |
33 def createNewFeature(self, featureDef, feat, **args): | 35 def createNewFeature(self, featureDef, feat, **args): |
34 newFeat = ogr.Feature(featureDef) | 36 newFeat = ogr.Feature(featureDef) |
35 newFeat.SetGeometry(feat.GetGeometryRef()) | 37 newFeat.SetGeometry(feat.GetGeometryRef()) |