Available Dialects

See the Dialect specific pages for usage notes.

Not all databases support all the functions defined by Hibernate Spatial. The table below provides an overview of the functions provided by each database

FunctionDescriptionPostgresqlOracle 10g/11gMySQLSQLServerGeoDB (H2)
Basic functions on Geometry
int dimension(Geometry)SFS §
String geometrytype(Geometry)SFS §
int srid(Geometry) SFS §
Geometry envelope(Geometry)SFS §
String astext(Geometry)SFS §
byte[] asbinary(Geometry)SFS §
boolean isempty(Geometry)SFS §
boolean issimple(Geometry)SFS §
Geometry boundary(Geometry)SFS §
Functions for testing Spatial Relations between geometric objects
boolean equals(Geometry, Geometry)SFS §
boolean disjoint(Geometry, Geometry)SFS §
boolean intersects(Geometry, Geometry)SFS §
boolean touches(Geometry, Geometry)SFS §
boolean crosses(Geometry, Geometry)SFS §
boolean within(Geometry, Geometry)SFS §
boolean contains(Geometry, Geometry)SFS §
boolean overlaps(Geometry, Geometry)SFS §
boolean relate(Geometry, Geometry, String) SFS §
Functions that support Spatial Analysis
double distance(Geometry, Geometry)SFS §
Geometry buffer(Geometry, double)SFS §
Geometry convexhull(Geometry)SFS §
Geometry intersection(Geometry, Geometry)SFS §
Geometry geomunion(Geometry, Geometry)SFS § (renamed from union)
Geometry difference(Geometry, Geometry)SFS §
Geometry symdifference(Geometry, Geometry)SFS §
Common non-SFS functions
boolean dwithin(Geometry, Geometry, double)Returns true if the geometries are within the specified distance of one another
Geometry transform(Geometry, int)Returns a new geometry with its coordinates transformed to the SRID referenced by the integer parameter
Spatial aggregate Functions
Geometry extent(Geometry)Returns a bounding box that bounds the set of returned geometries