summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/models_imports.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py
index 510a9ff7d..0e9f3f6fd 100644
--- a/ishtar_common/models_imports.py
+++ b/ishtar_common/models_imports.py
@@ -1351,6 +1351,8 @@ def convert_geom(feature, srid):
if not feature:
return feature
srid = int(srid)
+ if isinstance(feature, fiona.model.Geometry):
+ feature = fiona.model.to_dict(feature)
geo_type = feature["type"]
if geo_type in ("LineString", "Polygon"):
feature["type"] = "Multi" + geo_type
@@ -2506,6 +2508,8 @@ class Import(BaseImport):
# https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
elif crs.startswith("+init=epsg:"):
srid = crs[len("+init=epsg:"):]
+ elif crs.lower().startswith("epsg:"):
+ srid = int(crs[len("epsg:"):])
else:
srid = CRS.from_proj4(crs).to_epsg()
data = []