-
Notifications
You must be signed in to change notification settings - Fork 17
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 a coordtype
method
#128
Comments
Formats would not allow mixed coordinate types but it would be super useful to have e.g. Unitful support. |
This could also be extremely useful for fixing empty collection problems |
Can you give an example? |
Say we know some operation ends in an empty vector of points, what type is the vector? If we have coordtype we can at least find that it's Currently handling the empty case is expensive because it can introduce type instability because we don't know T. But for example, if a GeoJSON geom is empty, we always know T is Float64 anyway because It would actually be most useful to get T from the geometry type, I'm just not sure we can always do that. Is there any package where its not possible? |
I'm not sure if this is possible (do any formats allow mixed coordinate types like Float32 and Float64 in the same dataset on even the same polygon??)
But it would be good to be able to get the coord type at any level, e.g. on a feature or polygon as well as a point. Then we can pass it into loops to fix type stability, and use it to e.g. preallocate vectors.
@asinghvi17 @skygering were discussing this on slack recently. Currently in GeometryOps,jl we just default to Float64 and allow user override. But it could be nice to detect the coord type and use that.
The text was updated successfully, but these errors were encountered: