mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-29 03:41:18 +01:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4234d5b2c | ||
|
|
fa37859adb | ||
|
|
1cb467a382 | ||
|
|
3dddc7b2f1 | ||
|
|
dacff83386 | ||
|
|
a4f4b1f7c6 | ||
|
|
4266dc3de1 | ||
|
|
1ac6afa543 | ||
|
|
f8319ee5f1 | ||
|
|
f1c0bf50b1 | ||
|
|
e958f1adf9 | ||
|
|
64a5a684b0 | ||
|
|
fedebec55a | ||
|
|
f6332f302a |
@@ -1,16 +1,3 @@
|
||||
## 2.19.0
|
||||
|
||||
* Don't guess an excessively large maxzoom when there is only one feature
|
||||
* Set the base zoom for -Bg as part of the --smallest-maximum-zoom-guess logic
|
||||
|
||||
## 2.18.0
|
||||
|
||||
* Fix crash when using tile-join to join an empty pmtiles tileset
|
||||
|
||||
## 2.17.0
|
||||
|
||||
* Add pmtiles output format
|
||||
|
||||
## 2.16.0
|
||||
|
||||
* During tiling, limit the size of the statistics that are kept for -as-needed calculations, because they can get quite large for sources with hundreds of millions of features.
|
||||
|
||||
@@ -82,7 +82,7 @@ indent:
|
||||
TESTS = $(wildcard tests/*/out/*.json)
|
||||
SPACE = $(NULL) $(NULL)
|
||||
|
||||
test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS)) raw-tiles-test parallel-test pbf-test join-test enumerate-test decode-test join-filter-test unit json-tool-test allow-existing-test csv-test layer-json-test pmtiles-test decode-pmtiles-test
|
||||
test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS)) raw-tiles-test parallel-test pbf-test join-test enumerate-test decode-test join-filter-test unit json-tool-test allow-existing-test csv-test layer-json-test pmtiles-test
|
||||
./unit
|
||||
|
||||
suffixes = json json.gz
|
||||
@@ -329,29 +329,6 @@ join-test: tile-join
|
||||
./tippecanoe-decode -x generator tests/join-population/concat.mbtiles > tests/join-population/concat.mbtiles.json.check
|
||||
cmp tests/join-population/concat.mbtiles.json.check tests/join-population/concat.mbtiles.json
|
||||
rm tests/join-population/concat.mbtiles.json.check tests/join-population/concat.mbtiles tests/join-population/macarthur.mbtiles
|
||||
#`
|
||||
# Make sure empty tilesets work
|
||||
#
|
||||
# mbtiles:
|
||||
./tippecanoe -q -z0 -f -o tests/join-population/empty.mbtiles tests/join-population/empty.json
|
||||
./tile-join -f -o tests/join-population/empty.out.mbtiles tests/join-population/empty.mbtiles
|
||||
./tippecanoe-decode -x generator -x generator_options -x name -x description tests/join-population/empty.mbtiles > tests/join-population/empty.out.json.check
|
||||
cmp tests/join-population/empty.out.json.check tests/join-population/empty.out.json
|
||||
rm -f tests/join-population/empty.mbtiles tests/join-population/empty.out.mbtiles tests/join-population/empty.out.json.check
|
||||
# pmtiles:
|
||||
./tippecanoe -q -z0 -f -o tests/join-population/empty.pmtiles tests/join-population/empty.json
|
||||
./tile-join -f -o tests/join-population/empty.out.pmtiles tests/join-population/empty.pmtiles
|
||||
./tippecanoe-decode -x generator -x generator_options -x name -x description tests/join-population/empty.pmtiles > tests/join-population/empty.out.json.check
|
||||
cmp tests/join-population/empty.out.json.check tests/join-population/empty.out.json
|
||||
rm -f tests/join-population/empty.pmtiles tests/join-population/empty.out.pmtiles tests/join-population/empty.out.json.check
|
||||
# dirtiles:
|
||||
./tippecanoe -q -z0 -f -e tests/join-population/empty.dirtiles tests/join-population/empty.json
|
||||
./tile-join -f -e tests/join-population/empty.out.dirtiles tests/join-population/empty.dirtiles
|
||||
./tippecanoe-decode -x generator -x generator_options -x name -x description tests/join-population/empty.dirtiles > tests/join-population/empty.out.json.check
|
||||
cmp tests/join-population/empty.out.json.check tests/join-population/empty.out.json
|
||||
rm -rf tests/join-population/empty.dirtiles tests/join-population/empty.out.dirtiles tests/join-population/empty.out.json.check
|
||||
|
||||
|
||||
|
||||
join-filter-test:
|
||||
# Comes out different from the direct tippecanoe run because null attributes are lost
|
||||
@@ -396,14 +373,15 @@ allow-existing-test:
|
||||
./tippecanoe-decode -x generator -x generator_options tests/allow-existing/both.dir | sed 's/both\.dir/both.mbtiles/g' > tests/allow-existing/both.dir.json.check
|
||||
cmp tests/allow-existing/both.dir.json.check tests/allow-existing/both.mbtiles.json
|
||||
# Make a tileset
|
||||
./tippecanoe -q -Z0 -z0 -f -o tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
||||
./tippecanoe -q -Z0 -z0 -f -e tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
||||
# Writing to existing should fail
|
||||
if ./tippecanoe -q -Z1 -z1 -o tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json; then exit 1; else exit 0; fi
|
||||
if ./tippecanoe -q -Z1 -z1 -e tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json; then exit 1; else exit 0; fi
|
||||
# Replace existing
|
||||
./tippecanoe -q -Z8 -z9 -f -o tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
||||
# Allow-existing is not supported for pmtiles
|
||||
if ./tippecanoe -q -Z10 -z11 -F -o tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json; then exit 1; else exit 0; fi
|
||||
rm -r tests/allow-existing/both.pmtiles tests/allow-existing/both.dir.json.check tests/allow-existing/both.dir tests/allow-existing/both.mbtiles.json.check tests/allow-existing/both.mbtiles
|
||||
./tippecanoe -q -Z8 -z9 -f -e tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
||||
./tippecanoe -q -Z10 -z11 -F -e tests/allow-existing/both.pmtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
||||
./tippecanoe-decode -x generator -x generator_options tests/allow-existing/both.pmtiles | sed 's/both\.pmtiles/both.mbtiles/g' > tests/allow-existing/both.pmtiles.json.check
|
||||
cmp tests/allow-existing/both.pmtiles.json.check tests/allow-existing/both.mbtiles.json
|
||||
rm -r tests/allow-existing/both.pmtiles.json.check tests/allow-existing/both.pmtiles tests/allow-existing/both.dir.json.check tests/allow-existing/both.dir tests/allow-existing/both.mbtiles.json.check tests/allow-existing/both.mbtiles
|
||||
|
||||
csv-test:
|
||||
# Reading from named CSV
|
||||
|
||||
@@ -4,9 +4,12 @@ tippecanoe
|
||||
Builds [vector tilesets](https://github.com/mapbox/vector-tile-spec/) from large (or small) collections of [GeoJSON](http://geojson.org/), [FlatGeobuf](https://github.com/flatgeobuf/flatgeobuf), or [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) features,
|
||||
[like these](MADE_WITH.md).
|
||||
|
||||
This is the official home of Tippecanoe, developed and actively maintained by [Erica Fischer](https://github.com/e-n-f) at [Felt](https://felt.com).
|
||||
This intends to be an actively maintained fork of [tippecanoe](https://github.com/mapbox/tippecanoe) originally developed by [Erica Fischer](https://github.com/e-n-f) at Mapbox. Version 2.0.0 is equivalent to [1.36.0](https://github.com/mapbox/tippecanoe/tree/1.36.0) in the original repository. Thank you Mapbox and Erica for an incredible tool!
|
||||
|
||||
Key features of this fork include:
|
||||
|
||||
* Support for [FlatGeobuf](https://github.com/flatgeobuf/flatgeobuf) input which is more compact and 5-10x faster than GeoJsonSeq input.
|
||||
|
||||
Version 2.0.0 is equivalent to [1.36.0](https://github.com/mapbox/tippecanoe/tree/1.36.0) in the original repository. Thank you Mapbox for the many years of early support.
|
||||
|
||||
Intent
|
||||
------
|
||||
@@ -336,7 +339,7 @@ Parallel processing will also be automatic if the input file is in FlatGeobuf fo
|
||||
|
||||
* `-z` _zoom_ or `--maximum-zoom=`_zoom_: Maxzoom: the highest zoom level for which tiles are generated (default 14)
|
||||
* `-zg` or `--maximum-zoom=g`: Guess what is probably a reasonable maxzoom based on the spacing of features.
|
||||
* `--smallest-maximum-zoom-guess=`_zoom_: Guess what is probably a reasonable maxzoom based on the spacing of features, but using the specified _zoom_ if a lower maxzoom is guessed. If `-Bg` is also set, the base zoom will be set to the guessed maxzoom, with all the points carried forward into additional zooms through the one specified.
|
||||
* `--smallest-maximum-zoom-guess=`_zoom_: Guess what is probably a reasonable maxzoom based on the spacing of features, but using the specified _zoom_ if a lower maxzoom is guessed.
|
||||
* `-Z` _zoom_ or `--minimum-zoom=`_zoom_: Minzoom: the lowest zoom level for which tiles are generated (default 0)
|
||||
* `-ae` or `--extend-zooms-if-still-dropping`: Increase the maxzoom if features are still being dropped at that zoom level.
|
||||
The detail and simplification options that ordinarily apply only to the maximum zoom level will apply both to the originally
|
||||
|
||||
@@ -2095,12 +2095,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
exit(EXIT_NODATA);
|
||||
}
|
||||
|
||||
if (count == 0 && dist_count == 0) {
|
||||
maxzoom = minimum_maxzoom;
|
||||
if (droprate < 0) {
|
||||
droprate = 1;
|
||||
}
|
||||
} else if (count > 0) {
|
||||
if (count > 0) {
|
||||
double stddev = sqrt(m2 / count);
|
||||
|
||||
// Geometric mean is appropriate because distances between features
|
||||
@@ -2211,13 +2206,6 @@ 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);
|
||||
@@ -2234,7 +2222,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
|
||||
fix_dropping = true;
|
||||
|
||||
if (basezoom == -1) { // basezoom unspecified
|
||||
if (basezoom == -1) {
|
||||
basezoom = maxzoom;
|
||||
}
|
||||
}
|
||||
@@ -3446,7 +3434,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) { // basezoom unspecified
|
||||
if (basezoom == -1) {
|
||||
if (!guess_maxzoom) {
|
||||
basezoom = maxzoom;
|
||||
}
|
||||
@@ -3487,7 +3475,7 @@ int main(int argc, char **argv) {
|
||||
unlink(out_mbtiles);
|
||||
} else {
|
||||
if (pmtiles_has_suffix(out_mbtiles)) {
|
||||
check_pmtiles(out_mbtiles, argv, forcetable);
|
||||
check_pmtiles(out_mbtiles, argv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -25,16 +25,11 @@ bool pmtiles_has_suffix(const char *filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void check_pmtiles(const char *filename, char **argv, bool forcetable) {
|
||||
void check_pmtiles(const char *filename, char **argv) {
|
||||
struct stat st;
|
||||
if (stat(filename, &st) == 0) {
|
||||
fprintf(stderr, "%s: Tileset \"%s\" already exists. You can use --force if you want to delete the old tileset.\n", argv[0], filename);
|
||||
fprintf(stderr, "%s: %s: file exists\n", argv[0], filename);
|
||||
|
||||
if (forcetable) {
|
||||
fprintf(stderr, "%s: --allow-existing is not supported for pmtiles\n", argv[0]);
|
||||
}
|
||||
|
||||
exit(EXIT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include "mbtiles.hpp"
|
||||
|
||||
bool pmtiles_has_suffix(const char *filename);
|
||||
void check_pmtiles(const char *filename, char **argv, bool forcetable);
|
||||
void check_pmtiles(const char *filename, char **argv);
|
||||
|
||||
void mbtiles_map_image_to_pmtiles(char *dbname, metadata m, bool tile_compression, bool quiet, bool quiet_progress);
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
{ "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 417.4513514, -299.1709459 ], [ 415.1435811, -288.1915541 ], [ 421.1577703, -286.2334459 ], [ 431.5077703, -317.4932432 ], [ 471.2293919, -312.2483108 ] ] ] } }
|
||||
{ "type": "Feature", "properties": { "id": 2 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 423.6753378, -364.5577703 ], [ 426.3327703, -334.0672297 ], [ 512.3496622, -321.7591216 ], [ 510.2516892, -347.4942568 ] ] ] } }
|
||||
@@ -1,11 +0,0 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "-180.000000,-85.051129,180.000000,-85.051129",
|
||||
"center": "0.000000,-85.051129,0",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"empty\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"id\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"empty\",\"count\":2,\"geometry\":\"LineString\",\"attributeCount\":1,\"attributes\":[{\"attribute\":\"id\",\"count\":2,\"type\":\"number\",\"values\":[1,2],\"min\":1,\"max\":2}]}]}}",
|
||||
"maxzoom": "0",
|
||||
"minzoom": "0",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
] }
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-122,37]}}
|
||||
@@ -1,37 +0,0 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"bounds": "-122.000000,37.000000,-122.000000,37.000000",
|
||||
"center": "-122.000000,37.000000,3",
|
||||
"description": "tests/onefeature-point/out/--smallest-maximum-zoom-guess_3.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"generator_options": "./tippecanoe -q -a@ -f -o tests/onefeature-point/out/--smallest-maximum-zoom-guess_3.json.check.mbtiles --smallest-maximum-zoom-guess 3 tests/onefeature-point/in.json",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":3,\"fields\":{}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":1,\"geometry\":\"Point\",\"attributeCount\":0,\"attributes\":[]}]}}",
|
||||
"maxzoom": "3",
|
||||
"minzoom": "0",
|
||||
"name": "tests/onefeature-point/out/--smallest-maximum-zoom-guess_3.json.check.mbtiles",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -122.080078, 37.020098 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "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": [ -122.036133, 37.020098 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 0, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -122.014160, 37.002553 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 1, "y": 3 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -122.003174, 37.002553 ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
+3
-4
@@ -456,10 +456,9 @@ struct reader *begin_reading(char *fname) {
|
||||
r->x = r->pmtiles_entries.back().x;
|
||||
r->y = r->pmtiles_entries.back().y;
|
||||
r->sorty = (1LL << r->zoom) - 1 - r->y;
|
||||
|
||||
r->data = std::string(r->pmtiles_map + r->pmtiles_entries.back().offset, r->pmtiles_entries.back().length);
|
||||
r->pmtiles_entries.pop_back();
|
||||
}
|
||||
r->data = std::string(r->pmtiles_map + r->pmtiles_entries.back().offset, r->pmtiles_entries.back().length);
|
||||
r->pmtiles_entries.pop_back();
|
||||
} else {
|
||||
sqlite3 *db;
|
||||
|
||||
@@ -1191,7 +1190,7 @@ int main(int argc, char **argv) {
|
||||
unlink(out_mbtiles);
|
||||
} else {
|
||||
if (pmtiles_has_suffix(out_mbtiles)) {
|
||||
check_pmtiles(out_mbtiles, argv, false);
|
||||
check_pmtiles(out_mbtiles, argv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_HPP
|
||||
#define VERSION_HPP
|
||||
|
||||
#define VERSION "v2.19.0"
|
||||
#define VERSION "v2.16.0"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user