Speaking in Overpass QL I can select a node by its ID:
This however doesn't provide any info about relations or ways this node is a part of. Going to OSM site: http://www.openstreetmap.org/node/3815147164 I can see at least which ways the node belongs to. And then to the way page: http://www.openstreetmap.org/way/136322077 I see its relations. In Overpass relations are not returned, even for the way query:
Any ideas how to get relations? asked 29 Jan '16, 07:44 ivanatora |
Overpass API only returns objects that are explicitly included in the query. To fetch the parents of an input set, use recurse up:
Note that There are also some more fine grained operators if you only want the parent ways of nodes or whatever: answered 29 Jan '16, 14:59 maxerickson |
Node 3815147164 is not part of any relation itself. It is part of way 136322077 which in turn is part of a relation. You already seem to have figured this out by yourself but your question is still a little bit misleading. You don't need Overpass API for returning the ways a node is part of, see http://www.openstreetmap.org/api/0.6/node/3815147164/ways. And you don't need Overpass API for returning the relation a node or way is part of, see http://www.openstreetmap.org/api/0.6/way/136322077/relations. If this doesn't really answer your question then maybe someone can come up with an Overpass API query for returning the relation(s) containing way(s) a node is part of. answered 29 Jan '16, 09:22 scai ♦ Yeah, you are right. I've changed the title a bit, to match my intention in a better way. I'd like to have a pure Overpass solution and not having to mix different APIs in the same application.
(29 Jan '16, 10:19)
ivanatora
|