Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The mentioned Overpass API uses sets as a sort of fundamental concept, so the code

    way[building][!name];foreach{(._;>;);out;}
can be replaced with

    way[building][!name];(._;>;);out;
The "(._;>;);" stanza is sort of dense and seems opaque without knowing what it's doing, but it's straightforward, returning the union "();" of the previous result "._;" and the children of the previous result ">;".

The change I propose above adjusts the ">;" to operate on all of the "way[building][!name];" results together, rather than each element one at the time.



this is a common enough need that

  out geom
does a similar operation in fewer characters


It doesn't do exactly the same thing, it inserts the lat/long into the parent instead of returning the nodes. Often doesn't matter, but it does if you are using a library that is expecting osm xml.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: