Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Practical problems of projected way_area calculations #6

Open
yetzt opened this issue Feb 25, 2023 · 3 comments
Open

Practical problems of projected way_area calculations #6

yetzt opened this issue Feb 25, 2023 · 3 comments

Comments

@yetzt
Copy link
Contributor

yetzt commented Feb 25, 2023

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
Copy link
Contributor

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
Copy link
Contributor Author

yetzt commented Feb 26, 2023

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

Two problems:

  • I want to display country names of larger countries in lower zooms and of smaller countries on slightly higher zooms, but the value of the way_area property inflates with latitude, therefore using it as a threshold does not work.
  • The placement of labels appears to be in the centroid of the largest land area after projection, leading to the edge case of Norways Label being placed in Spitsbergen/Svalbard

Norway appears over Svalbard
Norway appears over Svalbard

@yetzt
Copy link
Contributor Author

yetzt commented Feb 26, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants