pelias / model

Pelias data models
6 stars 17 forks source link

Support for multi-parents ? #129

Open Joxit opened 4 years ago

Joxit commented 4 years ago

I was working on this project and I saw this message :

https://github.com/pelias/model/blob/37c4330028dad260038ab05befb81f119f24a67a/Document.js#L345-L368

I thought it was a pretty cool feature but when I saw this piece of code I thought it wasn't really going to work ...

https://github.com/pelias/model/blob/37c4330028dad260038ab05befb81f119f24a67a/Document.js#L321-L332

This does not really work as expected. For example in this example, the second London and LD will not be added and this can be an wired :thinking:. (osm:locality:4004 with no name)

  var doc = new Document( 'geoname', 'venue', 1003 )
      .setCentroid({ lon: 0.5, lat: 50.1 })
      .addParent( 'locality', 'London', '3003', 'LD', 'whosonfirst' )
      .addParent( 'locality', 'London', '4004', 'LD', 'osm' )