168 questions
0
votes
0
answers
62
views
Hibernate spatial custom type is overriden by the default Hibernate spatial type
I have a custom Oracle Hibernate Dialect with a custom Oracle spatial type.
This type is supposed to replace the standard SDOGeometryType.
The purpose of this custom type is to handle complex arcs in ...
0
votes
1
answer
195
views
SpringBoot not returning locationtech Geometry
Trying to return an object containing a Geometry through a REST interface using Spring. While the other fields are returned correctly, the geometry field comes out looking like:
"location":{&...
0
votes
1
answer
124
views
OpenLiberty + Hibernate spatial + Postgis issue
I'm trying to write a geometry to a Postgres database with Postgis extension enabled together with OpenLiberty 24.0.0.11 and Hibernate-spatial 6.6.3.Final, but get the following error:
jakarta....
1
vote
1
answer
475
views
Jpa with hibernate spatial and postgis not working
application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/test_postgis
spring.datasource.username=postgres
spring.datasource.password=1234
spring.datasource.driver-class-name=org....
0
votes
1
answer
385
views
PostGIS migration to Hibernate 6
I'm trying to migrate to Spring Boot 3 (and hibernate-spatial:6.4.1.Final)
So before migration i have following lines in my @Entity describing a column in the table storing a MultiLineString geometry:
...
0
votes
1
answer
476
views
Hibernate 6.3 creates bytea column type instead of geometry
I basically encounter the same problem described in this post: hibernate-spatial-4.0 creates bytea column type instead of geometry
According to the hibernate docs the type mapping of a jts Geometry ...
0
votes
1
answer
89
views
Can I use `ST_Buffer` with hibernate and MySql?
I have a question about hibernate-spatial.
(I'm using hibernate version 6.1.7.Final)
The official hibernate documentation says that MySql's St_Buffer is not supported,
@Query("""
...
0
votes
1
answer
722
views
Spring Boot with the usage of Hibernate Spatial in MySQL Database Issue - Cannot set the value to Point
I have a problem to set latitude and longitude to Point with the usager of Hibanate Spatial feature in Spring Boot.
I cannot set it as I guess there is a problem in columnDefinition.
How can I fix it?
...
-1
votes
1
answer
642
views
Data truncation: Cannot get geometry object from data you send to the GEOMETRY field
hi i'm trying to insert and read geo data(POINT) to mySQL DB.
I am using JPA.
I got latitude and longitude from the frontend and I made a String like POINT(10 20) as wkt.
then by using WKTReader, I ...
3
votes
2
answers
1k
views
PostGIS Functions in hibernate spatial 6 migration
First Issue:
I have an existing code written for hibernate spatial 5 to find records within given radius, which works fine. I am in the process of migrating the code hibernate-spatial 6.1.7.Final. But ...
0
votes
1
answer
5k
views
SpringBoot 3, hibernate-spatial 6, PostGIS:: java.lang.ClassNotFoundException: org.hibernate.dialect.PgJdbcHelper
I am trying to migrate my current spring boot 2 application to 3. I am using PostGIS (I have not set explicit dialect so it uses org.hibernate.dialect.PostgreSQLDialect) to use the geometry column ...
2
votes
0
answers
462
views
Micronaut with Hibernate Spatial types deserialization
The essence of the question is to serialize and deserialize the Geometry class from Hibernate Spatial in the Micronaut framework. This is how the field is represented in my entity.
import org....
0
votes
1
answer
129
views
SQL Sequence mapping - SqlServer2012SpatialDialect, Grails 4, Hibernate 5 compatibility
So far in the configuration file (application.yml) hibernate-dialect has been set as follows:
dataSource:
pooled: true
jmxExport: true
driverClassName: com.microsoft.sqlserver.jdbc....
0
votes
1
answer
223
views
PostGis invalid geometry when using ST_GeomFromText
i am using postgis with spring boot hibernate jpa.
Code in Repository:
@Query(value = "select {h-schema}ref_plz_geom.plz from {h-schema}ref_plz_geom WHERE ST_Contains(geom, ST_Transform(...
2
votes
1
answer
237
views
Incorrect result using Geometry.reverse() for XYM coordinates
We are using jts-core (org.locationtech.jts:jts-core:jar:1.19.0) together with hibernate-spatial (org.hibernate:hibernate-spatial:jar:5.6.10.Final:compile) to retrieve geometries with measured ...
0
votes
1
answer
473
views
Micronaut projection DTO type conversion
given the entity model below:
@Entity(name = "Accounts")
open class AccountEntity(
@field:Id
@field:GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "...
2
votes
1
answer
2k
views
Is PostgisPG10Dialect superseded by PostgreSQLDialect now?
I am using hibernate-spatial in version 6.1 with PostgreSQL 12.12.
According to older guides or this question, org.hibernate.spatial.dialect.postgis.PostgisDialect is
the right dialect to use. However,...
0
votes
2
answers
1k
views
Error: Invalid endian flag value encountered with Hibernate 6 and Spring Boot 3
I am having some problems with Hibernate Spatial 6 with PostGIS and Spring Boot 3.0. This project I have taken and upgraded to SB 3.0 SNAPSHOT: https://github.com/murphye/spring-boot-postgis/tree/3.0
...
1
vote
0
answers
554
views
java.lang.IllegalArgumentException: Can't convert object of type org.postgresql.util.PGobject randomly
I am facing this problem randomly: I have a table with latitude,longitude and location type columns where location column is having geometry type and the data is entered correctly and also I am able ...
0
votes
2
answers
3k
views
How to send PostGiS Geometry and Point data types through Spring Boot Rest API
I have an query that returns an interface OverlayDTO that I get from a native query. center is PostGIS point and geometry as you might have guessed it is geometry
@Query("SELECT " +
&...
4
votes
1
answer
816
views
Wrong column type after upgrading from Hibernate Spatial 5.4.3 to 5.6.9
We're trying to upgrade Hibernate and Hibernate Spatial from version 5.4 to 5.6 (we're using MySQL 5.6) but when starting our Spring Boot application (running spring boot 2.7.0) we run into the ...
3
votes
1
answer
8k
views
How to make spring boot, spatial hibernate and postgis work?
I can't start my spring boot(2.6.3) project with hibernate-spatial in create mode.
It tells me that type "geometry does not exist".
The geometry type comes from the hibernate-spatial library....
3
votes
0
answers
398
views
How to create GIST spatial index on postgis with JPA annotations
I am using springboot, hibernate-spatial with postgis database to store and query spatial objects. I wonder if there is a way to create GIST spatial index on postgis with JPA annotations. I have only ...
9
votes
2
answers
10k
views
Unable to store UUIDs in H2 2.0.202 with Hibernate
We have been using H2 for our integration tests for quite some time. Now that H2 2.0.202 is out, we are trying to upgrade our codebase to it. We are unable to persist entities, that use java.util.UUID ...
7
votes
3
answers
4k
views
How to insert into geo point column in spring data-jpa + mysql 8?
My Environment
mysql 8.0.25
hibernate-core:5.4.32
hibernate-spatial:5.4.32
spring-boot2.5.4
java 8
What I did
application.yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
...
0
votes
1
answer
553
views
How to build JPA Predicate for checking point belongs to given polygon
I'm trying to build javax.persistence.criteria.Predicate which determines is point belongs to a given polygon.
That predicate I want to use to build the query. I want to use Criteria API to ...
0
votes
2
answers
415
views
Jhipster-generated Spring Boot + MySql project config for spatial queries
My goal is to add the capability for geospatial queries to my jhipster-generated Spring Boot + MySql project, but I have failed to properly configure my H2 database for queries performed by my tests ...
0
votes
1
answer
1k
views
Construct LineString using org.geolatte.geom
How do I convert the following MySQL expression to a corresponding org.geolatte.geom.LineString, using the org.hibernate:hibernate-spatial library.
LineString(Point(-1, start_timestamp), Point(1, ...
2
votes
1
answer
586
views
Long and Lat values not passing to .createPoint(new Coordinate(long, lat));
I am using Hibernate Spatial, Postgres/Postgis, Spring Boot Gradle.
I am currently trying to populate point data to my Postgres/Postgis database. I am able to create a point -- however, when I pass my ...
1
vote
1
answer
3k
views
Hibernate Spatial: Cannot construct instance of `org.locationtech.jts.geom.Geometry`
I'm developing a routes app, to create, search or make routes in a city. This app has two different parts: a rest Service in Java, with a postgresql database and postgis, and a client app. The route ...
1
vote
1
answer
569
views
Use Geography PostGIS function with H2GIS
I have this function where I get a hibernate spatial Geometry type and buffer it in meters like so
entityManager
.createNativeQuery(“SELECT ST_BUFFER(GEOGRAPHY(:geometry), :margin, ‘join=mitre’) AS ...
0
votes
1
answer
1k
views
Hibernate Spatial with MySQL and Spring Boot
I am developing an app that will store location data from map to the MySQL database.I came across MySQL spatial data types which can be useful to perform some operations on the location data.
I wanted ...
0
votes
1
answer
612
views
No Dialect mapping for JDBC type: 1111 when selecting "org.locationtech.jts.geom.Point" in native query
I want to implement a projection for messages with a calculated distance using native query
@Entity
@Table(name= "messages")
data class Message(
@Id
@GeneratedValue
var id: Int?=null,
...
0
votes
2
answers
1k
views
JTS geometry in Hibernate spatial generating " ERROR: function within(geometry, bytea) does not exist"
Hibernate-spatial 5.4.22, hibernate.dialect = org.hibernate.spatial.dialect.postgis.PostgisDialect
A very straightforward query:
import org.locationtech.jts.geom.Geometry;
...
@Query(value = "...
0
votes
1
answer
674
views
Storing coordinates retreived by Google Maps GeocodingApi in an Oracle Database and calculate distances between them with SDO_GEOM.SDO_DISTANCE
I wrote a Spring-Application where I use the com.google.maps.GeocodingApi.GeocodingApi to retreive coordinates for addresses. After that I use the method com.vividsolutions.jts.geom.GeometryFactory....
1
vote
1
answer
4k
views
Unable to make geospatial query (within) with spring-boot, spring-data-jpa and hibernate spatial on postgresql db
I have a spring boot 2.3/spring data jpa project in which a user should be able to retrieve restaurants near him. Restaurants have coordinates, latitude and longitude. I've followed a lot of tutorials,...
1
vote
1
answer
2k
views
Spring(Boot) with JPA / Hibernate and PostgreSQL - use Overlaps for dates
So i have a project where we use springBoot and PostgreSQL 10 with PostGis and hibernate.spatial for spatial queries. Everything works fine so far.
A new requirement is to find entities, which start-...
0
votes
1
answer
459
views
Error while creating spatial entity with Hibernate and GeometrySerializer : No qualifying bean of type 'GeometryParser<?>'
I tried to create a simple application with a geometry persistent layer (Spring boot with hibernate-spatial)
Here is my Entity class :
// Annotations from lombok project
@NoArgsConstructor
...
0
votes
0
answers
666
views
Function "ST_WITHIN" not found in Spring Boot Application using h2 In-Memory Database and Hibernate Spatial
In a Spring Boot application (h2 in-memory database + Hibernate Spatial) in a Junit test, I'm getting error "Function "ST_WITHIN" not found" for a "within" query
pom.xml:
<dependency>
<...
0
votes
1
answer
1k
views
How to use PostgisFunctions in hibernate-spatial to transform CRS geometry
Hibernate (entity-manager, spatial...) version is 5.4.14
Database dialect as follows: org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect
PostgresSQL 10, Postgis 2.4
Geometry field is being ...
1
vote
1
answer
2k
views
Attribute Conversion with Hibernate Spatial and PostGIS
In my PostgreSQL 12.2 + PostGIS 2.5.4, I have a table named Address with a column of type geography(POINT, 4326).
I'm working with Hibernate Spatial and trying to develop an Attribute Converter to ...
0
votes
1
answer
2k
views
Hibernate 5.4 PostgisDialect deprecated?
Due to Grails 3 migration to Grails 4 had to upgrade Hibernate 5.1.5 to the latest Hibernate 5.4.14 (including hibernate-entitymanager, hibernate-spatial, hibernate-ehcache, hibernate-core...).
JVM: ...
7
votes
1
answer
2k
views
Specification/Predicate for Hibernate/spatial to filter an Entity whether it is in radius or not
I would like to rewrite the following query in a Predicate/Specification so that i can link them.
this query filters all my defined OptEvent Entitys within a specific area
@Query(value = "SELECT * ...
1
vote
1
answer
784
views
org.postgresql.util.PSQLException: ERROR: Invalid endian flag value encountered
I have consulted a lot of questions and I still can't find the solution to my problem.
I am doing an application and some of the classes have attributes of the geometry or point type, but when doing ...
0
votes
2
answers
616
views
Get Query is not working when using HQL in Hibernate Spatial
I am using Spring boot along with Hibernate for a Spatial query.
Libraries used:
1. Spring boot - 2.1.3.RELEASE
2. Hibernate Spatial - 5.3.7.Final
3. MariaDB - mysql Ver 15.1 Distrib 10.1.36-MariaDB
...
1
vote
0
answers
282
views
Hibernate spatial 5 can not insert data because of Invalid endian flag value encountered
@Entity(name = "records")
data class RecordEntity(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val uid: Long = 0,
@Column(columnDefinition = "geometry(Point,...
0
votes
1
answer
409
views
How to find points within Polygon?
I recently work with hibernate spatial and I have such a question. I wanna to get all points inside polygon. How can I do that?
For example my distance query looks lite this:
final Coordinates ...
0
votes
1
answer
523
views
Why I've got org.postgresql.util.PSQLException: ERROR: Invalid endian flag value encountered?
I recently worl with hibernate-spatial 5 and I bumped with problem. When I'm trying to add my Geometry data to Postgres. I've got the next error on the commit transaction stage:
javax.persistence....
0
votes
1
answer
1k
views
System.ArgumentException: 24100: The spatial reference identifier (SRID) is not valid. SRIDs must be between 0 and 999999
I want to save a new geometry data at database, but I'm receiving this error message all the time.
A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry".
...
2
votes
1
answer
1k
views
Mapping MySQL Point Data Type with Hibernate
I have an existing MySQL database with a column in a table that has a "point" data type. The first thing I did was add the spatial dependency to our gradle build file via:
implementation '...