ingo@2798: import ogr ingo@2853: ingo@2798: import utils ingo@2853: from uesg import UESG ingo@2853: from axis import Axis ingo@2853: from km import KM ingo@2853: from lines import Line ingo@2853: from fixpoints import Fixpoint ingo@2853: from buildings import Building ingo@2853: from crosssectiontracks import CrosssectionTrack ingo@2798: ingo@2853: DBCONN='OCI:user/pass@host' ingo@2853: PATH='/path/to/Gewaesser/Elbe' ingo@2853: RIVER_ID=the_river_id ingo@2798: ingo@2798: ingo@2853: def getImporters(): ingo@2853: return [ ingo@2853: Axis(DBCONN, RIVER_ID), ingo@2853: KM(DBCONN, RIVER_ID), ingo@2853: CrosssectionTrack(DBCONN, RIVER_ID), ingo@2853: Line(DBCONN, RIVER_ID), ingo@2853: Fixpoint(DBCONN, RIVER_ID), ingo@2853: Building(DBCONN, RIVER_ID), ingo@2853: UESG(DBCONN, RIVER_ID)] ingo@2798: ingo@2798: ingo@2798: if __name__ == '__main__': ingo@2853: importers = getImporters() ingo@2798: ingo@2798: types = {} ingo@2798: ingo@2853: for importer in importers: ingo@2853: shapes = utils.findShapefiles(importer.getPath(PATH)) ingo@2853: print "Found %i Shapefiles" % len(shapes) ingo@2853: ingo@2853: for shpTuple in shapes: ingo@2853: geomType = importer.walkOverShapes(shpTuple) ingo@2853: try: ingo@2853: num = types[geomType] ingo@2853: types[geomType] = num+1 ingo@2853: except: ingo@2853: types[geomType] = 1 ingo@2798: ingo@2798: for key in types: ingo@2798: print "%i x geometry type %s" % (types[key], key) ingo@2798: