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 ♦
28.5k40253383
accept rate: 19%


2 Answers:
22

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 Overpass, a separate API with a powerful query language which allows you to fetch data matching certain tags.

The second 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, you can use Osmosis or Osmfilter to extract the data for you, and output it into a file. Alternatively, you can load all the data into a local database with Osmosis or osm2pgsql, and then query the database for the features you want.

permanent link

answered 07 Jul '10, 10:49

Richard's gravatar image

Richard ♦
28.5k40253383
accept rate: 19%

edited 08 May, 15:55

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
1

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%

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:

×201
×163

question asked: 07 Jul '10, 10:34

question was seen: 59,521 times

last updated: 08 May, 15:55

powered by OSQA