Replies: 1 comment
-
I solved the problem by changing the package where I get the Geometry objects from net.postgis.jdbc.geometry.* to org.locationtech.jts.geom.* and small adustments in the code: private static Geometry createPGGeometry(double[][] coordinates) {
GeometryFactory factory = new GeometryFactory();
Point[] points = new Point[coordinates.length];
for (int i = 0; i < coordinates.length; i++) {
if (coordinates[i].length != 2) {
throw new IllegalArgumentException("Invalid coordinate format: " + coordinates[i]);
}
points[i] = factory.createPoint(new Coordinate(coordinates[i][1], coordinates[i][0]));
}
return factory.createMultiPoint(points);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys!
I am trying to run a simple example with Postgis but I am getting the error:
Caused by: java.lang.NoSuchMethodError: 'void org.hibernate.dialect.PostgreSQL81Dialect.registerColumnType(int, java.lang.String)'
I know that the Dev Service rise a PostgreSQL 14.8.
My pom.xml have these dependencies:
And in my application.properties, I have the property:
quarkus.hibernate-orm.dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect
How can I solve this problem?
While I can't solve it natively (quarkus dev services + Postgis), I'm trying the following solution:
Download the Postgis docker image (https://hub.docker.com/r/postgis/postgis) and create a database (test) and configured as below:
My class is something like the code below:
I am trying to send this payload:
Then I created a RouteDTO like:
and my RouteResource is:
When I try to call the POST I got the error:
Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian flag value encountered.
The image docker installed PostgreSQL 15.3 and Postgis 3.3.4
Does anyone have an idea how to resolve this?
Beta Was this translation helpful? Give feedback.
All reactions