jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
908 stars 120 forks source link

Do not add id: null for Features #53

Closed hyperknot closed 9 years ago

hyperknot commented 9 years ago

The GeoJSON specification (https://tools.ietf.org/html/draft-butler-geojson-05#section-2.2) states that:

If a feature has a commonly used identifier, that identifier SHOULD be included as a member of the feature object with the name "id" and the value of this member is either a JSON string or number.

At the moment python-geojson adds id: null for every feature, unless specified. This is very problematic especially on geojson.io web service, which breaks when such features are present (https://github.com/mapbox/geojson.io/issues/450).

This is a PR to fix this behaviour.

frewsxcv commented 9 years ago

Awesome, good catch! Feel free to open another PR to add your self to the credits

hyperknot commented 9 years ago

Thanks, submitted PR for credits.

frewsxcv commented 9 years ago

Just published a new version that includes this change

https://pypi.python.org/pypi/geojson/1.1.0

Thanks again