Skip to content

Commit 3e70f5b

Browse files
committed
fix: no map data return
When no map data is available at a location - returns "Data_unavailable"
1 parent 40261a0 commit 3e70f5b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

soil_id/global_soil.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ def list_soils_global(lon, lat):
8787
buffer_dist=10000,
8888
)
8989
except KeyError:
90-
return("Soil map information is not available at this location")
91-
90+
return("Data_unavailable")
91+
92+
if hwsd2_data.empty:
93+
return("Data_unavailable")
94+
9295
# Component Data
9396
mucompdata_pd = hwsd2_data[["hwsd2", "fao90_name", "distance", "share", "compid"]]
9497
mucompdata_pd.columns = ["mukey", "compname", "distance", "share", "cokey"]

0 commit comments

Comments
 (0)