Hibernate Spatial is a generic extension to Hibernate for handling geographic data. Hibernate Spatial is open source and licensed, like Hibernate, under the LGPL license. Hibernate Spatial allows you to deal with geographic data in a standardized way. It abstracts away from the specific way your database supports geographic data, and provides a standardized, cross-database interface to geographic data storage and query functions.
Questions tagged [hibernate-spatial]
161 questions
1
vote
1 answer
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 BUFFERED_GEOMETRY”)
.setParameter(“geometry”,…

יהונתן בן דוד
- 11
- 1
1
vote
1 answer
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, i've read hibernate documentation, but i'm…

Alain Duguine
- 425
- 7
- 21
1
vote
1 answer
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-end dates overlap the start-end dates of the query…

icyerasor
- 4,973
- 1
- 43
- 52
1
vote
1 answer
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 create the expected Point object from my…

Gabriel Tamujo
- 21
- 5
1
vote
1 answer
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 persistence tests, everything goes well until I…

TaneRr
- 21
- 7
1
vote
0 answers
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,4326)")
val position: Point
) {
}
When…

boybeak
- 417
- 5
- 19
1
vote
1 answer
HQL gives "unnexpected AST node (" within case clause
This is a simplified query which will reproduce the error:
SELECT
CASE
WHEN contains(buffer(r.polygon, 0.009), h.latlng) THEN 1
ELSE 0
END as near
FROM Region r, House h
WHERE r.id = 732 AND h.id = 892877180
Executing…

Rodrigo Oliveira
- 1,452
- 4
- 19
- 36
1
vote
1 answer
Querydsl and MySQL - distancesphere does not exist
I'm using QueryDSL v4.1.4 with Spring Boot and Hibernate 5.
My goal is to perform a query based on ST_DISTANCE_SPHERE Function, to query results based on distance from a starting point.
I have the following query:
where
.and(
…

Deividi Cavarzan
- 10,034
- 13
- 66
- 80
1
vote
1 answer
Hibernate Search : The field () used for the spatial query is not configured as spatial field
I have the classes Organization and Coordinates.
Coordinates is as follow :
@Entity
@Table(name = "COORDINATES")
@Indexed
@Spatial
public class Coordinates implements Serializable {
private static final long serialVersionUID = 1L;
public…

Marie
- 51
- 5
1
vote
2 answers
failing to persist geometry object to oracle using hibernate spatial
I'm using Spring with Hibernate Spatial 5.0.12 and trying to persist a com.vividsolutions.jts.geom.Geometry object to an Oracle database with SDO_GEOMETRY column but get this exception when trying to save it to the db:
ORA-00932: Inconsistent…

yitach edelstein
- 51
- 4
1
vote
2 answers
hibernate-spatial on oracle12c - sdo_geometry objects become empty on em.merge
there is a table containing a column of type SDO_GEOMETRY representing some points. Later a spatial query like 'show all other points within distance x' shall be executed.
After pumping some data via sqlloader into a import-table I am going to bring…

Kaspatoo
- 1,223
- 2
- 11
- 28
1
vote
0 answers
hibernate 5 - insert postgis data into table
I work with hibernate-spatial 5.2.10 and postgis, and I'm trying to persist Point datatype to DB table which consist of two columns:
name = uid, type = bigint (primary key, not null)
name = center, type = point
Here is my code:
import…

Shimrit
- 55
- 7
1
vote
1 answer
SpatialIntegrator could not be instantiated
I'm trying to use Postgis 2.2 and Postgresql 9.5 with JPA, Postgis 9.5 dialect. I've got the requirements in the pom.xml as per here http://www.hibernatespatial.org/documentation/documentation/ and the types are imported correctly however when I try…

sonnyJim
- 105
- 1
- 7
1
vote
1 answer
hibernate spatial mysql 5.7
Im trying to use hibernate spatial. I have done following configurations....
hibernate.version 5.2.2.Final
MySQL 5.7
org.hibernate
hibernate-spatial
…

drakshayani
- 41
- 4
1
vote
2 answers
Why I have this error trying to use Hibernate Spatial into a Spring Boot project? InstantiationException
I am trying to configure Hibernate Spatial into a Spring Boot project on which I am working and I am finding some problem.
I am using MariaDB (so it is MySql) nd Hibernate was previously corrected configured (I used it for all not GIS functionality…

AndreaNobili
- 40,955
- 107
- 324
- 596