Mercurial > dive4elements > river
diff flys-backend/contrib/shpimporter/importer.py @ 4970:174fbaa3d344 dami
Add handling of River Names and remove target_src parameter
This is the first step to make the shpimporter into a more
generic geo importer that communicates directly (not only over
ogr) with the database.
Untested with Oracle
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 13 Feb 2013 12:02:30 +0100 |
parents | 23a090b41543 |
children | a92241d40228 |
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/importer.py Mon Feb 04 17:54:39 2013 +0100 +++ b/flys-backend/contrib/shpimporter/importer.py Wed Feb 13 12:02:30 2013 +0100 @@ -9,12 +9,12 @@ class Importer: - def __init__(self, config, dbconn): - self.config = config + def __init__(self, river_id, dbconn, dry_run): + self.river_id = river_id self.dbconn = dbconn - self.river_id = config.river_id + self.dry_run = dry_run self.dest_srs = osr.SpatialReference() - self.dest_srs.ImportFromEPSG(config.target_srs) + self.dest_srs.ImportFromEPSG(31467) self.handled_fields = [] self.tracking_import = False self.srcLayer = None @@ -219,7 +219,7 @@ " ".join(unhandled)) try: - if self.config.dry_run > 0: + if self.dry_run: return geomType destLayer.CommitTransaction() except e: