[OSM-talk] Overpass API - Fetching countries, their capitals, and their borders

Léo El Amri leo at superlel.me
Wed Aug 14 08:29:56 UTC 2019


Hi again,

Thanks for the replies

I did several other tries this morning, but it looks like the borders
are too much to handle. Taking your answers into account, rather than
doing thousands of queries on the Overpass API, I think I'll get the
whole Planet file, then use a local tool to get the data (Anyways, in
this context, I only need this info occasionally).

Cordially,
Léo

On 13/08/2019 23:41, Léo El Amri via talk wrote:
> Hello,
> 
> I'm trying to fetch countries, their borders, and their capitals through
> Overpass API, but the server never replies to me (With a timeout:3600
> setting, the server reply with a 502 error after a while).
> I'm only a beginner with this API, so maybe my request is not efficient:
> 
> (
>   node[place=city];
>   node[place=town];
> )->.a;
> rel[boundary=administrative][admin_level=2]->.b;
> (
>   node[place=country];
>   node.a[capital=yes];
>   way[boundary=administrative][admin_level=2];
>   .b;
>   .b >;
> )->.o;
> .o out body;
> 
> What am I doing wrong ? (Should I use another tool for this purpose ?)
> 
> Cordially,
> Léo
> 
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk
> 



More information about the talk mailing list