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
30
votes
7 answers
Hibernate Spatial 5 - GeometryType
After upgrading Hibernate-spatial to Version 5.0.0.CR2 the following declaration doesn't work anymore:
@Column(columnDefinition = "geometry(Point,4326)")
@Type(type = "org.hibernate.spatial.GeometryType")
private Point position;
with…

Denis Lukenich
- 3,084
- 1
- 20
- 38
15
votes
1 answer
Hibernate Spatial - Query within an X kilometer radius?
I am new to Hibernate Spatial, and am trying to perform a simple query of objects within a given radius. I've created a number of entries in my database with properties corresponding to a latitude and longitude, using data from Google Maps and…

Shadowman
- 11,150
- 19
- 100
- 198
9
votes
3 answers
Using JPA Criteria Api and hibernate spatial 4 together
Given the query example here: http://www.hibernatespatial.org/tutorial-hs4.html
Query query = em.createQuery("select e from Event e where within(e.location, :filter) = true", Event.class);
query.setParameter("filter", filter);
Is it possible to…

osh
- 1,191
- 4
- 13
- 21
8
votes
3 answers
Spring boot app fails Method org.postgresql.jdbc4.Jdbc4Connection.createClob() is not yet implemented
I am using spring boot command line runner app, it hangs at PostGIS dialect, the below stack trace contains what's happening. Unable to understand what's going wrong, I have hibernate-spatial queries.
2018-04-06 12:11:08.554 INFO 31495 --- [ …

Pavanraotk
- 1,097
- 4
- 15
- 33
8
votes
2 answers
Hibernate spatial functions keep throwing unexpected AST node
I'm trying to query spatial relations between my entities but keep getting this exception:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: ( near line 1,
My entities are working properly, so is the mapping. I believe that…

Moa
- 441
- 4
- 13
8
votes
2 answers
Hibernate Spatial - 'Invalid endian flag value encountered' Exception
I'm trying to run a simple query in Hibernate Spatial 4.0 on PostgreSQL 9.3. I have a number of objects in a table with latitude/longitude values, and I'm trying to query objects that fall within a given radius of a particular latitude/longitude. …

Shadowman
- 11,150
- 19
- 100
- 198
7
votes
2 answers
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 as a type. Consider the following example
public…

Carsten Hoffmann
- 901
- 5
- 14
7
votes
1 answer
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 * FROM opt_event WHERE…

dasLicht
- 141
- 7
7
votes
2 answers
How to configure spring-boot project to work with inmemory spatial database for tests?
Here is my config now. I want to use hibernate spatial to work with postgis in production.
spring:
profiles: production
datasource:
platform: postgres
url: jdbc:postgresql://192.168.99.100:5432/dragon
username: dragon
password:…

user1685095
- 5,787
- 9
- 51
- 100
7
votes
1 answer
PostgisDialect vs PostgreSQLDialect or both?
My application is going to use the following technologies:
Postgresql
Postgis
JPA/Hibernate
Spring
Spring Data JPA
I understand (from the Hibernate Spatial documentation) that one has to use the following dialect:…

balteo
- 23,602
- 63
- 219
- 412
7
votes
2 answers
hibernate-spatial: sql query to retrieve a geometry
I'm using postgresql, hibernate-spatial and postgis and expected to be able to use a SqlQuery to retrieve a Geometry object.
However whenever I try to query a Point, Polygon or Geometry eg
List list = session.createSQLQuery(
"select…

pstanton
- 35,033
- 24
- 126
- 168
6
votes
1 answer
Hibernate Spatial Create Geometry object
I am developing an location app with oracle spatial in Java. I am using hibernate 4.0 spatial for orm layer. I am new in spatial and i couldn't find best practise for hibernate spatial. My database model following;
CREATE TABLE SYSTEM.POI (
…

mertaksu
- 535
- 1
- 9
- 26
6
votes
5 answers
Why I can't map a Point field of my entity class on a Point field on the database? column "location" is of type point but expression is of type bytea
I am working on my first Spring Boot + Spring Data JPA + Hibernate 5 working on a PostgreSQL database.
I have the following problem trying to map a field having point as data type (so I am using Hibernate Spatial that is natively included into…

AndreaNobili
- 40,955
- 107
- 324
- 596
5
votes
2 answers
Hibernate Spatial PostGis PSQLException column is of type point but expression is of type bytea
In a Spring Boot project, Java8, with hibernate-spatial and PostgresDB 9.4
org.hibernate
hibernate-spatial
5.2.10.Final
…

Paolo Biavati
- 609
- 10
- 19
5
votes
1 answer
JTS - Hibernate + Postgres + UUID conflict
I'm using Hibernate 5.0 + Postgres 9.4
My entities use UUIDs as indentifier.
The project also uses hibernate-spatial.
The id property is annotated simply as
@Id
@GeneratedValue
private UUID id;
After persisting any entity (not only the ones with…

Stefano Cazzola
- 1,597
- 1
- 20
- 36