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 §2.1.1.1
String geometrytype(Geometry)SFS §2.1.1.1
int srid(Geometry) SFS §2.1.1.1
Geometry envelope(Geometry)SFS §2.1.1.1
String astext(Geometry)SFS §2.1.1.1
byte[] asbinary(Geometry)SFS §2.1.1.1
boolean isempty(Geometry)SFS §2.1.1.1
boolean issimple(Geometry)SFS §2.1.1.1
Geometry boundary(Geometry)SFS §2.1.1.1
Functions for testing Spatial Relations between geometric objects
boolean equals(Geometry, Geometry)SFS §2.1.1.2
boolean disjoint(Geometry, Geometry)SFS §2.1.1.2
boolean intersects(Geometry, Geometry)SFS §2.1.1.2
boolean touches(Geometry, Geometry)SFS §2.1.1.2
boolean crosses(Geometry, Geometry)SFS §2.1.1.2
boolean within(Geometry, Geometry)SFS §2.1.1.2
boolean contains(Geometry, Geometry)SFS §2.1.1.2
boolean overlaps(Geometry, Geometry)SFS §2.1.1.2
boolean relate(Geometry, Geometry, String) SFS §2.1.1.2
Functions that support Spatial Analysis
double distance(Geometry, Geometry)SFS §2.1.1.3
Geometry buffer(Geometry, double)SFS §2.1.1.3
Geometry convexhull(Geometry)SFS §2.1.1.3
Geometry intersection(Geometry, Geometry)SFS §2.1.1.3
Geometry geomunion(Geometry, Geometry)SFS §2.1.1.3 (renamed from union)
Geometry difference(Geometry, Geometry)SFS §2.1.1.3
Geometry symdifference(Geometry, Geometry)SFS §2.1.1.3
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