Skip to content

Commit

Permalink
Update webservices.py
Browse files Browse the repository at this point in the history
Small fix for Error: Assigning CRS to a GeoDataFrame without a geometry column is not supported
  • Loading branch information
rubencalje committed Jul 10, 2023
1 parent 62eadc9 commit 961f321
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nlmod/read/webservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ def arcrest(
raise (Exception("Not supported yet"))
feature["attributes"]["geometry"] = geometry
data.append(feature["attributes"])
gdf = gpd.GeoDataFrame(data, crs=sr)
if len(data) == 0:
# Assigning CRS to a GeoDataFrame without a geometry column is not supported
gdf = gpd.GeoDataFrame()
else:
gdf = gpd.GeoDataFrame(data, crs=sr)
else:
# for geojson-data we can transform to GeoDataFrame right away
if len(features) == 0:
Expand Down

0 comments on commit 961f321

Please sign in to comment.