Add member label-node to metadata

Avatar
  • updated
  • Under review

Thanks for creating OSM-Boundaries! It helps a lot!

There's one thing which I still need to do as a separate step after downloading data from here: Getting the recommended label position directly from OSM. It would be great if this could be integrated in the metadata somehow to save that extra step.

Maybe it could be added to the Tags or as a separate property, like

"properties": { "osm_id": -365331, "label_position": { "lat":42.6384261,"lon":12.6742970 }, ...}

Here's what I'm doing currently (example Italy)

Manual approach:

  1. get ID from the country I'm interested in from the OSM-B data, e.g. Italy 365331
  2. Visit Page https://www.openstreetmap.org/relation/365331
  3. Observe orange circle north of Rome which is the label position
  4. Scroll to bottom, expand Members Section
  5. Scroll again (or search for "label"), find  "Node Italy (26347360) as label"
  6. Click link and get position from page

Scripted:

  1. Download https://www.openstreetmap.org/api/0.6/relation/#{osm_id.abs}.json, e.g. https://www.openstreetmap.org/api/0.6/relation/365331.json
  2. find elements[0].members where role=="label"
  3. download https://www.openstreetmap.org/api/0.6/#{type}/#{ref}.json, e.g. https://www.openstreetmap.org/api/0.6/node/26347360.json
  4. find lat, lon

Avatar
Magnus
  • Under review

This sounds quite interesting. Right now I don't know how possible it is for us, or how to implement it. Our lack of knowledge around OSM itself is a bit of a threshold. But based on your instructions of how you do it manually, we should be able to figure out how it looks in the underlying data.

We will do some research to see what we can do about this.