mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-04 17:35:42 +02:00
Merge pull request #143 from mapbox/limit-simplify
Add an option to do line simplification only at zooms below maxzoom
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.6.3
|
||||||
|
|
||||||
|
* Add an option to do line simplification only at zooms below maxzoom
|
||||||
|
|
||||||
## 1.6.2
|
## 1.6.2
|
||||||
|
|
||||||
* Make sure line simplification matches on opposite sides of a tile boundary
|
* Make sure line simplification matches on opposite sides of a tile boundary
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ Options
|
|||||||
### Doing less
|
### Doing less
|
||||||
|
|
||||||
* -ps: Don't simplify lines
|
* -ps: Don't simplify lines
|
||||||
|
* -pS: Don't simplify lines at maxzoom (but do simplify at lower zooms)
|
||||||
* -pf: Don't limit tiles to 200,000 features
|
* -pf: Don't limit tiles to 200,000 features
|
||||||
* -pk: Don't limit tiles to 500K bytes
|
* -pk: Don't limit tiles to 500K bytes
|
||||||
* -pd: Dynamically drop some fraction of features from large tiles to keep them under the 500K size limit. It will probably look ugly at the tile boundaries.
|
* -pd: Dynamically drop some fraction of features from large tiles to keep them under the 500K size limit. It will probably look ugly at the tile boundaries.
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ If you use \-rg, it will guess a drop rate that will keep at most 50,000 feature
|
|||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\-ps: Don't simplify lines
|
\-ps: Don't simplify lines
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
|
\-pS: Don't simplify lines at maxzoom (but do simplify at lower zooms)
|
||||||
|
.IP \(bu 2
|
||||||
\-pf: Don't limit tiles to 200,000 features
|
\-pf: Don't limit tiles to 200,000 features
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\-pk: Don't limit tiles to 500K bytes
|
\-pk: Don't limit tiles to 500K bytes
|
||||||
|
|||||||
@@ -479,6 +479,7 @@ struct partial {
|
|||||||
int line_detail;
|
int line_detail;
|
||||||
char *prevent;
|
char *prevent;
|
||||||
char *additional;
|
char *additional;
|
||||||
|
int maxzoom;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct partial_arg {
|
struct partial_arg {
|
||||||
@@ -499,8 +500,9 @@ void *partial_feature_worker(void *v) {
|
|||||||
int line_detail = (*partials)[i].line_detail;
|
int line_detail = (*partials)[i].line_detail;
|
||||||
char *prevent = (*partials)[i].prevent;
|
char *prevent = (*partials)[i].prevent;
|
||||||
char *additional = (*partials)[i].additional;
|
char *additional = (*partials)[i].additional;
|
||||||
|
int maxzoom = (*partials)[i].maxzoom;
|
||||||
|
|
||||||
if ((t == VT_LINE || t == VT_POLYGON) && !prevent['s' & 0xFF]) {
|
if ((t == VT_LINE || t == VT_POLYGON) && !(prevent['s' & 0xFF] || (z == maxzoom && prevent['S' & 0xFF]))) {
|
||||||
if (1 /* !reduced */) { // XXX why did this not simplify if reduced?
|
if (1 /* !reduced */) { // XXX why did this not simplify if reduced?
|
||||||
if (t == VT_LINE) {
|
if (t == VT_LINE) {
|
||||||
geom = remove_noop(geom, t, 32 - z - line_detail);
|
geom = remove_noop(geom, t, 32 - z - line_detail);
|
||||||
@@ -806,6 +808,7 @@ long long write_tile(char **geoms, char *metabase, char *stringpool, int z, unsi
|
|||||||
p.line_detail = line_detail;
|
p.line_detail = line_detail;
|
||||||
p.prevent = prevent;
|
p.prevent = prevent;
|
||||||
p.additional = additional;
|
p.additional = additional;
|
||||||
|
p.maxzoom = maxzoom;
|
||||||
partials.push_back(p);
|
partials.push_back(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user