metaodi / osmapi

Python wrapper for the OpenStreetMap API
http://osmapi.metaodi.ch/
GNU General Public License v3.0
213 stars 41 forks source link

Don't raise XmlResponseInvalidError when using NodeRelations #117

Closed FisherTsai closed 2 years ago

FisherTsai commented 3 years ago

Function NodeRelations raises XmlResponseInvalidError when the target element isn't used in any relations. In this situation, OSM API do return an valid XML with an empty \<osm> element (Check the definition here). I don't think raising XmlResponseInvalidError in this situation is a proper way to go. It might be better to return an empty list, just like the behavior in osmapi v1.0.0.

Consider to make a change for this? For this function, improving the error handling to deal with this or just rolling back to v1.0.0?

Notes that function NodeWays has the same issue.

metaodi commented 3 years ago

@FisherTsai thanks for reporting this issue. I'll look into it.