Is there an API for openstreetmap? [closed]

2020-05-11 10:13发布

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).

8条回答
冷血范
2楼-- · 2020-05-11 10:48

MapQuest has a set of 'Open' web service APIs based on OpenStreetMap data with fairly unrestrictive Terms (i.e. the Terms follow closely to that of OSM):

http://developer.mapquest.com/web/products/open

查看更多
▲ chillily
3楼-- · 2020-05-11 10:53

You can use CloudMade's Geocoding API to search for an island in the OpenStreetMap data. The API will return the geometry of the result by default, and this sounds to me what you are looking for. For example, Arran off the coast of Scotland can be found by the following http request:

http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/find/Arran,UK.js?results=1

(and as a neat little hack, changing the .js to .html previews the result.

More docs and examples on the API are at developers.cloudmade.com/projects/show/geocoding-http-api If you don't want to use the http api, then abstraction APIs are available in multiple languages - ruby, python, perl and others.

查看更多
登录 后发表回答