I'm facing runtime errors for big countries and if it succeeds the browser crashes. I'm actually using this qeury in a python script
Is there anything I'm doing wrong ? or is there any better query for what I want ? https://drive.google.com/file/d/1WGWKxXpW3s0xee-JU2E_9rXL_5vAxIZo/view?usp=sharing |
Have a look at https://osm-boundaries.com/ On the left-hand side in the country structure you can right-click and select all children (or only those you need). After clicking the download button you'll be asked which data format you require. answered 23 Jun '21, 11:19 mtmail |
Hello. Boundaries are huge, thus I think mtmail's answer is probably the best way. But if you really need to go through overpass, first you should simplify your request. You don't need to ask for the ways, as they will be children of the relation. That should lighten the burden of the server if you don't ask the same objects twice. Then, the search area is not precise enough, in your example (targeting Italy) I got the whole boundary of France and some of its regions. Maybe "is_in" might be better. Also, do you really need every kind of boundaries there is ? National parks, municipality, voting zones, and so on. Maybe you could filter with admin_level. Trouble is that it's not totally consistent across every country, but I think it's thoroughly documented in the wiki (boundary, admin_level and subpages). Good luck. Regards. answered 24 Jun '21, 11:05 H_mlet |
First, a general point: Could contributors, other than the OP, not alter the original question. It can make any replies appear to be nonsense & confuse those trying to learn. A part of Jad's problem was the syntax of the code. To correct it, an Answer should have been provided. There are two answers to this Q 1) As as @mtmail suggests use the boundary site, where they have already been saved & segregated off the main server. 2) Going on JAD's original code as posted, the routine wouldn't have run, & even when corrected would probably have timed out for the whole of Italy. This adapted routine is restricted to the visible area & to boundaries of only one admin level: https://overpass-turbo.eu/s/18Nl
There is no need to search for boundary answered 24 Jun '21, 13:34 DaveF Dave. I merely formatted the query as code (with the grey background) as it was displayed as a single long line before. I didn't alter it in any way. And I shortened the title which ran over several lines and put the question in the text instead. Both served to make the question better readable but I didn't change anything in the content.
(24 Jun '21, 14:44)
TZorn
|
https://drive.google.com/file/d/1WGWKxXpW3s0xee-JU2E_9rXL_5vAxIZo/view?usp=sharing This is an instance