我可以得到所有多边形相交:-7.9245860488441 -37.122384500713,-7.9245860488441 -37.11904223938,-7.9233955716106 -37.1187601948
SELECT *
FROM propriedades
WHERE ST_Intersects(
ST_GeomFromText(location::geometry),
ST_GeomFromText('POLYGON(-7.9245860488441 -37.122384500713,-7.9245860488441 -37.11904223938,-7.9233955716106 -37.1187601948)'));
propriedades 是我的桌子位置是一个列保存地理多边形
返回的错误
错误:解析错误 - 无效几何提示:“POLYGON(-7.9245860488441” <-- 在几何中的位置 25 处解析错误
***错误** *
错误:解析错误 - 无效几何 SQL 状态:XX000 提示:“POLYGON(-7.9245860488441” <-- 解析错误在几何内的位置 25
解决了,我使用了地理,没有几何:
SELECT *
FROM propriedades
WHERE ST_Intersects(
location,
'POLYGON((-7.9239281216632 -37.118491021708,-7.9239281216632 -37.116096663161,-7.9240937813677 -37.116105295265,-7.9241591799314 -37.116171875421,-7.9246636046819 -37.116271405188,-7.9259677455811 -37.118572530098,-7.9256079206171 -37.118728486796,-7.9243335012771 -37.118675962065,-7.9243194973485 -37.11849254918,-7.9242705964918 -37.118491021708,-7.9239281216632 -37.118491021708))'
)
但我还有其他问题,我想要相交 > 50 米
像这样http://slimber.com/gallery/pictures2/23/235563/polygons.jpg