如何在mysql中检查多边形中的真正纬度/经度

时间:2018-04-23 11:02:38

标签: mysql polygon spatial

此查询未结果:

select *
from provinces
 where ST_Contains(GeomFromText(CONCAT('POINT(',51.4, ' ', 37.2,')'),4326),polygon)

1 个答案:

答案 0 :(得分:0)

SELECT ea.entity_id,ea.latitude, ea.longitude ,c.name
from entity_addresses  as ea
inner join cities as c on  ST_CONTAINS(c.polygon, 
               ST_GeomFromText(ST_AsText(point(ea.longitude, ea.latitude)), 
4326))