-
-
Notifications
You must be signed in to change notification settings - Fork 55
StructArrays interface for points #29
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
Comments
Why? Can you give a concrete example? |
Transformations with the Proj library come to mind - it accepts separate arrays of x, y, and z, and the most efficient mode of operation is to operate in place. Having 3 arrays of x, y, and z which could be transformed in place would be pretty useful, especially when you get into >500K points. |
I thought this was trivially supported, but can't find the correct constructor right now :D Evidence, that this should be made easier & documented... |
After talking with @piever it may be a bug: |
Well I tried it a while ago...the issue is that we store the data in a tuple, so StructArrays just makes an array of tuples, which is useless for this. We need to define our own static schema which takes, for example, a Point3f0, and maps it to x, y, and z (or x1, x2 and x3, but that's uglier)... |
Yeah, but this is supposed to "just work"... So lets see if we can have this fixed ;) |
I've commented over at JuliaArrays/StructArrays.jl#126 (comment). It can be made to work already if one calls the constructor in a slightly different way, and one gets a StructArray(data::StructArray(::Array{Float32,1}, ::Array{Float32,1}, ::Array{Float32,1})) |
Alright, that's fair! I think GeometryBasics should just support a convenience constructor for this :) |
When calling into C functions with large arrays of points, it would be useful to have mutable StructArrays of points. As far as I understand it, this would just involve defining a static schema for Points.
Would this be a wanted feature? Also, how would we handle vectors of n-dimensional Points?
The text was updated successfully, but these errors were encountered: