-
Notifications
You must be signed in to change notification settings - Fork 94
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
Conversion from double to string #28
Comments
Thanks for mentioning this. I haven't tried these classes with MongoDB yet. I would assume that mongo would serialize the LngLatAlt class as an object with several properties instead of an array. @notanyron in this situation an array for all properties would be better ;) |
When deserilizing the LngLatAlt object i.e. the coordinates array under geometry, |
I believe the LngLatAltSerializer needs to be fixed as well. If you look at the geoJson specifications position data should be given as an array of doubles not strings. Theres also the problem that the Double to String conversion in LngLatAltSerializer is performed on lng and lat but not alt. So a 3d point ends up with two strings and a double. I came accorss this problem when I was trying to use geojson generated by this api with MongoDB. MongoDB is designed to work wth the geoJson spec and so cannot create indexes for the generated geoJson as it expects arrays of Doubles not Strings when dealing with locations. This problem could be corrected by removing the fastDoubleToString method from the LngLatAltSerializer. |
Did you fix this? |
The fix has been merged, LngLatAlt positions serialize to an array of doubles now |
After saving a Point into MongoDB I realized it converts double to String
As I know... GeoJSON specify numbers inside the array coordinates. Am I wrong?
The text was updated successfully, but these errors were encountered: