protomaps / PMTiles

Cloud-optimized + compressed single-file tile archives for vector and raster maps
https://protomaps.com/docs/pmtiles/
BSD 3-Clause "New" or "Revised" License
2.11k stars 125 forks source link

Feature request: display hovered feature size breakdown in attributes popup #469

Closed adjourn closed 1 month ago

adjourn commented 1 month ago

I'm in the middle of size optimization, for example

I'm kind of wild guessing and wondering what are the most expensive features, what are the general proportions between different features and geometry vs attributes content.

Would be super helpful to have another checkbox in PMTiles Viewer:

[x] show attributes
[x] show sizes

And if both checked:

________________________________
|  water (MultiPolygon)        |
|  class ocean                 |
|                              |
|  total size 243523 bytes     |
|  geometry size 24100 bytes   |
|______________________________|
               V

I don't fully understand all the concepts and underlying structures yet, so I have no idea how feasible it is.

adjourn commented 1 month ago

Separate feature but if size toggle also displayed the total size of each layer, that would also be very informative.

bdon commented 1 month ago

I would really prefer that is in a specialized tool instead of this general-purpose viewer. What are you using to generate the tiles? for planetiler there is a --generate-layerstats and there are also interactive tools like this: https://dnomadb.github.io/map-tools/tilestats/?tilejson=https%3A%2F%2Fdemotiles.maplibre.org%2Ftiles%2Ftiles.json#1/0/0

adjourn commented 1 month ago

Was hoping to get a bit more in-depth analysis capabilities (hence the size per hovered feature) but I totally understand your point of view, thanks for answering!

bdon commented 1 month ago

hence the size per hovered feature

This is still best done at the tile level because feature tag keys/values are deduplicated, so the most "expensive" features are those with unique values like height=15.5 etc.