Skip to content
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 JLD2 extension to allow serializing geometries #448

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

asinghvi17
Copy link
Contributor

@asinghvi17 asinghvi17 commented Nov 13, 2024

Currently, this just overrides the JLD2 API to serialize and deserialize to/from WKB.

In future the framework is there to ship a CRS along, but we need the supporting API in ArchGDAL to set the spatial reference of a geometry, which has to be wrapped from GDAL still. Would also have to serialize a spatial reference, probably as WKT.

MWE is in the tests. It could potentially use more tests though...

Fixes #445

Copy link
Owner

@yeesian yeesian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failures are unrelated and I'm okay to add more tests as needed after merging this

@yeesian yeesian merged commit c7aa0d6 into yeesian:master Nov 14, 2024
1 of 11 checks passed
@yeesian
Copy link
Owner

yeesian commented Nov 14, 2024

It looks like we're getting the following failure in the tests (for julia 1.6):

JLD2 serialization: Error During Test at /home/runner/work/ArchGDAL.jl/ArchGDAL.jl/test/test_geometry.jl:1043
  Test threw exception
  Expression: AG.toWKT(geom2) == AG.toWKT(geom)
  GDALError (CE_Failure, code 10):
  	Pointer 'hGeom' is NULL in 'OGR_G_ExportToWkt'.

@evetion
Copy link
Collaborator

evetion commented Nov 14, 2024

It looks like we're getting the following failure in the tests (for julia 1.6):

JLD2 serialization: Error During Test at /home/runner/work/ArchGDAL.jl/ArchGDAL.jl/test/test_geometry.jl:1043
  Test threw exception
  Expression: AG.toWKT(geom2) == AG.toWKT(geom)
  GDALError (CE_Failure, code 10):
  	Pointer 'hGeom' is NULL in 'OGR_G_ExportToWkt'.

FWIW, Do we still want to support 1.6? LTS is 1.10 now, and the merged package extension will require 1.9?

@asinghvi17
Copy link
Contributor Author

The extension probably doesn't trigger on 1.6, so I'm not surprised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GDAL geometries can not be saved to JLD2 files
3 participants