【发布时间】:2022-02-18 15:48:03
【问题描述】:
我正在尝试让 Jooq 使用 GIS 查询,并在 SO 上找到了一些示例。我对其中一个样本有疑问。我找到了以下构建多边形的函数(How to select points within polygon in PostGIS using jOOQ?)。比如:
public static Field<?> stPolygon(Field<?> geom, int value) {
return DSL.field("ST_Polygon({0}, {1})", Object.class, geom, DSL.val(value));
}
我试图弄清楚如何使用它从 GIS 坐标中构建一个多边形字段(指定为 [latitude, longitude] 列表的双倍)
之后,如果我想选择某个列(点)位于该多边形内的记录,我该如何创建比较运算符。 field.in 函数能否满足此类需求?
【问题讨论】: