aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgis-observation-map5
1 files changed, 4 insertions, 1 deletions
diff --git a/gis-observation-map b/gis-observation-map
index 91abd1e..966d438 100755
--- a/gis-observation-map
+++ b/gis-observation-map
@@ -427,7 +427,10 @@ def getObservations(taxonLists, taxonRedlistCategories, searchFilter):
)
resp.raise_for_status()
- obs = resp.json()
+ if resp.text == '':
+ obs = { 'crs': 'EPSG:4326', 'type': 'FeatureCollection', 'features': [] }
+ else:
+ obs = resp.json()
# https://www.rfc-editor.org/rfc/rfc7946
if obs is None or type(obs) != dict or 'type' not in obs.keys():