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

Issues with PostGIS backend (JTS + hibernate spatial) #166

Closed
etj opened this issue Feb 4, 2021 · 5 comments
Closed

Issues with PostGIS backend (JTS + hibernate spatial) #166

etj opened this issue Feb 4, 2021 · 5 comments
Assignees

Comments

@etj
Copy link
Member

etj commented Feb 4, 2021

As reported in https://github.com/geosolutions-it/support/issues/1101, there's a problem when using PostGIS as backend DBMS.
Need to implement specific profile-based tests.

@etj etj self-assigned this Feb 4, 2021
@etj
Copy link
Member Author

etj commented Feb 8, 2021

There has been an API change in JTS, and this breaks hibernate-spatial compatibility:

https://github.com/locationtech/jts/blob/master/doc/JTS_Version_History.md#api-changes-1

Version 1.17.0

Release Date: July 1, 2020

Java Version: 1.8

API Changes

  • Change Polygon getExteriorRing and getInteriorRingN accessors to return LinearRing.
    • This is a binary incompatible change to the method signature. Recompilation is necessary. No source code changes are required.

@etj
Copy link
Member Author

etj commented Feb 8, 2021

Hibernate spatial fixed in geosolutions-it/hibernate-spatial#1, new version compatible with JTS 1.17.0 is 1.1.3.2.

etj added a commit that referenced this issue Feb 8, 2021
Bump Hibernate Spatial to 1.1.3.2.
Add specific tests for Postgis
@etj
Copy link
Member Author

etj commented Feb 8, 2021

Problem should now be fixed using GeoFence 3.4.8, which anyway breaks compatibility with older JTS version because of the changes in JTS itself.

GeoFence <=3.4.7 --> hibernate-spatial 1.1.3.1 ..> JTS <1.17.0
GeoFence >=3.4.8 --> hibernate-spatial 1.1.3.2 ..> JTS >=1.17.0

etj added a commit that referenced this issue Feb 9, 2021
@etj
Copy link
Member Author

etj commented Feb 11, 2021

Here a compatibility matrix for GS and GF versions.
Strikethrough versions will behave badly.

Pls remember that PG issues come out only when running in embedded mode.

GeoServer JTS Declared GF GF needed for PG GF needed for H2
2.19 master 1.18.0 3.4.7(*) 3.4.8 3.4.7 or 3.4.8
2.18.x 1.17.1 3.4.6.1 3.4.6.1 3.4.6 or 3.4.6.1
2.18.2 1.17.1 3.4.6 3.4.6.1 3.4.6 or 3.4.6.1
2.18.1 1.17.1 3.4.6 3.4.6.1 3.4.6 or 3.4.6.1
2.18.0 1.17.1 3.4.6 3.4.6.1 3.4.6 or 3.4.6.1
2.17.5 (last) 1.17.0 3.4.6.1 3.4.6.1 3.4.6 or 3.4.6.1
2.17.4 1.17.0 3.4.6 3.4.6.1 3.4.6 or 3.4.6.1
2.17.3 1.17.0 3.4.6 3.4.6.1 3.4.6 or 3.4.6.1
2.17.2 1.16.1 3.4.6 3.4.6 3.4.6
2.17.1 1.16.1 3.4.6 3.4.6 3.4.6
2.17.0 1.16.1 3.4.6 3.4.6 3.4.6

To fix the issue in a deployed environment it should be enough to replace in WEB-INF/libs the file hibernate-spatial-postgis-1.1.3.1.jar with hibernate-spatial-postgis-1.1.3.2.jar.

(*) Note that 3.4.7 includes some DTO change that breaks compatibility, so it's going to be re-released as 3.5.something.

@etj etj changed the title Issues with PostGIS backend Issues with PostGIS backend (JTS + hibernate spatial) Feb 9, 2023
@etj
Copy link
Member Author

etj commented Feb 9, 2023

Fixed and referenced in the wiki

@etj etj closed this as completed Feb 9, 2023
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

No branches or pull requests

1 participant