felt/tippecanoe

String collision results in features having the wrong attributes

Closed this issue · 5 comments

bdon commented

The two strings in question:

Hammersmith and Fulham
[[{"division_id":"085bc6b4ffffffff01fb3b67a2808435","subtype":"country","name":"Perú"},{"division_id":"08559acaffffffff01f27abb0a0cb14b","subtype":"region","name":"Arequipa"},{"division_id":"0856c834ffffffff01fd8ac1c98804cb","subtype":"county","name":"Caravelí"},{"division_id":"0856c53b7fffffff019e8d5b8b047485","subtype":"locality","name":"Chaparra"},{"division_id":"0856c5143fffffff0138e27e7a03f7d8","subtype":"locality","name":"Andenes"}]]

These are properties from Overture Divisions 2024-05-16-beta.0.
To reproduce this in full, use this as ndjson input:

{"type":"Feature","geometry":{"type":"Point","coordinates":[-73.8620223,-15.744153]},"properties":{"id":"0856c5143fffffff0138e27e7a03f7d8","@name":"Andenes","subtype":"locality","local_type":{"en":"hamlet"},"country":"PE","region":"PE-ARE","hierarchies":[[{"division_id":"085bc6b4ffffffff01fb3b67a2808435","subtype":"country","name":"Perú"},{"division_id":"08559acaffffffff01f27abb0a0cb14b","subtype":"region","name":"Arequipa"},{"division_id":"0856c834ffffffff01fd8ac1c98804cb","subtype":"county","name":"Caravelí"},{"division_id":"0856c53b7fffffff019e8d5b8b047485","subtype":"locality","name":"Chaparra"},{"division_id":"0856c5143fffffff0138e27e7a03f7d8","subtype":"locality","name":"Andenes"}]],"parent_division_id":"0856c53b7fffffff019e8d5b8b047485","perspectives":null,"norms":null,"population":null,"capital_division_id":null,"wikidata":null,"names":{"primary":"Andenes","common":{"en":"Andenes","es":"Andenes"},"rules":null},"version":0,"update_time":"2024-05-11T06:56:01Z","sources":[{"property":"","dataset":"OpenStreetMap","record_id":"N3522957503","confidence":null}]},"id":92526}
{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.2216242,51.4948601]},"properties":{"id":"085070173fffffff014fa86038bb5217","@name":"Hammersmith And Fulham","subtype":"county","local_type":{"en":"county"},"country":"GB","region":"GB-ENG","hierarchies":[[{"division_id":"085eea613fffffff01a8a15aa3da4c44","subtype":"country","name":"United Kingdom"},{"division_id":"085255dd7fffffff011aba243af254bd","subtype":"region","name":"England"},{"division_id":"085070173fffffff014fa86038bb5217","subtype":"county","name":"Hammersmith And Fulham"}]],"parent_division_id":"085255dd7fffffff011aba243af254bd","perspectives":null,"norms":null,"population":null,"capital_division_id":null,"wikidata":null,"names":{"primary":"Hammersmith And Fulham","common":null,"rules":null},"version":0,"update_time":"2024-05-11T06:57:45Z","sources":[{"property":"","dataset":"geoBoundaries","record_id":"GBR9080712B6991151074246","confidence":null}]},"id":1096239}
tippecanoe input.json -o out.pmtiles -maximum-zoom 0 --force

The output will have the hierarchies of the Lima point as the @name property of the Peru point.

If you switch the order in the NDJSON input, this will be reversed.

This bug is not present in 2.34.1. it is present in 2.53.0, so a bisect should be useful in finding the source.

bdon commented

Identified e2a7a40 as the culprit with git bisect

bdon commented

Another pair:

Poull Bojer
[[{"division_id":"085ec5c23fffffff01339442745f3d55","subtype":"country","name":"Ecuador"},{"division_id":"085dac297fffffff0147c020488d610d","subtype":"region","name":"Cotopaxi"},{"division_id":"085bf1b2ffffffff012715ee575c3475","subtype":"county","name":"Sigchos"},{"division_id":"085bf010ffffffff014f248c7b4fe243","subtype":"locality","name":"Sigchos"},{"division_id":"085bf03a3fffffff01145a02d706b16f","subtype":"locality","name":"Tiliguila"}]]

Ouch, thanks for the bug report! I'll get it fixed.

bdon commented

Confirming it's fixed for our dataset, thanks!