问题描述
我想知道是否有任何 API 可以查询 OSM 数据,例如;(lon_1, lat_1) 是在陆地还是在海上?或者是否有可能将一个岛屿作为一个明确定义的多边形?到目前为止,我所看到的唯一用途只是用于渲染 OSM 数据(生成图块)的工具.
I wonder if there is any API I could query OSM data through, for example; Are (lon_1, lat_1) at land or at sea? Or could it be possible to get an island as a well-defined polygon? The only usage I've seen so far has just been tools for rendering OSM data (generating tiles).
推荐答案
我发现了一个很好的 API 来读取 Openstreetmap 数据;Mapscript.这是 MapServer 的一个接口,它能够读取 *.map 和 *.shp 文件.它能够使用空间索引,因此可能非常快.我在 40 毫秒内完成了世界海岸线形状文件的随机多边形查找(检查多边形是否与陆地相交).
I've found a great API for reading Openstreetmap data; Mapscript.This is an interface to MapServer, which is able to read *.map and *.shp files. It is able to use a spatial index and is therefore potentially extremely fast. I've done random polygon lookups (checking if a polygon intersects land) of the world coastline shape file in 40 ms.
这篇关于是否有用于 openstreetmap 的 API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!