diff options
-rw-r--r-- | chimere/utils.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chimere/utils.py b/chimere/utils.py index b7a2da8..974f8f3 100644 --- a/chimere/utils.py +++ b/chimere/utils.py @@ -542,7 +542,13 @@ class CSVManager(ImportManager): 'origin':self.importer_instance.origin, 'license':self.importer_instance.license} cls = None - if settings.CHIMERE_NOMINATIM_FIELDS: + if 'POINT' in geom: + cls = Marker + dct['point'] = geom + elif 'LINE' in geom: + cls = Route + dct['route'] = geom + elif settings.CHIMERE_NOMINATIM_FIELDS: nominatim_query = settings.NOMINATIM_URL + "?" nominatim_keys = nominatim_default_query.copy() nominatim_keys['format'] = 'json' @@ -558,12 +564,6 @@ class CSVManager(ImportManager): result = result[0] cls = Marker dct['point'] = "POINT(%s %s)" % (result['lon'], result['lat']) - elif 'POINT' in geom: - cls = Marker - dct['point'] = geom - elif 'LINE' in geom: - cls = Route - dct['route'] = geom else: continue import_key = pk if pk else name.decode('utf-8') |