Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "id" to the "properties" in geoJSON #8

Closed
n-kb opened this issue Dec 3, 2013 · 2 comments
Closed

Add "id" to the "properties" in geoJSON #8

n-kb opened this issue Dec 3, 2013 · 2 comments

Comments

@n-kb
Copy link

n-kb commented Dec 3, 2013

Currently, the geoJSON look like

"type": "Feature",
    "id": 5714,
    "properties": {
        "name": "Crassier"
    }

What would be required to have somthing like this?

"type": "Feature",
    "id": 5714,
    "properties": {
        "name": "Crassier",
        "id": 5714
    }

It would make integration into CartoDB much easier. Thanks for the great tool!

@jstcki jstcki closed this as completed in 4937c8b Jan 11, 2014
@jstcki
Copy link
Contributor

jstcki commented Jan 11, 2014

Hey Nicolas, sorry I kept you waiting! I didn't want to include this per default because it's redundant information and usually not needed for other use cases.

But I added the possibility to specify custom properties without changing the Makefile itself. You can do it like this:

make geo/ch-municipalities.json PROPERTIES=id=+BFS_NUMMER,name=NAME
make geo/ch-cantons.json PROPERTIES=id=+KANTONSNUM,name=NAME,abbr=ABBR
make geo/ch-districts.json PROPERTIES=id=+BEZIRKSNUM,name=NAME
make geo/ch-lakes.json PROPERTIES=id=+SEENR,name=SEENAME

This will include the id and name (and abbr for cantons) properties (in addition to the feature ID itself). Be sure to make clean before because existing TopoJSON and GeoJSON files won't be replaced otherwise.

@n-kb
Copy link
Author

n-kb commented Jan 13, 2014

This is awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants