Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/importer.py @ 4885:89a8764cabcc
Importer: Only show imported fields if copy_fields is used
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 28 Jan 2013 12:27:04 +0100 |
parents | b457532dae63 |
children | 8e99d2d9364d |
comparison
equal
deleted
inserted
replaced
4884:b457532dae63 | 4885:89a8764cabcc |
---|---|
13 self.dbconn = dbconn | 13 self.dbconn = dbconn |
14 self.river_id = config.river_id | 14 self.river_id = config.river_id |
15 self.dest_srs = osr.SpatialReference() | 15 self.dest_srs = osr.SpatialReference() |
16 self.dest_srs.ImportFromEPSG(config.target_srs) | 16 self.dest_srs.ImportFromEPSG(config.target_srs) |
17 self.handled_fields = [] | 17 self.handled_fields = [] |
18 self.tracking_import = False | |
18 | 19 |
19 def getKind(self, path): | 20 def getKind(self, path): |
20 raise NotImplementedError("Importer.getKind is abstract!") | 21 raise NotImplementedError("Importer.getKind is abstract!") |
21 | 22 |
22 def getPath(self, base): | 23 def getPath(self, base): |
91 copy from the source to the destination feature. | 92 copy from the source to the destination feature. |
92 | 93 |
93 The Key is the attribute of the source feature to be copied | 94 The Key is the attribute of the source feature to be copied |
94 into the target attribute named by the dict's value. | 95 into the target attribute named by the dict's value. |
95 """ | 96 """ |
97 self.tracking_import = True | |
96 self.handled_fields.extend(mapping.keys()) | 98 self.handled_fields.extend(mapping.keys()) |
97 for key, value in mapping.items(): | 99 for key, value in mapping.items(): |
98 if src.GetFieldIndex(key) == -1: | 100 if src.GetFieldIndex(key) == -1: |
99 continue | 101 continue |
100 # 0 OFTInteger, Simple 32bit integer | 102 # 0 OFTInteger, Simple 32bit integer |