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

fix(capi): Compatibility with GEOS 3.12 #361

Merged
merged 1 commit into from
Aug 24, 2023
Merged

fix(capi): Compatibility with GEOS 3.12 #361

merged 1 commit into from
Aug 24, 2023

Conversation

BuonOmo
Copy link
Member

@BuonOmo BuonOmo commented Aug 23, 2023

The 3.12 include changes in the API responses.
Mainly, WBX Writers now default to three
dimensions instead of two. We follow the
changes, making no breaking change in the
API, but some changes in the responses
given by #ccw? and #simplify_preserve_topology.

See changes in libgeos:

Fixes #360

@BuonOmo BuonOmo force-pushed the fix/capi-no-z branch 2 times, most recently from f6b682d to 3537e29 Compare August 23, 2023 17:36
@BuonOmo BuonOmo marked this pull request as ready for review August 23, 2023 17:38
Copy link
Member

@keithdoggett keithdoggett left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the quick fixes on this @BuonOmo. It's nice that we're able to keep all the versioning logic in the tests for this.

Related to this I should have some time to keep looking at the Geos gh test matrix soon as well.

@@ -90,7 +90,12 @@ def test_simplify_preserve_topology
simplified = poly.simplify_preserve_topology(1)
interior_points = simplified.interior_rings[0].points

assert_equal 5, interior_points.length
# https://github.com/libgeos/geos/pull/784
if Gem::Version.new(RGeo::Geos.version) >= Gem::Version.new("3.12.0")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we add this check as a method in test_helper.rb in case we need to do this check in the future.

def geos_version_gteq(version)
  Gem::Version.new(RGeo::Geos.version) >= Gem::Version.new(version)
end

The 3.12 include changes in the API responses.
Mainly, WBX Writers now default to three
dimensions instead of two. We follow the
changes, making no breaking change in the
API, but some changes in the responses
given by `#ccw?` and `#simplify_preserve_topology`.

See changes in libgeos:

- libgeos/geos#784
- libgeos/geos#878
- libgeos/geos#908
- libgeos/geos#915

Fixes #360
@BuonOmo
Copy link
Member Author

BuonOmo commented Aug 24, 2023

I've applied the change, may I leave you the duty of merging if it suits you ?

@keithdoggett keithdoggett merged commit 8f61123 into main Aug 24, 2023
15 checks passed
@keithdoggett keithdoggett deleted the fix/capi-no-z branch August 24, 2023 20:36
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.

With geos 3.12, the CAPI factory enables Z geometries
2 participants