是否有可能像Google地图一样获得城市的多边形边界? [英] Is it possible to get cities polygonal boundaries like in Google Maps?

查看:372
本文介绍了是否有可能像Google地图一样获得城市的多边形边界?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够判断 GPS位置是否位于 居住 无人居住 区域。



我尝试了一些反向地理编码服务,但它们都被证明无用,因为它们选择了最近的地址。 (我明白为什么应该如此,这对于反向地​​理编码的用途很有用)



我在 Google地图中注意到,当我搜索城市,他们的边界将在 红色 明确定义的 一行。我会喜欢它使用这个或类似的东西。



Google地图是否有任何可能的方式提供这样的服务,或者什么可以解决我的问题。 / p>

有没有其他的网络解决方案或数据库,你知道的可以给我这些信息吗?



我可以使用任何具有一些参数的反向地理编码解决方案(例如限制搜索大小)来确定位置是否在人口密集区域?

解决方案

如果您找不到公共服务,那么它会变得非常有趣,并且在开发工作方面会非常昂贵。
数据(全世界)只能从OpenStreetMap获得,我认为他们有这样一个图层(可以被命名为Land_use(农村等))。这个图层通常用于着色地图,查看openstreet地图网页,如果您发现适当的着色,这对你的任务核心。 (例如绿色或灰色)。

这些数据存储在多边形中,您可以从顶部提取这些多边形(我假设它们有数百万个)。十,你需要一个快速搜索空间索引,如一个区域Quadtree。然后你做一个点(经纬度)在多边形调用,并得到多边形相关到你的位置。



Probaly并非所有多边形都适合主存,所以你必须按需求加载它们(例如按国家)。



此方法的一个变体是使用像postgres这样的地理空间数据库来存储多边形并执行数据库查询。



使用这种方法,大多数工作都会从OpenStreetMap DB文件中提取多边形。

更详细的数据来自TomTom,但这些数据可能非常昂贵。


I would like to have the possibility to tell if a GPS location is in an inhabited or uninhabited zone.

I have tried some reverse geocoding services out there, but all of them proved useless, because they select the nearest address possible. (I understand why this should be so, it is useful for the purpose of reverse geocoding)

I have noticed in Google Maps, when I search for a city, their boundaries are selected in red dotted well defined line. I would love it to use this, or something similar.

Is there any possible way that Google maps can provide such a service, or something that can solve my problem.

Are there any other web solution or databases that you know of that can give me this information ?

Or maybe I can use any of the reverse geocoding solutions with some parameters (such as restricting the size of searching) to determine if the location is or is not in a populated area?

解决方案

If you will not find a public service then it gets interesting, and expensive in terms of developping effort.

Public data (world wide) is only available from OpenStreetMap, i think they have such a layer (could be named Land_use (rural, etc.)) This layer is usually used to color a map, look at openstreet map Web page if you find a suitable coloring, that coresponds to your task. (E.g look at green, or gray).

These data are stored in polygons, you would have top extract these polygons (i asume millions of them). Ten you need a fast searching spatial index, like a region Quadtree.

Then you do a "point(lat, lon) in polygon" call, and get the polygon related to your position.

Probaly not all that polygons will fit into main memory, so you must load them on demand (e.g by country).

A variant of this approach is to use a geo spatial database like postgres to store that polygons, and do a DB query.

With that approach most work will be extracting the polygons from OpenStreetMap DB file.

More acurate is data from TomTom, but these can be really expensive.

这篇关于是否有可能像Google地图一样获得城市的多边形边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆