mapbox / geojson.io

A quick, simple tool for creating, viewing, and sharing spatial data
http://geojson.io/
ISC License
1.87k stars 560 forks source link

Presence of CRS element should not block display #849

Closed stevage closed 1 year ago

stevage commented 1 year ago

There are tools around, including GDAL's ogr2ogr (at least as recently as 3.0.4) which produce GeoJSON with this element at the top level

"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

geojson.io refuses to validate any file with this element, showing this error:

image

That means you can't display the output of a GeoJSON file produced by GDAL. Even though the file is perfectly valid - it's simply a deprecated attribute that should be ignored.

chriswhong commented 1 year ago

This will need to be addressed in geojsonhint. A similar issue came up about enforcing winding order and the fix in https://github.com/mapbox/geojson.io/pull/786 was to accept as warnings anything returned by geojsonhint that does not have a level property.

The crs error does not have a level property so it's considered an error by geojson.io. However you're allowed to add any arbitrary properties to the geojson that don't cause any error, so crs should still be allowed despite it not being part of the spec anymore.

We look into getting this small change into geojsonhint.

chriswhong commented 1 year ago

Geojsonhint update: https://github.com/mapbox/geojsonhint/pull/91