How to find a set of lat/long pairs surrounding a 5 miles radius of a certain location

拥有回忆 提交于 2019-12-13 02:55:29

问题


How to find a set of lat/long pairs surrounding a 5 miles radius of a certain location expressed in lat/long or as a address.


回答1:


First you decide how many (lat,lon) pairs you want to have:
You could want to have 4 cordinates forming a square arround the center point.
Or you decide to have a regualr N-Gon around the center point.

Then you use a projection from lat/lon to meters, e.g EquiDistantProjetion.

This allows you to transform the lat/lon center to cartesian meters, where you then can calculate like you have learned it in school.

Now you having the center point in cartesian meters:
Then you use the Polar coordinate form of a coordinate (r, phi) to calculate the corner points of the square or N-gon. (centerX + r* sin(phi), centerY + r* cos(phi)).

Finally you have to use the inverse tranformation to transform your coordinate pairs back to lat/lon.

The EquiDistantProjection works for distances up to some 100 miles. It does not work well above 80 deg latitude. (Polar region)



来源:https://stackoverflow.com/questions/13599044/how-to-find-a-set-of-lat-long-pairs-surrounding-a-5-miles-radius-of-a-certain-lo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!