Python Forum
concatenate a request to the endpoint of OSM-API?! - how to? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: concatenate a request to the endpoint of OSM-API?! - how to? (/thread-29105.html)



concatenate a request to the endpoint of OSM-API?! - how to? - apollo - Aug-18-2020

hello dear commuity


concatenate a request to the endpoint of OSM-API?! - how to?


 i have worked with the python wrapper - but today i have a simple question... 

we can run a request on overpass-tubro.eu like so;
[out:csv(::id,::type,"name","addr:postcode","addr:city","addr:street","addr:housenumber","website"," contact:email=*")][timeout:300];
(
node[amenity=kindergarten](46.3722761,9.5307487,49.0205264,17.160776);
way[amenity=kindergarten](46.3722761,9.5307487,49.0205264,17.160776);
relation[amenity=kindergarten](46.3722761,9.5307487,49.0205264,17.160776);
);
out;
or we can run it like so:

[out:csv(::id,::type,"name","addr:postcode","addr:city","addr:street","addr:housenumber","website"," contact:email=*")][timeout:600];
area["ISO3166-1"="BR"]->.a;
( node(area.a)[amenity=hospital];
  way(area.a)[amenity=hospital];
  rel(area.a)[amenity=hospital];);
out;
just wanted to concatenate the request in overpass-turbo.eu request to gather the data out of openstreetmap - to get the POI for Hospitals for the following countries


Brasil
France
Argentina
Paraquay
USA

ect.
etx.



and we can use the nwr statement to combine node way and relations in one single step.: see here



[out:csv(::id,::type,"name","addr:postcode","addr:city","addr:street","addr:housenumber","website"," contact:email=*")][timeout:600];
nwr(area["ISO3166-1"="BR"])[amenity=hospital];
nwr(area["ISO3166-1"="FR"])[amenity=hospital];
nwr(area["ISO3166-1"="AR"])[amenity=hospital];)
nwr(area["ISO3166-1"="PA"])[amenity=hospital];)
nwr(area["ISO3166-1"="US"])[amenity=hospital];)
out;
but that does not work either!?
-the question is: how to concatenate the request?  to be able to run it against the following: 
  nwr(area["ISO3166-1"="BR"])[amenity=hospital];
nwr(area["ISO3166-1"="FR"])[amenity=hospital];
nwr(area["ISO3166-1"="AR"])[amenity=hospital];)
nwr(area["ISO3166-1"="PA"])[amenity=hospital];)
nwr(area["ISO3166-1"="US"])[amenity=hospital];)
out;
look forward to hear from you 
regards martin --