mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-01 16:58:05 +00:00
Add documentation. Be lenient about zooms as numbers vs strings.
This commit is contained in:
parent
c0480673c5
commit
6767aa7a5c
23
README.md
23
README.md
@ -110,6 +110,29 @@ $ tippecanoe -o alameda.mbtiles -l alameda -n "Alameda County from TIGER" -z13 t
|
||||
$ cat tiger/tl_2014_*_roads.json | tippecanoe -o tiger.mbtiles -l roads -n "All TIGER roads, one zoom" -z12 -Z12 -d14 -x LINEARID -x RTTYP
|
||||
```
|
||||
|
||||
GeoJSON extension
|
||||
-----------------
|
||||
|
||||
Tippecanoe defines a GeoJSON extension that you can use to specify the minimum and/or maximum zoom level
|
||||
at which an individual feature will be included in the vector tile dataset being produced.
|
||||
If you have a feature like this:
|
||||
|
||||
```
|
||||
{
|
||||
"type" : "Feature",
|
||||
"tippecanoe" : { "maxzoom" : 9, "minzoom" : 4 },
|
||||
"properties" : { "FULLNAME" : "N Vasco Rd", },
|
||||
"geometry" : {
|
||||
"type" : "LineString",
|
||||
"coordinates" : [ ... ]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
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`.
|
||||
|
||||
Point styling
|
||||
-------------
|
||||
|
||||
|
@ -451,11 +451,17 @@ int serialize_geometry(json_object *geometry, json_object *properties, const cha
|
||||
if (min != NULL && min->type == JSON_NUMBER) {
|
||||
tippecanoe_minzoom = min->number;
|
||||
}
|
||||
if (min != NULL && min->type == JSON_STRING) {
|
||||
tippecanoe_minzoom = atoi(min->string);
|
||||
}
|
||||
|
||||
json_object *max = json_hash_get(tippecanoe, "maxzoom");
|
||||
if (max != NULL && max->type == JSON_NUMBER) {
|
||||
tippecanoe_maxzoom = max->number;
|
||||
}
|
||||
if (max != NULL && max->type == JSON_STRING) {
|
||||
tippecanoe_maxzoom = atoi(max->string);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned bbox[] = {UINT_MAX, UINT_MAX, 0, 0};
|
||||
|
@ -137,6 +137,29 @@ $ tippecanoe \-o alameda.mbtiles \-l alameda \-n "Alameda County from TIGER" \-z
|
||||
$ cat tiger/tl_2014_*_roads.json | tippecanoe \-o tiger.mbtiles \-l roads \-n "All TIGER roads, one zoom" \-z12 \-Z12 \-d14 \-x LINEARID \-x RTTYP
|
||||
.fi
|
||||
.RE
|
||||
.SH GeoJSON extension
|
||||
.PP
|
||||
Tippecanoe defines a GeoJSON extension that you can use to specify the minimum and/or maximum zoom level
|
||||
at which an individual feature will be included in the vector tile dataset being produced.
|
||||
If you have a feature like this:
|
||||
.PP
|
||||
.RS
|
||||
.nf
|
||||
{
|
||||
"type" : "Feature",
|
||||
"tippecanoe" : { "maxzoom" : 9, "minzoom" : 4 },
|
||||
"properties" : { "FULLNAME" : "N Vasco Rd", },
|
||||
"geometry" : {
|
||||
"type" : "LineString",
|
||||
"coordinates" : [ ... ]
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.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\&.
|
||||
.SH Point styling
|
||||
.PP
|
||||
To provide a consistent density gradient as you zoom, the Mapbox Studio style needs to be
|
||||
|
Loading…
x
Reference in New Issue
Block a user