overpass-api-request is not performed complety - particular results lead to mistakes

Here you can just talk about MX or post interesting topics about what you have done in MX that you want to share with others. Other non-MX topics can be discussed within the Rules of the Forum.
Message
Author
User avatar
say_hello
Posts: 158
Joined: Thu Jul 04, 2019 10:46 am

overpass-api-request is not performed complety - particular results lead to mistakes

#1 Post by say_hello »

dear community

i performe some requests on overpass-turbo.eu: this runs great:

Code: Select all

[out:csv(::id,::type,::lon,::lat,amenity,name,"addr:postcode","addr:city","addr:street","addr:housenumber","contact:website",website,"contact:email")]
[timeout:600];
rel[boundary=administrative][admin_level=6][name="München"] -> .city;
(nwr[amenity=hospital][name](around.city:2000);
nwr[amenity=school][name](around.city:2000););
out center;

- with the following request via overpass-turbo.eu  i have some issues


only the last expression works - in other words only the very last expression will be performed : 
all the others are ignored

Code: Select all


    [out:csv(::id,::type,::lon,::lat,amenity,name,"addr:postcode","addr:city","addr:street","addr:housenumber","contact:website",website,"contact:email")]
    [timeout:600];
    rel[boundary=administrative][admin_level=6][name="München"] -> .city;
    (nwr[amenity=hospital][name](around.city:2000);
    nwr[amenity=school][name](around.city:2000);)/>;
    nwr[amenity=childcare][name](around.city:2000);
    nwr[amenity=kindergarten][name](around.city:2000);
    nwr[amenity=nursing_home][name](around.city:2000);
    nwr[amenity=college][name](around.city:2000);
    
    out center;

in fact: only this term will be executed: 

    nwr[amenity=college][name](around.city:2000);


this is given back: 

Code: Select all

    
    @id    @type    @lon    @lat    amenity    name    addr:postcode    addr:city    addr:street    addr:housenumber    contact:website    website    contact:email
    2354666181    node    11.5557656    48.1274889    college    EAM-Europa Akademie München - School Of International Business    80337    München    Adlzreiterstraße    6            
    3324407853    node    11.5551400    48.1264588    college    Akademie Deutsche POP    80337    München    Adlzreiterstraße    18a        http://www.deutsche-pop.de/standort/muenchen    
    3324407854    node    11.5713030    48.1285751    college    Akademie Deutsche POP    80469    München    Klenzestraße    67        http://www.deutsche-pop.de/standort/muenchen    
    4379246720    node    11.5629942    48.1469822    college    Hochschule für Politik München    80333    München    Richard-Wagner-Straße    1            
    4448465264    node    11.4461165    48.1488143    college    DEKRA Akademie GmbH                        https://www.dekra-akademie.de/de/muenchen/    
    4984543723    node    11.5998193    48.1353510    college    Münchner Volkshochschule – Einstein 28    81675    München    Einsteinstraße    28        https://www.mvhs.de/ueber-uns/standorte/gasteig-einstein-28-stadtbereich-mitte/    
    5542020160    node    11.6368555    48.0790856    college    Fakultät für Betriebswirtschaftf                            
    5542020161    node    11.6348063    48.0806016    college    Fakultät für Betriebswirtschaft                            
    5542020162    node    11.6336959    48.0810352    college    Fakultät für Betriebswirtschaft                            
    18940172    way    11.4648639    48.1127381    college    Haus A Genzentrum der LMU und Institut für Biochemie    81377    München    Feodor-Lynen-Straße    25        https://www.genzentrum.lmu.de/    
    19329687    way    11.5817581    48.1500346    college    Herzogliches Georgianum    80539    München    Professor-Huber-Platz    1        http://www.herzoglichesgeorgianum.de/Herzogliches_Georgianum/Home.html    
    27959435    way    11.5929977    48.1424114    college    Bayerische EliteAkademie    80538    München    Prinzregentenstraße    7        http://www.eliteakademie.de    
    44615795    way    11.5806579    48.1550310    college    Priesterseminar St. Johannes der Täufer                    http://www.priesterseminar-muenchen.de/        
    166433609    way    11.5888108    48.1304498    college    Collegium Carolinum                            
    867729755    way    11.6027411    48.1324959    college    Katholische Stiftungshochschule München                        https://www.ksh-muenchen.de  

 

well i wonder - there must be missin something in the request
what do you say - what goes wrong here..´



update: the following code works good - with some renewed brackets

Code: Select all

[out:csv(::id,::type,::lon,::lat,amenity,name,"addr:postcode","addr:city","addr:street","addr:housenumber","contact:website",website,"contact:email")]
    [timeout:600];
    rel[boundary=administrative][admin_level=6][name="München"] -> .city;
    (
    nwr[amenity=hospital][name](around.city:200);
    nwr[amenity=school][name](around.city:200);
    nwr[amenity=childcare][name](around.city:200);
    nwr[amenity=kindergarten][name](around.city:200);
    nwr[amenity=nursing_home][name](around.city:200);
    nwr[amenity=college][name](around.city:200);
    );
    
    out center;
Last edited by say_hello on Wed Dec 30, 2020 5:40 pm, edited 1 time in total.

User avatar
timkb4cq
Developer
Posts: 3584
Joined: Wed Jul 12, 2006 4:05 pm

Re: overpass-api-request is not performed complety - particular results lead to mistakes

#2 Post by timkb4cq »

Mismatched parentheses?

Code: Select all

(nwr[amenity=hospital][name](around.city:2000);
    nwr[amenity=school][name](around.city:2000);)/>;
    nwr[amenity=childcare][name](around.city:2000);
    nwr[amenity=kindergarten][name](around.city:2000);
    nwr[amenity=nursing_home][name](around.city:2000);
    nwr[amenity=college][name](around.city:2000);
The intitial one (nwr isn't closed at the end.
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB

Fredster
Posts: 13
Joined: Wed Sep 09, 2020 6:11 pm

Re: overpass-api-request is not performed complety - particular results lead to mistakes

#3 Post by Fredster »

If you're the same guy I've seen on other forums, you've been asking about this same topic for at least 5 yrs now. Learned anything in that time that would let you figure out your own very simple problems?

Post Reply

Return to “Community Fun”