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

How to Simplify Geometries at Lower Zoom Levels and Use Full Detail at Higher Zoom Levels? #250

Open
saevioapps opened this issue Jul 25, 2024 · 2 comments

Comments

@saevioapps
Copy link

Goal:
At lower zoom levels (e.g., zoom levels 0-4), I want to display countries using highly simplified geometries to ensure that the tiles are very small in size.
At higher zoom levels (e.g., zoom levels 5 and above), I want to progressively include more detailed geometry, eventually using the full detail available in the source data.

Could you please provide guidance on how to set up Tippecanoe to achieve these goals? Any specific commands or examples would be greatly appreciated.

@e-n-f
Copy link
Collaborator

e-n-f commented Jul 25, 2024

You should be able to lower the tile resolution and raise the simplification level at low zooms, while retaining full detail at maxzoom. For example:

tippecanoe -zg -f -o out.mbtiles --no-simplification-of-shared-nodes --no-tiny-polygon-reduction --low-detail=9 --simplification=3 --full-detail=12 --simplification-at-maximum-zoom=1 tl_2022_us_county.json

to create highly simplified, low-resolution tiles at lower zoom levels, while retaining full detail and normal simplification at maxzoom.

The --no-simplification-of-shared-nodes and --no-tiny-polygon-reduction options are to reduce the artifacts that would otherwise be visible in oversimplified and low-resolution tiles, respectively.

@saevioapps
Copy link
Author

Thank you for your help with my previous queries!

tippecanoe -Z0 -z4 --projection=EPSG:4326 -l land \
    $INPUT_PATH/land.geojson -e $LOCAL_SERVER --force --no-tile-compression \
    --visvalingam --low-detail=11 --full-detail=11 --simplification=2

The problem now is that there are a lot of small polygons. For zoom level 0, these are not relevant, they just increase tile size.
image

My goal now is to remove the small polygons based on size at low zoom levels. I successfully used --drop-smallest-as-needed along with --maximum-tile-bytes=20000 to filter out small polygons at zoom level 0. However, I would like to remove polygons below a certain polygon size threshold (e.g., less than 4 pixels) across different zoom levels, not just based on tile size.

I have tried to use --drop-polygons -r 1.6 but, it seems to remove large polygons, not small ones.

Could you advise on how to effectively remove these small polygons?

Thank you for your guidance!

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

No branches or pull requests

2 participants