Closed lafrech closed 8 years ago
You should also be able to do p.coordinates[0]
. I don't think we need another way to get the coordinates. Thanks for the idea though!
Yes, I noticed that. It's a bit better.
My data model has a "position" attribute which is a geojson.Point
. Currently, I need to write
my_object.position.coordinates[0]
which I'd happily simplify into
my_object.position[0]
This is not really a big deal, and I guess I could monkey patch geojson geometries or just live with it.
There can be other properties on a Point
besides coordinate
, so I think it wouldn't be too obvious which one you're indexing into.
Fair enough. I thought coordinates
was the only list-like attribute, so it wouldn't be ambiguous.
Sorry for the noise.
All good, no worries! Definitely a good idea that was worth considering :)
Assuming
If would be convenient to be able to write
rather than
Is this something you would consider?
I can send a PR.