NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am currently working on a list of available hotels in the Republic of Georgia. As the OSM-Database has lots of POIs, is it possible to access this data for that purpose? I would like to run a query to retrieve hotels with addresses, phone numbers and other details that are entered. The coordinates would not matter for my purpose.

The result should be an Excel-file or similar table format.

How can I do this? All help appreciated!

asked 08 May '12, 12:26

moszkva%20ter's gravatar image

moszkva ter
2.1k223960
accept rate: 17%


You can get the data in JSON format in two steps from Overpass API:

First, obtain the area by pasting the following request

<osm-script output="json">

<coord-query lat="42.2" lon="43.3"/>
<print/>

</osm-script>

into the Overpass API query form.

From the result, you can read off the area with name "Georgia" that the relevant area id is 3600028699.

Now you can query for the really wanted data, again on Overpass API query form:

<osm-script output="json">

<query type="node">
  <area-query ref="3600028699"/>
  <has-kv k="tourism" v="hotel"/>
</query>
<print/>
<area-query ref="3600028699"/>
<query type="way">
  <recurse type="node-way"/>
  <has-kv k="tourism" v="hotel"/>
</query>
<print/>

</osm-script>

This results in a 92 KB big JSON file containing all information about nodes or ways in Georgia tagged with tourism=hotel. If you want additionally hostels, repeat the second step with tourism=hostel and so on.

Note that some elements have addresses and phone numbers and others have not, depending on how they have been mapped in the database.

permanent link

answered 08 May '12, 14:17

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

edited 08 May '12, 14:18

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:

×147
×118
×13
×4

question asked: 08 May '12, 12:26

question was seen: 6,656 times

last updated: 03 Jun '20, 21:37

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum