You are not logged in.

#1 2019-08-07 14:50:40

ligazetom
Member
Registered: 2019-08-07
Posts: 2

Dividing areas

Hello,

I am trying to get all roads in Bayern, using overpass api. I am sending requests via curl. Query I am using is this:

[out:json][timeout:200];
area(3600051477)->.country;
(area[name = "Bayern"](area.country);)->.searchArea;
way[highway](area.searchArea);
out ids;

Since there are a lot of ways in Bayern, I am not able to retrieve any of them because of memory limit. I know I can use [maxsize:*bytes*], to increase memory limit, but then I get too many gateway_timeouts and I don't want to rely on lucky time of the day when the server will say yes. I tried many things from filtering way[highway="primary"] etc. however still the same thing.

I cannot even use "out count;" and do some workarounds, because the query just fails.

Obviously the area is too big. I got "Bayern" by using relations with admin_level = 4. So first thought is to use higher level, to get more smaller areas. Unfortunately, it does not work like that.

I only wanted to ask, if there exist some way of getting the area divided to smaller pieces, because the server is obviously loading everything in that area, even if I want only number of ways.

I've spent month developing program, that will get ways and categorize them to their respective roads, but it is all built around sending queries to server.

Today I found there exists, .pbf from geofabrik for the whole Europe. I could obviously do that, use osmium to extract data, but there is just too much work already done to throw it away.



TLDR: Can I somehow divide larger area into more, smaller areas?

Thank you.

Offline

#2 2019-08-07 22:47:20

SomeoneElse
Member
Registered: 2010-10-13
Posts: 1,221

Re: Dividing areas

It's probably easier to download all the data for Bayern (see http://download.geofabrik.de/europe/germany/bayern.html ) and extract the roads you want from that.

Offline

#3 2019-08-08 10:36:10

ligazetom
Member
Registered: 2019-08-07
Posts: 2

Re: Dividing areas

SomeoneElse wrote:

It's probably easier to download all the data for Bayern (see http://download.geofabrik.de/europe/germany/bayern.html ) and extract the roads you want from that.

Yes, I know about that option, I just didn't want the work I've done be for nothing.

Offline

#4 2019-08-08 12:23:21

wambacher
Member
From: Schlangenbad/Wambach, Germany
Registered: 2009-12-16
Posts: 16,443
Website

Re: Dividing areas

ligazetom wrote:

Yes, I know about that option, I just didn't want the work I've done be for nothing.

If you speak German ("Bayern" instead of "Bavaria"), you may go to the German forum: https://forum.openstreetmap.org/viewforum.php?id=14

Regards
walter

Offline

#5 2019-08-08 12:25:20

GerdP
Member
Registered: 2015-12-18
Posts: 890

Re: Dividing areas

Well, I think you have to face it. If you download an extract of Bavaria and filter all ways with highway=* using e.g. osmfilter you just need a small script to automate these two steps. If you invested a lot of work doing this with Overpass you went the wrong way and you work is of small - if any - use if you want to use it with huge areas.

Offline

#6 2019-08-09 11:53:32

MikeN
Member
Registered: 2009-09-03
Posts: 309

Re: Dividing areas

There's currently a limit in Overpass where nested area queries are not filtered, returning too many results.   https://wiki.openstreetmap.org/wiki/Ove … .28area.29

"Caveat: area(area); is currently not supported. In this case, the (area) filter will be silently ignored, leading to unexpected results."

Offline

Board footer

Powered by FluxBB