[GIS] Getting geojson data of relations by overpass in Python

openstreetmapoverpass-apipython

I am trying to use overpass api for python to get osm data in the format of geojson. I have successfully run this api to get way in the format of geojson.
The code is like:

api.Get('%s(%d)' % ('way',319141887))

But when I try it for relation data like:

api.Get('%s(%d)' % ('relation',4431641))

, it returns no data. (I'm sure that there is a relation with this id because the way 319141887 is one part of this relation.)

{"features": [], "type": "FeatureCollection"}  

and I am wondering how to get them.

Best Answer

It seems that the overpass library you're trying to use does not support relations.

See https://github.com/mvexel/overpass-api-python-wrapper/issues/48 for details.

Maybe you can try to do some follow up on Github or implement the missing feature on your own.