如何在Sequelize中找到半径范围内的所有PostGIS几何点?
我试过这个:
Model.findAll({
where: {
$or: [{
geom: { $contains: { $point: [0, 1] } },
// ST_Within( ST_MakePoint(1,0), `table`.`geom` )
}, {
geom: { $contains: { $point: [0, 1], $fuzziness: 10 } }, // or maybe `$distance`
// ST_DWithin( ST_MakePoint(1,0), `table`.`geom`, 10 )
}, {
point: { $inside: { $col: 'geom' } },
// ST_Within( `table`.`point`, `table`.`geom` )
}, {
point: { $inside: { $polygon: [/* some coordinates */] } },
// ST_Within( `table`.`point`, ST_GeomFromGeoJSON({type: 'Polygon'...}) )
}],
},
});
Run Code Online (Sandbox Code Playgroud)
以及支持几何的其他示例,但它不起作用.
错误是:
第一个:SequelizeDatabaseError:运算符不存在:geometry @> geometry
第二:SequelizeDatabaseError:未知的GeoJSON类型
有人可以举例说明如何在Sequelize中找到半径范围内所有模型的点数吗?
谢谢,迈克尔.
| 归档时间: |
|
| 查看次数: |
804 次 |
| 最近记录: |