I am trying to get all roads in Bayern, using overpass api. I am sending requests via curl. Query I am using is this:
(areaname = “Bayern”;)->.searchArea;
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?