以ä¸ã®ãããªãã¿ã´ã©ã¹ã®å®çã使ã£ãæå®ããçµåº¦ç·¯åº¦ã«æãè¿ããã¼ã¿ãåå¾ããSQLã¯çµæ§ãããã¡ã§ãããCPUè² è·ãé«ãå¹çãæªãã®ã§MySQLã«æ¨æºæè¼ã¨ãªã£ã空éæ å ±(geometry)ã使ã£ã¦ã¿ããã¨ã«ãã¾ãã SELECT * FROM loc ORDER BY power(abs(latitude - 緯度 ), 2) + power(abs(longitude - 緯度 ), 2) LIMIT 1 MySQLã®ç©ºéæ å ±(geometry)æ©è½ã¯PostGIS(Postgresã«ã¹ã¿ãã¤ãº)ã«æ¯ã¹ãã¨è²§å¼±ãªã®ã§ããã®çºã®å·¥å¤«ãè¡ãã¾ããä¾ãã°ããã®ã¨ããã®ã¾ã¾ã ã¨éã«SQLãé ããªãã¾ãã ã¾ãã¯ããã¼ãã«å®ç¾©ãã é常ã®ãã¼ãã« CREATE TABLE IF NOT EXISTS `loc` ( `loc_id` int(11) NOT NULL auto_incremen
ããã°ãã¯ãBSäºæ¥é¨éå¡ã§ãã ä»åã¯ãä½ç½®æ å ±(緯度ãçµåº¦)ã®ä¿åæ¹æ³ãç´¹ä»ãã¾ãã ãããã¾ãå¾æã®ã°ã°ãã§è¦ã¤ãããã®ã§ãã ã»ä½ç½®æ å ±ãµã¼ãã¹ã®ã¯ããæ¹ ã»Google Mapsã¨MySQLã®é£æº MySQL(v5.0)ã®Geometryå.... 便å©ããï¼ã¨ããããã¨ã§ä½¿ã£ã¦ã¿ããã¨ã«ãã¾ããã .... ãããããã¨ã¯ãå 輩æ¹ã®ãµã¤ããåèã«ãã¦ãã ããã詳ããè¼ã£ã¦ã¾ãã ããã§ã¯ããã¤ã³ãã ããâ» ä¾ã®ä½ç½®æ å ±ã¯é©å½ã§ãã ï¼ï¼Geometryåã¨ã¯ MySQL4.1以éã§ç¨æããã¦ãã空éæ å ±ãæ±ããã¼ã¿å ï¼ï¼ãã¼ãã«å®ç¾© 対象ã«ã©ã ã®åãGeometryã¨ããã ãã CREATE TABLE points ( point_id INT NOT NULL ,latlon GEOMETRY NOT NULL ,PRIMARY KEY (point_id) ,SPATI
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}