Sequelize.js 如何在Sequelize中按半径查找所有PostGIS几何点?
如何在Sequelize中按半径查找所有PostGIS几何点 我试过这个:Sequelize.js 如何在Sequelize中按半径查找所有PostGIS几何点?,sequelize.js,Sequelize.js,如何在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 } }
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'...}) )
}],
},
});
和其他的例子,但它不起作用
错误是:
第一:
SequelizeDatabaseError:运算符不存在:geometry@>geometry
第二:
SequelizeDatabaseError:未知的GeoJSON类型
有人能举例说明如何在Sequelize中通过半径找到所有模型的点吗
谢谢,迈克尔