====== MySQL Geospatial ====== * [[database:mysql|MySQL]] 위치 정보 조회 * [[https://dev.mysql.com/doc/refman/8.0/en/spatial-types.html|MySQL :: MySQL 8.0 Reference Manual :: 11.4 Spatial Data Types]] * [[https://dev.mysql.com/doc/refman/5.7/en/spatial-analysis-functions.html|MySQL :: MySQL 5.7 Reference Manual :: 12.17 Spatial Analysis Functions]] * [[https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry|Well-known text representation of geometry - WKT]] * [[http://www.gisdeveloper.co.kr/?p=994|[GIS] WKT(Well-Known Text) Geometry – GIS Developer]] ====== WKT ====== * ''POINT(x y)'', ''POINT(lon lat)'', ''POINT(경도 위도)'' ===== POLYGON 안에 POINT가 속하는지? ===== * [[https://stackoverflow.com/questions/25491938/mysql-spatial-query-to-find-whether-a-latitude-longitude-point-is-located-withi|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; ===== 참조 ===== * [[https://stackoverflow.com/questions/25491938/mysql-spatial-query-to-find-whether-a-latitude-longitude-point-is-located-withi|geospatial - MySQL: Spatial Query to find whether a latitude/longitude point is located within a given boundary - Stack Overflow]] * [[https://mysqlserverteam.com/upgrading-to-mysql-8-0-with-spatial-data/|Upgrading to MySQL 8.0 with Spatial Data | MySQL Server Blog]] * [[https://mysqlserverteam.com/detecting-incompatible-use-of-spatial-functions-before-upgrading-to-mysql-8-0/|Detecting Incompatible Use of Spatial Functions before Upgrading to MySQL 8.0 | MySQL Server Blog]] * [[https://mysqlserverteam.com/geography-in-mysql-8-0/|Geography in MySQL 8.0 | MySQL Server Blog]]