maplibre / maplibre-tile-spec

Next generation vector tiles format
Apache License 2.0
150 stars 13 forks source link

Sorting features causes properties to be non-equal in tests #186

Open springmeyer opened 2 months ago

springmeyer commented 2 months ago

When sorting features in bing tiles the tests fail on property comparison.

For example, with bing tile 4-8-5:

Here is an MVT property:

 mvtProperties: {label-importance=6, has-icon=true, max-text-width=100.0, st-tag=sovCap, name=Copenhagen, bkt=1822, id=7016673626309001217, name-f=16.0, clk-as=lbl}

And here is the MLT property:

 mltProperties: {label-importance=4, has-icon=true, max-text-width=100.0, name=Budapest, bkt=2094, name-f=16.0}

Perhaps the lack of feature IDs in bing tiles is causing this?

Could be a bug in the test comparison code, since it works off feature ids.

To workaround this (and be able to compare sorted features in the tests) we may need to add auto-incrementing support to features that lack an ID (or where it is always zero in the MVT)?

mactrem commented 2 months ago

Yes, sorting is currently only possible if an id is present. Because of this I also do not sort the Bing tiles in the size benchmark tests. I only did a quick implementation of the sorting strategy so it is limited. In general a more sophisticated sorting strategy has the potential to noticeably further reduce the tile size. This is on my list to do a more advanced implementation of the sorting