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

[c++] WKB geometry utilities #3149

Merged
merged 10 commits into from
Oct 14, 2024
Merged

[c++] WKB geometry utilities #3149

merged 10 commits into from
Oct 14, 2024

Conversation

XanthosXanthopoulos
Copy link
Collaborator

@XanthosXanthopoulos XanthosXanthopoulos commented Oct 8, 2024

This PR adds a basic implementation for reading and writing geometry object from and to WKB buffers.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.30%. Comparing base (6b65790) to head (fc0f459).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3149      +/-   ##
==========================================
+ Coverage   83.05%   83.30%   +0.25%     
==========================================
  Files          50       51       +1     
  Lines        5198     5458     +260     
==========================================
+ Hits         4317     4547     +230     
- Misses        881      911      +30     
Flag Coverage Δ
python 83.30% <ø> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 83.30% <ø> (+0.25%) ⬆️
libtiledbsoma ∅ <ø> (∅)

@XanthosXanthopoulos XanthosXanthopoulos changed the title WKB geometry utilities (WIP) [c++] WKB geometry utilities Oct 9, 2024
@XanthosXanthopoulos XanthosXanthopoulos marked this pull request as ready for review October 9, 2024 14:57
Copy link
Collaborator

@jp-dark jp-dark left a comment

Choose a reason for hiding this comment

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

This PR is large, but very clean. I added a couple of inline comments to the review. In addition:

  • For the tests, we should (1) make it easy to add in additional tests for each type, (2) add in additional tests for different edge cases for the geometries and (3) add tests for reading and erroring out on improperly formatted and/or unsupported WKB types. None of this needs to be added to this PR, but we should at least add stories to address this in the future.

  • Optional: I think we should move libtiledbsoma/src/utils/geometry to just libtiledbsoma/src/geometry.

libtiledbsoma/src/CMakeLists.txt Outdated Show resolved Hide resolved

namespace tiledbsoma::geometry {

enum class GeometryType {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this matches the integer codes in the WKB spec.

  1. What do you think about making this a uint32_t enum to match the spec?
  2. Should we specify 2D on these types in case we want to add in 3D/4D versions as well?

libtiledbsoma/test/unit_geometry_roundtrip.cc Show resolved Hide resolved
libtiledbsoma/test/CMakeLists.txt Show resolved Hide resolved
libtiledbsoma/src/utils/geometry/operators/io/write.cc Outdated Show resolved Hide resolved
libtiledbsoma/src/utils/geometry/utils.h Outdated Show resolved Hide resolved
libtiledbsoma/src/utils/geometry/operators/io/read.h Outdated Show resolved Hide resolved
libtiledbsoma/src/utils/geometry/operators/io/write.h Outdated Show resolved Hide resolved
libtiledbsoma/src/utils/geometry/utils.h Outdated Show resolved Hide resolved
@XanthosXanthopoulos XanthosXanthopoulos merged commit 7381508 into main Oct 14, 2024
15 checks passed
@XanthosXanthopoulos XanthosXanthopoulos deleted the xan/geometry_utils branch October 14, 2024 14:22
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.

3 participants