-
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
Provide an API to create a Geometry object from an owned OGRGeometryH #306
Comments
@thomas001 Is In the future, I wonder if we would we regret letting an internal hack leak out (to never be put back in the box), and wish we'd just go ahead and implement the desired functionality? Not sure what the scope is of what you need, but feel like it's worth asking the question. |
@metasim Okay here is my brain dump on this topic, sorry if it is a bit unstructured. There are a few functions that I missed, Yes, implementing the missing functions would be one way to go forward here (for a simple case like The more general question is: if you agree that not all functionality of GDAL is wrapped in this crate, should we offer users at least a supported way to go back and forth with Finally, I think there are some hackish functions already out there. There is at least So maybe two possible directions:
|
356: Implements `Geometry::make_valid`. r=metasim a=metasim - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Partially addresses #306. cc: `@thomas001` Co-authored-by: Simeon H.K. Fitch <[email protected]>
I think we should wrap more of the GDAL methods, but also offer a good interop story. Unfortunately, I'm not convinced that the current API is a good one, cf. #365. |
366: Exposed spatial predicates over `Geometry` r=metasim a=metasim - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [X] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Partially addresses #306 cc: `@thomas001` Co-authored-by: Simeon H.K. Fitch <[email protected]>
366: Exposed spatial predicates over `Geometry` r=metasim a=metasim - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [X] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Partially addresses #306 cc: `@thomas001` Co-authored-by: Simeon H.K. Fitch <[email protected]>
See also: #360 |
Currently not all of the C Geometry API is wrapped, so users will need to go to
gdal-sys
and raw unsafe C calls from time to time. This is fine, wrapping all of GDAL is a huge undertaking. So right now I have code like this:As you can see creating a
Geometry
back from the raw C pointer is cumbersome and it leaks memory sincev
doesn't own the C geometry. I am asking for a function likeGeometry::from_owned_c_geometry
which will own the passed C object. So the above code could becomePlease consider implementing it in public API. There seems to be a crate local function that almost does this, so maybe just change it to public .
The text was updated successfully, but these errors were encountered: