按经度/纬度自动遍历区域
我正在尝试使用纬度和经度坐标以 1 英里的增量迭代穿越美国。本质上,一旦我开始(假设在俄勒冈州波特兰市),我想以一英里的增量向南移动,直到到达与俄勒冈州波特兰市纬度相同的美国最南端边界。此时,我想从最北端开始,向东移动一英里,重复整个过程,直到到达东海岸。我需要将这些经度/纬度点聚合到数据库中。
我的问题是:通过每次使用 1 英里的增量计算下一个纬度/经度对来逐步遍历纬度和经度是否准确,或者是否有更简单、更优雅的方法来实现我的最终目标?
I'm trying to iteratively traverse the United States in 1 mile increments using latitude and longitude coordinates. Essentially, once I start (lets say in Portland, OR), I want to move south in one mile increments until I reach the southernmost boundary of the United States that is of the same latitude as Portland, OR. At this point, I want to start back at the northernmost part and move one mile east, repeating the entire process until I get to the east coast. I need to aggrigate these longitude/latitude points in a database.
My question is: Is it accurate to step through latitude and longitude by calculating the next lat/long pair using a delta of 1 mile each time, or are there simpler and more elegant methods to achieve my end goal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您可以从俄勒冈州波特兰市的纬度/经度和底部边界的纬度/经度开始。使用此处找到的半正矢计算距离: http://www.movable-type.co .uk/scripts/latlong.html
使用上面的距离,使用上面网站中的给定距离和方位的目的地点部分循环遍历每一英里。对于向南移动,您的方位角将为 180 度(在公式中使用 π,因为他们期望弧度)。对于向东移动,您的方位角将为 90 度 (π/2)。
I suppose you could start with the lat/lon of Portland, OR and the lat/lon of the bottom boundary. Compute the distance using Haversine found here: http://www.movable-type.co.uk/scripts/latlong.html
Using the distance above, loop through each mile using a the section Destination point given distance and bearing from start point from the website above. For moving south, your bearing will 180 deg (use π in the formula as they expect radians). For moving east, your bearing will be 90 deg (π/2).