shortbread-tiles / shortbread-tilemaker

Tilemaker configuration to generate Shortbread vector tiles
https://shortbread-tiles.org/make-vectortiles/
19 stars 9 forks source link

Practical problems of projected `way_area` calculations #6

Open yetzt opened 1 year ago

yetzt commented 1 year ago

I believe there are practical problems with the way_area property calculation in the boundary_labels layer. I noticed the label for Norway appears over Spitzsbergen, and the way_area for norway is 681 million hectares, about 20 times the actual value for the country. The label appears to be placed over the largest mercator projected land area rather than the largest actual area, since value of way_area is be derived from mercator projected shapes as well. Greenland has a way_area of 4.2 billion hectares, more than a thrid of the actual planets actual area. For determining where to place and how to style labels this is problematic, since user expectation would be that the size and appearance of a label reflects the size of the actual country.

woodpeck commented 1 year ago

But is this really true for a map displayed in EPSG:3857, like it is used in most current vector tile display engines? Such a display engine would display the huge Greenland we're used to, and therefore placing the label anywhere else but in the middle of the huge Greenland area would look wrong in the context of an EPSG:3857 map display. I'm happy to discuss this but it seems to me that if you want proper support for other projections, vector tiles will need to be made specifically for each projection. Making projection-agnostic vector tiles would mean that all rendering-related decisions would have to be shifted to the client side, including label placement on areas and shield placement on linear geometries. In some cases this could mean that the client would have to download a lot of tiles and construct huge polygons to make the right decision...

yetzt commented 1 year ago

I'm not talking about the vectors, but the layer properties.

Two problems:

Norway appears over Svalbard Norway appears over Svalbard

yetzt commented 1 year ago

i've solved the issue for myself by using a geojson which includes landarea and properly positions the label for norway and converting it into a shapefile instead of the provided shapefile.