-
Notifications
You must be signed in to change notification settings - Fork 96
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 Geometry::set_points, change Geometry::get_points to use OGR_G_GetPoints #604
base: master
Are you sure you want to change the base?
Conversation
This is also a small bit of groundwork to make harmonizing the index types (as discussed in #600 ) a little less annoying. |
thoughts? @lnicola |
I'm not sure I follow. GDAL doesn't know (or care) if you have a
Slices are aligned, but the bigger issue is that #[repr(C)]
struct PointXyz(f32, f32, f32); ( So the simplest would probably be to pass in a Can of 🪱s indeed 😀. |
Fair enough.
Nvm, i get what you mean... hmmm |
We could start adding geometry types (shame |
I think both Maybe the simplest is to offer something like: geom.get_points(&mut Vec::<f32>::new(), CoordinateLayout::XyzXyz); // there's probably a better name
geom.get_points(&mut Vec::<f32>::new(), CoordinateLayout::XxYyZz); It doesn't offer the full power of the C API, but it's still useful. We could even fit |
This might actually be a neat way to go about it if we want to avoid adding our own geometry types. Since It would, however, still be quite annoying for the end-user to |
Yeah, I updated my comment about this exactly when you posted yours. We could even do
Only a little, right? And there's also |
It certainly beats having to cook up our own For all the |
In any case, I propose we postpone (no need to close) this for a later time. I'd like to get a new release out of the door soon (maybe after 3.10.1 comes out in the next couple of days). |
Very well, I'll be cooking with gas in the meantime. |
@lnicola reasonably happy with this as a first go at it. Not sure how I'll go about strangely ordered coordinates (if that's even necessary) but feel free to take a peek when you want to. Edit: Not my proudest git history, but I'll stop touching things for now. |
CHANGES.md
if knowledge of this change could be valuable to users.The PR has since expanded in scope, check the edit history and earlier discussion for additional context/scheming.
This PR adds
Geometry::set_points
, changesGeometry::get_points
to use OGR_G_GetPoints and creates theCoordinateLayout
to describe the layout of the in/output data for both of these methods.This also removes
Geometry::get_points_zm
since it has been made redundant by a generalized coordinate layout enum, and could make implementing conversions to/fromgeo_traits
somewhat easier.