Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support GeoJSON and 2dsphere queries #109
referenced this pull request
May 15, 2013
For the most shapes it's a simple copy of the old
The same with the
Simply it does the same as the user can, but if the user forgets about the radius should be in radians, the
I created a library two weeks ago, geojson, that I'm hoping will address this without the need to create duplicate methods. If the first argument is a Geometry object, we'd immediately know to use the GeoJSON operators under the hood. Additionally, the library does all the validation of shapes upon construction. I blogged about this last week here.
I think this is best left to the user. If the sphere happens to not be earth, the multiplier will differ anyway. Also, this would let Doctrine avoid having to default to accepting miles or kilometers. If the user did want to pass radians, and we defaulted to one of the other units, they'd have to specify a multiplier of
@patkar: I resolved the outstanding todo items and pushed the changes I discussed in my last comment. Let me know what you think.
I added deprecation doc tags to the older
I want to be careful to leave the GeoJSON library as an optional dependency, so perhaps I can go a step further and remove the type-hints in
If a GeoJSON object is passed in, I can call