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

Feature .id, .geometry, .properties, .type properties #4

Open
sgillies opened this issue Aug 15, 2015 · 3 comments
Open

Feature .id, .geometry, .properties, .type properties #4

sgillies opened this issue Aug 15, 2015 · 3 comments

Comments

@sgillies
Copy link
Contributor

Lately I'm feeling that, for example, ftr.properties['foo'] is cleaner syntax than ftr['properties']['foo'] and that we could surface all the standard GeoJSON items as Python properties in addition to the old item getter style. So, ftr.id == ftr['id'] would be True.

We could get this by requiring the geojson module or could roll our own dict-based classes.

@geowurster
Copy link
Member

@sgillies Definitely cleaner syntax and more Pythonic but I wonder if it will cause confusion when some GeoJSON libraries have a Feature() class and others don't?

@sgillies
Copy link
Contributor Author

We could update the Python geo protocol while we're at it. Would head off some confusion and help clear up the remainder.

@geowurster
Copy link
Member

Yeah that and recommending people check for __geo_interface__() rather than assuming that an object that appears to be GeoJSON actually is, like our potential Feature() and Geometry() classes.

I sketched out a bit of this ticket in #1.

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