I am working on a project related to POIs mining and I want to know if there is a way to query all the bridges over rivers for a given country.

What I've done is the following:

[out:json]; (node["place" = "country"]["int_name" = "Portugal"];way"waterway"="river";way"bridge" = "yes"); out;

The thing is that if I increase the radius to cover the hole country I get: runtime error: Query run out of memory using about 2048 MB of RAM

I think that I'm missing s.th but I can't find how to do this in a better way since I'm new in working with QL.

asked 24 May '17, 16:15

TAYARI's gravatar image

TAYARI
11112
accept rate: 0%

edited 24 May '17, 16:20

You will need something like way(around:0)[bridge=yes];, with the rivers as the input to that filter.

Not sure the public server will return all of Portugal at once. You'll have to set a large timeout.

(24 May '17, 17:06) maxerickson

Thanks, Would you please clarify how to put the rivers as input ? Is it correct in the request that i have mentioned ?

(24 May '17, 17:29) TAYARI

Most of the statements in the QL take an input set and return an output set. They can be explicit, or there is an implicit default set (with each statement overwriting it).

So to make the rivers the input using the default set, that query would just need to be the previous statement.

Here's a demo using Overpass Turbo. That uses a small bounding box to demonstrate the approach, the script can be modified to search Portugal:

[out:json][timeout:600];
area(3600295480)->.searchArea;
way["waterway"](area.searchArea);
way(around:0)[bridge=yes];
out body;
>;
out skel qt;

But the public server rejects the request as too large. One approach to work around that is to use smaller internal regions as the search area and multiple requests.

permanent link

answered 24 May '17, 18:53

maxerickson's gravatar image

maxerickson
10.7k1073150
accept rate: 31%

edited 24 May '17, 18:54

Great, thank you. That's what I was looking for and yes, to avoid large requests, I am planning to make a grid of the country and query by cell.

(24 May '17, 19:05) TAYARI
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:

×820
×113
×49
×14

question asked: 24 May '17, 16:15

question was seen: 1,053 times

last updated: 24 May '17, 19:05

powered by OSQA