You are not logged in.

Announcement

*** NOTICE: By 30th of September 2022 the forum.openstreetmap.org will be retired, please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators. We expect the migration of data will be finished by that date, you can follow its progress here.***

#1 2021-05-02 07:19:10

tagtheworld
Banned
Registered: 2012-04-25
Posts: 236

area-request: adding only a single line - the whole code fails

hello dear friends

this runs well - without any issue

[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;



i wanted to add a single line - but see here

[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=amenity=nursing_home][name](around.city:2000);
out center;

it fails

Error: line 7: parse error: ']' expected - '=' found.
Error: line 8: parse error: Unexpected end of input.
Error: line 4: static error: Element "print" cannot be subelement of element "union".

Last edited by tagtheworld (2021-05-02 07:23:48)


https://wiki.openstreetmap.org/wiki/User:Tagtheworld - interested in all things concerning osm especially those related to the languages Perl, PHP, Python and the databases MySQL and Postgresql.

Offline

#2 2021-05-02 08:37:19

peb-kac
Member
Registered: 2021-04-18
Posts: 10

Re: area-request: adding only a single line - the whole code fails

You have two errors in your query. The parenthesis starting before nwr[amenity=hospital] are not closed and nwr[amenity=amenity=nursing_home] contains the key amenity twice, the query below runs fine for me:

[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=nursing_home][name](around.city:2000);
);
out center;

Last edited by peb-kac (2021-05-02 08:37:53)

Offline

#3 2021-05-02 09:49:35

mmd
Member
Registered: 2010-11-06
Posts: 2,128

Re: area-request: adding only a single line - the whole code fails

I'd suggest not to use "around" for this use case, but rather area. Otherwise your results will be incomplete.

See https://forum.openstreetmap.org/viewtop … 65#p828265 for an example.

@tag...There's really no need to post your question in multiple sub-forums at the same time. One post would do as well.

Last edited by mmd (2021-05-02 09:51:16)

Offline

Board footer

Powered by FluxBB