diff --git a/cove_ofds/process.py b/cove_ofds/process.py index 147f32e..871cc99 100644 --- a/cove_ofds/process.py +++ b/cove_ofds/process.py @@ -288,6 +288,10 @@ def get_context(self): context["download_geojson_spans_size"] = os.stat( self.spans_file_name ).st_size + with open(self.meta_file_name) as fp: + data = json.load(fp) + context["any_nodes_with_geometry"] = data["any_nodes_with_geometry"] + context["any_spans_with_geometry"] = data["any_spans_with_geometry"] else: context["can_download_geojson"] = False # done! diff --git a/cove_ofds/templates/cove_ofds/explore.html b/cove_ofds/templates/cove_ofds/explore.html index d97b424..784a87e 100644 --- a/cove_ofds/templates/cove_ofds/explore.html +++ b/cove_ofds/templates/cove_ofds/explore.html @@ -268,7 +268,7 @@
{% trans 'The GeoJSON version of your data is visualised on the map below. You should check that nodes and spans appear in the correct location. If not, you may need to ' %}{% trans 'transform your coordinates to the correct coordinate reference system' %}.
- - {% else %} + {% if any_nodes_with_geometry == false and any_spans_with_geometry == false %} +{% trans 'Your data cannot be visualised on a map because it does not contain coordinates. If you expected your data to include coordinates, you should check your mapping and data pipeline for errors. For more information, see ' %}{% trans 'Geometry' %}.
+{% trans 'Your data cannot be visualised because it is not available in GeoJSON format. For more information, see ' %}{% trans 'data conversion' %}.
{% trans 'The GeoJSON version of your data is visualised on the map below. You should check that nodes and spans appear in the correct location. If not, you may need to ' %}{% trans 'transform your coordinates to the correct coordinate reference system' %}.
+ {% endif %}