mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-22 18:12:40 +00:00
Merge pull request #331 from mapbox/no-dropping-if-zoom-tagged
Dot-dropping doesn't apply if there is a per-feature minzoom tag
This commit is contained in:
commit
785d341cde
@ -1,3 +1,7 @@
|
||||
## 1.15.4
|
||||
|
||||
* Dot-dropping with -r/-B doesn't apply if there is a per-feature minzoom tag
|
||||
|
||||
## 1.15.3
|
||||
|
||||
* Round coordinates in low-zoom grid math instead of truncating
|
||||
|
@ -179,7 +179,9 @@ If you have a feature like this:
|
||||
|
||||
with a `tippecanoe` object specifiying a `maxzoom` of 9 and a `minzoom` of 4, the feature
|
||||
will only appear in the vector tiles for zoom levels 4 through 9. Note that the `tippecanoe`
|
||||
object belongs to the Feature, not to its `properties`.
|
||||
object belongs to the Feature, not to its `properties`. If you specify a `minzoom` for a feature,
|
||||
it will be preserved down to that zoom level even if dot-dropping with `-r` would otherwise have
|
||||
dropped it.
|
||||
|
||||
You can also specify a layer name in the `tippecanoe` object, which will take precedence over
|
||||
the filename or name specified using `--layer`, like this:
|
||||
|
@ -223,7 +223,9 @@ If you have a feature like this:
|
||||
.PP
|
||||
with a \fB\fCtippecanoe\fR object specifiying a \fB\fCmaxzoom\fR of 9 and a \fB\fCminzoom\fR of 4, the feature
|
||||
will only appear in the vector tiles for zoom levels 4 through 9. Note that the \fB\fCtippecanoe\fR
|
||||
object belongs to the Feature, not to its \fB\fCproperties\fR\&.
|
||||
object belongs to the Feature, not to its \fB\fCproperties\fR\&. If you specify a \fB\fCminzoom\fR for a feature,
|
||||
it will be preserved down to that zoom level even if dot\-dropping with \fB\fC\-r\fR would otherwise have
|
||||
dropped it.
|
||||
.PP
|
||||
You can also specify a layer name in the \fB\fCtippecanoe\fR object, which will take precedence over
|
||||
the filename or name specified using \fB\fC\-\-layer\fR, like this:
|
||||
|
6
tests/minzoom/in.json
Normal file
6
tests/minzoom/in.json
Normal file
@ -0,0 +1,6 @@
|
||||
{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 1, 1 ] }, "tippecanoe": { "minzoom": 1, "maxzoom": 1 } }
|
||||
{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 2, 2 ] }, "tippecanoe": { "minzoom": 2, "maxzoom": 2 } }
|
||||
{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 3, 3 ] }, "tippecanoe": { "minzoom": 3, "maxzoom": 3 } }
|
||||
{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 4, 4 ] }, "tippecanoe": { "minzoom": 4, "maxzoom": 4 } }
|
||||
{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 5, 5 ] }, "tippecanoe": { "minzoom": 5, "maxzoom": 5 } }
|
||||
{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 6, 6 ] }, "tippecanoe": { "minzoom": 6, "maxzoom": 6 } }
|
66
tests/minzoom/out/-z6.json
Normal file
66
tests/minzoom/out/-z6.json
Normal file
@ -0,0 +1,66 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "1.000000,1.000000,6.000000,6.000000",
|
||||
"center": "6.000000,6.000000,6",
|
||||
"description": "tests/minzoom/out/-z6.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 6, \"fields\": {} } ] }",
|
||||
"maxzoom": "6",
|
||||
"minzoom": "0",
|
||||
"name": "tests/minzoom/out/-z6.json.check.mbtiles",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 0.966797, 1.010690 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 0.966797, 1.010690 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 0.966797, 1.010690 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 0.966797, 1.010690 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 2, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 1.999512, 2.021065 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 4, "y": 3 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 2.999268, 3.008870 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 8, "y": 7 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 3.999023, 4.001260 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 16, "y": 15 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 4.998779, 5.000658 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 6, "x": 33, "y": 30 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 5.999908, 6.001265 ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
3
tile.cpp
3
tile.cpp
@ -1473,8 +1473,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
|
||||
if (tippecanoe_maxzoom != -1 && z > tippecanoe_maxzoom) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (z < feature_minzoom) {
|
||||
if (tippecanoe_minzoom == -1 && z < feature_minzoom) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
#define VERSION "tippecanoe v1.15.3\n"
|
||||
#define VERSION "tippecanoe v1.15.4\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user