从地理编码地址穿过街道
假设我有很多与交叉点及其地理位置相关的 JSON 数据。
我有一个应用程序,用户可以在其中使用他或她当前的位置,并且我希望能够找出他们所在的街区(即他们所在的街道,以及两条十字路口之间的街道)。最好的方法是什么?有什么好的办法吗?
示例:我获取用户的地理位置,将其反向地理编码为 435 W. 42nd st。使用该数据,我想知道用户位于 42 街的 9 大道和 10 大道之间。
非常感谢任何帮助!
Let's say I have a lot of JSON data relating to intersections and their geolocations.
I have an app where the user uses his or her current location, and I want to be able to figure out what block they're on (i.e. the street they're on, and between what two cross streets). What's the best way to do this? Is there a good way?
Example: I get the user's geolocation, reverse-geocode it into 435 W. 42nd st. Using that data, I want to know that the user is between 9th ave and 10th ave on 42nd st.
Any help is much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要获得每个交叉路口、街区或任何您想要将用户位置关联到的位置的地理位置。获得该信息后,您可以轻松找到距用户当前地理位置最近的交叉路口。
如果所有地理位置信息都在您的 JSON 数据中,则仅在地理位置中工作(不要反向地理编码),直到您确定最近的交叉点等。
您可能最好将 JSON 数据转换为数据库,以便您可以更方便地查询。
You'll need to have the geolocations of each of the intersections, blocks or whatever you want to relate the user position to. Once you have that information, you can easily find the nearest intersections to the user's current geolocation.
If all of the geolocation information is in your JSON data, then work only in geolocations (don't reverse geocode) until you've determine the nearest intersections, etc.
You'll likely do best to convert your JSON data to a database so you can query more easily.