Skip to content

Commit

Permalink
Add a test of clipping the clip region down to the tile boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Nov 27, 2024
1 parent 75511a7 commit 1be64f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ overzoom-test: tippecanoe-overzoom
./tippecanoe-decode tests/pbf/places-1-1-0-clip.pbf 1 1 0 > tests/pbf/places-1-1-0-clip.json.check
cmp tests/pbf/places-1-1-0-clip.json.check tests/pbf/places-1-1-0-clip.json
rm tests/pbf/places-1-1-0-clip.pbf tests/pbf/places-1-1-0-clip.json.check
# Polygon clipping, with excessively large clip region
./tippecanoe-overzoom -b10 -o tests/pbf/countries-8-135-86-bigclip.pbf --clip-polygon "`cat tests/pbf/region.json`" tests/pbf/countries-1-1-0.pbf 1/1/0 8/135/86
./tippecanoe-decode tests/pbf/countries-8-135-86-bigclip.pbf 8 135 86 > tests/pbf/countries-8-135-86-bigclip.json.check
cmp tests/pbf/countries-8-135-86-bigclip.json.check tests/pbf/countries-8-135-86-bigclip.json
rm tests/pbf/countries-8-135-86-bigclip.pbf tests/pbf/countries-8-135-86-bigclip.json.check

join-test: tippecanoe tippecanoe-decode tile-join
./tippecanoe -q -f -z12 -o tests/join-population/tabblock_06001420.mbtiles -YALAND10:'Land area' -L'{"file": "tests/join-population/tabblock_06001420.json", "description": "population"}'
Expand Down
5 changes: 5 additions & 0 deletions tests/pbf/countries-8-135-86-bigclip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ "type": "FeatureCollection", "properties": { "zoom": 8, "x": 135, "y": 86 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "ne_10m_admin_0_countries", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "NAME": "Germany" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 11.210518, 50.771208 ], [ 11.304932, 50.271568 ], [ 11.304932, 49.802541 ], [ 9.788818, 49.802541 ], [ 9.788818, 50.771208 ], [ 11.210518, 50.771208 ] ] ] } }
] }
] }

0 comments on commit 1be64f6

Please sign in to comment.