首页  编辑  

经纬度栅格化处理

Tags: /MySQL/   Date Created:

按GPS经纬度对数据栅格化最简单的方式:

SELECT (LONGITUDE - (LONGITUDE MOD 0.001)) AS "栅格经度", 
             (LATITUDE - (LATITUDE MOD 0.001)) AS "栅格纬度", 
             AVG(PAGEOPENDELAY) / 1000 AS "Page Open Delay(s)" , 
             COUNT(*) AS "样本数" 
FROM APP_BROWSER A, APP_POSITION B 
WHERE A.`POSID` = B.ROW_ID AND LONGITUDE BETWEEN -180 AND 180 AND LATITUDE BETWEEN -90 AND 90
GROUP BY 栅格经度, 栅格纬度