mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Set base zoom if requested as part of maxzoom guessing (#63)
* Set base zoom if requested as part of maxzoom guessing * Add a test for guessing the maxzoom of a single point * Don't guess an excessively large maxzoom when there is only one feature * Update changelog
This commit is contained in:
@@ -2095,7 +2095,12 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
exit(EXIT_NODATA);
|
||||
}
|
||||
|
||||
if (count > 0) {
|
||||
if (count == 0 && dist_count == 0) {
|
||||
maxzoom = minimum_maxzoom;
|
||||
if (droprate < 0) {
|
||||
droprate = 1;
|
||||
}
|
||||
} else if (count > 0) {
|
||||
double stddev = sqrt(m2 / count);
|
||||
|
||||
// Geometric mean is appropriate because distances between features
|
||||
@@ -2206,6 +2211,13 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
}
|
||||
}
|
||||
|
||||
if (basezoom == -2 && basezoom_marker_width == 1) { // -Bg, not -Bg###
|
||||
basezoom = maxzoom;
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Using base zoom of -z%d\n", basezoom);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxzoom < minimum_maxzoom) {
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "Using minimum maxzoom of -z%d\n", minimum_maxzoom);
|
||||
@@ -2222,7 +2234,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
|
||||
fix_dropping = true;
|
||||
|
||||
if (basezoom == -1) {
|
||||
if (basezoom == -1) { // basezoom unspecified
|
||||
basezoom = maxzoom;
|
||||
}
|
||||
}
|
||||
@@ -3434,7 +3446,7 @@ int main(int argc, char **argv) {
|
||||
fprintf(stderr, "%s: Reducing minimum detail to match low detail %d\n", argv[0], min_detail);
|
||||
}
|
||||
|
||||
if (basezoom == -1) {
|
||||
if (basezoom == -1) { // basezoom unspecified
|
||||
if (!guess_maxzoom) {
|
||||
basezoom = maxzoom;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user