I'm trying to submitting a query on Overpass-Turbo site that seems to be complex. I would like to get some historical data so I'm using date property.

The problem is I always get the following error:

An error occured during the execution of the overpass query! This is what overpass API returned: runtime error: Query run out of memory using about 2048 MB of RAM.

I even tried to add maxsize property, according to this issue, but It didn't work.

Someone on IRC tells me that I should use offline data to make my query, but I cannot figure out how can I use it.

I would like to see how many italian hotels are on OSM every month since 2010 and how they grew, so I can make some statistics about them. How can I reach that purpose with OSM data?

Thank you.

asked 23 Dec '17, 18:12

Andreanovenove's gravatar image

Andreanovenove
12691017
accept rate: 0%

edited 23 Dec '17, 18:12


I've tried the following query with no problem:

[timeout:250];
(
  node(area:3600365331)(newer:"2017-12-01T00:00:00Z")["tourism"="hotel"];
  way(area:3600365331)(newer:"2017-12-01T00:00:00Z")["tourism"="hotel"];
  relation(area:3600365331)(newer:"2017-12-01T00:00:00Z")["tourism"="hotel"];  
);
out meta;

It gives you all nodes, ways and relations tagged as tourism=hotel inside Italy created from the beginning of December 2017. As for now, they are 106 nodes, 53 ways and 1 relation, so 160 new hotels in Italy since 1st December 2017.

If you run the same query with (newer:"2017-11-01T00:00:00Z"), you get all hotels from the beginning of November. Running now the query gave me 223 nodes, 163 ways and 8 relations, so 394 hotels. That means that in November there have been created 394 - 160 = 234 hotels.

Maybe that helps you?

permanent link

answered 24 Dec '17, 03:56

edvac's gravatar image

edvac
5952517
accept rate: 13%

Yes, it could be a solution, anyway it is not responding to my question.

(27 Dec '17, 11:00) Andreanovenove

Hi:

Sorry, I just focused in solving your task, not your problem with your query and that runtime error. But in fact I hadn't noticed that the query was linked in the first tense of your message...

I was guessing the error with your query was with line

{{geocodeArea:Italy}}->.searchArea;

That the line gets all Italy data before processing it, that is a lot of data. But I am not sure...

Note also that you shouldn't add the last 2 lines:

>;
out meta qt;

Those lines get the nodes and the ways of all relations as well, and the nodes of all ways. But you are interested in nodes, ways and relations that are tagged as tourism=hotel only.

Anyway, I found a good solution for you, much better than my previous answer:

With the following query you get all hotels in Italy at present:

[out:csv(::timestamp)][timeout:150];
(
node["tourism"="hotel"](area:3600365331);
way["tourism"="hotel"](area:3600365331);
relation["tourism"="hotel"](area:3600365331);
);
out meta;

You save the data into a file that you may name like italianHotels.csv for example.

Then, to check all hotels created in May 2009 for example, you run this UNIX command:

cat italianHotels.csv | grep "2009-05" | wc -l

That will give you the hotels whose last version is timestamped in May 2009. In our case, we get 24 hotels.

Or you can open the .csv file in a spreadsheet and get all hotels by month and year with functions.

Note that all these gives you the hotels with the last version, not the hotels when they were first created (version=1). For that I don't think it is possible to do it with Overpass...

permanent link

answered 27 Dec '17, 15:36

edvac's gravatar image

edvac
5952517
accept rate: 13%

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:

×139
×78
×18
×16
×7

question asked: 23 Dec '17, 18:12

question was seen: 1,421 times

last updated: 27 Dec '17, 15:36

powered by OSQA