목차

MySQL Geospatial

WKT

POLYGON 안에 POINT가 속하는지?

* geospatial - MySQL: Spatial Query to find whether a latitude/longitude point is located within a given boundary - Stack Overflow

SELECT ST_Within(ST_GEOMFROMTEXT('POINT(100.52438735961914 13.748889613522605)'),
             ST_GEOMFROMTEXT('POLYGON((100.49503326416016 13.766897133254545, 100.55940628051758 13.746555203977,100.56266784667969 13.72170897580617, 100.48885345458984 13.739051587150175,
             100.49503326416016 13.766897133254545))'))
AS geoFenceStatus;

참조