Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an API for openstreetmap? [closed]

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

like image 258
Yngve Sneen Lindal Avatar asked Jul 07 '09 23:07

Yngve Sneen Lindal


People also ask

Does OpenStreetMap have an API?

OpenStreetMap has an editing API for fetching and saving raw geodata from/to the OpenStreetMap database — this is the entry page for the documentation. If you just want to embed a map into a webpage, you don't want this API. Use a web map library instead.

How do I get OpenStreetMap API?

The Openstreetmap API endpoint is located at http://api.openstreetmap.org/. You can find the Openstreetmap API portal / hompage here. If you need Openstreetmap API support, you can visit developer support here, or reach out to their Twitter account at @OpenStreetMap.

Is OpenStreetMap API free?

Openstreetmap API is an open-source initiative that generates world map data and makes them available for free. This means you don't have to pay anything to request data from its database. In fact, you'll even have access to the entire database of Openstreetmap, which isn't so in paid APIs.

How do I download OpenStreetMap offline?

Simply go to www.openstreetmap.org and find the area you would like to download data for. Hit the “Export” button and you will see a screen with the Extent of the download appear. You can customize this download as either the “current extent” or manually select an area by bounding box.


2 Answers

Yes, there is an api and xapi (extended api).

I havent used these yet.

But there is also the cloudmade api to OSM. I played a bit with the python api.

I am not sure, if any of them could help you with your particular problem, but you could search for a coastline near to your point. If your point is within the polygon tagged natural=coastline, you have an island (or a continent)...

like image 178
vikingosegundo Avatar answered Oct 06 '22 16:10

vikingosegundo


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.

like image 41
gravitystorm Avatar answered Oct 06 '22 18:10

gravitystorm