mapbox / geojsonhint

IMPORTANT: This repo will be archived. Use @placemarkio/check-geojson instead
ISC License
258 stars 37 forks source link

Validator says id must be string; draft spec says number is OK #21

Closed NelsonMinar closed 10 years ago

NelsonMinar commented 10 years ago

This code currently requires "id" to be a string, but I think a number is also valid. The latest GeoJSON draft spec I can find says "value of this member is either a JSON string or number". As a practical matter, QGIS emits GeoJSON with integer IDs and so right now you have to hand-edit its output to put it into geojson.io.

Issue #20 also covers this question and was closed saying the string-only behavior is correct, but I think the decision is based on a misunderstanding of what finally got committed to the spec. See here: https://github.com/geojson/draft-geojson/commit/ceb8d6a61ecdd393694a9f3ae2a7c4680ff7fd7e#diff-1261ada59649c3fc43efdedc43f6173b

My apologies if opening a new issue is bad etiquette, and thanks for these great tools! –Nelson

tmcw commented 10 years ago

Hm - yep, seems legit, this'll need to be changed in geojsonhint.