-
Notifications
You must be signed in to change notification settings - Fork 26
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
GDAL geometries can not be saved to JLD2 files #445
Comments
Yeah, while I understand the need, this can't work. A pointer is just that, it points to a bit of temporary memory (on your machine). Keeping track of that memory is hard enough while in Julia (as you saw in the other issue), and straight up impossible for JLD2, because if you close Julia, you close the GDAL library and poof, that memory/geometry is gone (which is why JLD2 plays it safe and doesn't save the pointers). And you can't be smart about this, copying the memory, because it's a foreign (GDAL) structure. The pointer only points to a beginning, and only GDAL understands it from there on. What would work is creating native geometries in Julia (like WKB, as ArchGDAL can read/write those), and saving those to JLD2. |
JLD2's serialization methods can be overridden. I was not sure how to save geometries efficiently but your WKB tip pointed me in the right direction :D Now we just need a method to set the CRS of a geometry. Probably needs to be wrapped from GDAL. |
Reopening due to #448 (comment) |
When trying to save GDAL geometries to .jld2 files they are saved as
NULL Geometry
. @asinghvi17 thinks this has to do with the c-pointers to memory that is not handled correctly by JLD2.Being able to save GDAL geometries to .jld2 files would be super useful for users like me who work with DimensionalData arrays and GDAL geometries in the same table.
The text was updated successfully, but these errors were encountered: