13
4

Is it possible, say, for an independent developer to extract a list of "landmarks" (churches, museums, squares, ...) from OSM? (Question originally asked on IRC)

asked 07 Jul '10, 10:34

Richard's gravatar image

Richard ♦
27.4k40244363
accept rate: 19%


OpenStreetMap has millions of points of interest which will serve you well for this. These are "nodes" (points) each tagged with a set of keywords that indicate what each point is. For example, you might have a node with latitude 51.398, longitude -1.082, and tags amenity=place_of_worship, name=St Mary's Church. This indicates that there's a church called St Mary's Church at that lat and long.

So you need to get this data out of OSM. The first step is to identify which tags you're interested in. You might want, for example, everything tagged as a church: in other words, everything with amenity=place_of_worship. (The first part of the tag is the 'key', the second the 'value'. You can see a long list of common OSM tags on our wiki.)

There are two ways you can get this data out of the OSM database.

One is by using XAPI, the Extended API. XAPI allows you to query the server for data matching certain tags. It can be very slow, so certainly isn't suitable for live use (you shouldn't use OSM servers for your live app anyway). But it's an easy way to download a lot of data matching certain criteria.

The ideal way, however, is to download the OpenStreetMap data dump and filter it according to your needs. The data dump is called planet.osm. You can either download the whole world (really huge), or just an extract covering one country or state.

Once you've downloaded it, a wonderful Java program called Osmosis will do all the hard work of extracting the data for you, and either loading the result into a database, or outputting it as a file.

permanent link

answered 07 Jul '10, 10:49

Richard's gravatar image

Richard ♦
27.4k40244363
accept rate: 19%

edited 09 Sep '10, 15:06

Jonathan%20Bennett's gravatar image

Jonathan Ben...
8.2k1785108

3

Especially in well-mapped parts of the world, points of interest may also be available as "areas" (closed sequences of nodes) instead of nodes. The tags are the same as you would find on nodes, but if you want a single latitude/longitude pair you need to calculate it from the area outline!

(10 Jul '10, 13:19) Tordanik

I posted a follow-up question that outlines the process of filtering specific data from a planet file. It may contain information useful to those interested in this topic. Also, I hope to get best practices on how to keep a POI database up-to-date once you have it set up, which is what my question is about.

permanent link

answered 25 Mar '11, 10:23

mvexel's gravatar image

mvexel
73281523
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×190
×155

question asked: 07 Jul '10, 10:34

question was seen: 52,132 times

last updated: 25 Mar '11, 10:23

powered by OSQA