Skip to content

Commit

Permalink
fix: Catch any geos.WKTReader() exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Jan 6, 2021
1 parent 3a19711 commit 14f7721
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lbsntransform/tools/helper_functions.py
Expand Up @@ -621,10 +621,13 @@ def return_ewkb_from_geotext(text):
if text is None:
# keep Null geometries, e.g. for geom_area columns
return None
geom = wkt.loads(text)
# Set SRID to WGS1984
geos.lgeos.GEOSSetSRID(geom._geom, 4326)
geom = geom.wkb_hex
try:
geom = wkt.loads(text)
# Set SRID to WGS1984
geos.lgeos.GEOSSetSRID(geom._geom, 4326)
geom = geom.wkb_hex
except:
return None
return geom

@staticmethod
Expand Down

0 comments on commit 14f7721

Please sign in to comment.