ox-it / dataox

The frontend for data.ox.ac.uk
http://data.ox.ac.uk/
12 stars 1 forks source link

Import nested OSM relations during Oxpoints Extents import task #17

Closed finlaybirnie closed 3 years ago

finlaybirnie commented 4 years ago

We get building outlines from the openstreetmap API, and they come as a 'way' or 'relation': https://api.openstreetmap.org/api/0.6/relation/3939519/full

The API response contains the main item itself (found by its ID, 3939519) and children (shown as a tag within the main item).

The previous code only imported children that are ways, but they can also be relations. This PR detects whether a child is a way or relation and processes it accordingly. If it's a relation, it needs its own fresh request to the API, so that has also been copied in from another function.