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”, geometry)
.setParameter(“margin”, margin)
.unwrap(NativeQuery.class)
.addScalar(“ BUFFERED_GEOMETRY”, new JTSGeometryType(PGGeometryTypeDescriptor.INSTANCE))
.getSingleResult();
This code works perfectly when I use postGIS but when I use h2GIS in my tests I get a sql error
Function “GEOGRAPHY” not found
I indeed saw that this function and some others don’t exist in the H2GISFunctions.class. Is there a way around this? Except using Postgres in my tests?