JDBI Postgis JTS wrapper

346 Views Asked by At

I'm trying to use the PostGIS-JDBC-jtsparser (version 2.5.0) module to inject the JTS java object as a parameter of a @SQLQuery but I can't figure out how.
I understand that an argument factory should be injected in my JDBI config but which one?
If that's not the right approach, then what would be the best one?

! org.jdbi.v3.core.statement.UnableToCreateStatementException: No argument factory registered for 'POLYGON ((-10 -10, -10 10, 10 10, 10 -10, -10 -10))' of qualified type org.locationtech.jts.geom.Polygon [statement:"/* DataDao.dateHistogramAsIterable */ select st_geohash(mygeo,1) as geohash_0_key,count(mygeo) as geohash_0_count from myindex  where (st_coveredby(mygeo,:0))  group by rollup (geohash_0_key)  ", arguments:{positional:{}, named:{0:POLYGON ((-10 -10, -10 10, 10 10, 10 -10, -10 -10))}, finder:[]}]
! at org.jdbi.v3.core.statement.ArgumentBinder.factoryNotFound(ArgumentBinder.java:174)
0

There are 0 best solutions below