首页 > 解决方案 > JDBI Postgis JTS 包装器

问题描述

我正在尝试使用 PostGIS-JDBC-jtsparser(版本 2.5.0)模块将 JTS java 对象作为参数注入,@SQLQuery但我不知道如何。
我知道应该在我的 JDBI 配置中注入一个参数工厂,但是哪个?
如果这不是正确的方法,那么最好的方法是什么?

! 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)

标签: javapostgisjdbijtsjdbi3

解决方案


推荐阅读