Compare commits

..
Author SHA1 Message Date
Claude 231c62c25a Pin pointer alignment, check make indent in CI, and reformat
`DerivePointerAlignment` (inherited from the Google base style) made the
placement of `*` and `&` depend on whichever way the surrounding file
already leaned, so reformatting could silently move them. Set
`PointerAlignment: Right` and turn derivation off so the rule is the same
everywhere.

Add an `indent` CI job in the same shape as the `docs` one: reformat, then
fail on any diff. It pins clang-format 18.1.8, since different versions
format the same input differently and would otherwise fail the check
spuriously.

Reformat the sources so the new job passes. Most of the diff is drift that
accumulated while nothing was checking: trailing whitespace, spaces where
tabs belong, hand-aligned continuation lines, and casts missing the space
that `SpaceAfterCStyleCast` asks for.

Also drop the exclusion of flatgeobuf.cpp, which was the one hand-written
source the formatter never saw, and reformat it too. Only whitespace,
brace placement, and single-statement `if` bodies change; the code itself
is untouched.
2026-08-07 19:20:45 +00:00
33 changed files with 147 additions and 1509 deletions
+19 -11
View File
@@ -11,8 +11,6 @@ jobs:
version: ['Release', 'Debug']
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get install libsqlite3-dev
@@ -22,15 +20,6 @@ jobs:
- run: uname -a; BUILDTYPE=${{ matrix.version }} make
- run: make test
test-without-mlt:
runs-on: ubuntu-latest
steps:
# No submodules: the MLT=0 build must not need them
- uses: actions/checkout@v3
- run: sudo apt-get install libsqlite3-dev
- run: uname -a; make MLT=0
- run: make MLT=0 test
docs:
runs-on: ubuntu-latest
steps:
@@ -47,3 +36,22 @@ jobs:
echo "::error::man/tippecanoe.1 is out of date. Run 'make docs' and commit the result."
exit 1
}
indent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Pinned, because different clang-format versions format the same input
# differently, which would make this check fail spuriously.
- name: Install clang-format
run: |
python3 -m venv /tmp/clang-format
/tmp/clang-format/bin/pip install clang-format==18.1.8
- name: Reformat the sources
run: PATH="/tmp/clang-format/bin:$PATH" make indent
- name: Check that the sources are correctly formatted
run: |
git diff --exit-code || {
echo "::error::Sources are not correctly formatted. Run 'make indent' and commit the result."
exit 1
}
-8
View File
@@ -45,14 +45,6 @@ man/tippecanoe.1.tmp
tests/**/*.mbtiles
tests/**/*.check
tests/**/*.geobuf
tests/mlt/dir-out/
tests/mlt/roundtrip-dir/
tests/mlt/overzoom.pbf
tests/mlt/join-out-dir/
tests/mlt/mvt-source-dir/
tests/mlt/overzoom-out.mlt
mlt-build/
# Vim
*.swp
-3
View File
@@ -1,3 +0,0 @@
[submodule "maplibre-tile-spec"]
path = maplibre-tile-spec
url = https://github.com/maplibre/maplibre-tile-spec.git
+14 -112
View File
@@ -4,36 +4,12 @@ BUILDTYPE ?= Release
BUILD_INFO ?=
SHELL = /bin/sh
# MapLibre Tile support requires the maplibre-tile-spec submodule and cmake
# to build it. Use `make MLT=0` for a build with no dependencies beyond the
# ones that Mapbox Vector Tiles need; it can neither read nor write MLT.
MLT ?= 1
MLT_BUILD_STAMP = mlt-build/.built
ifeq ($(MLT),0)
MLT_FLAGS = -DNO_MLT
MLT_INCLUDES =
MLT_STD =
MLT_DEPS =
MLT_DECODE_LIBS =
MLT_LIBS =
MLT_TESTS =
else
MLT_FLAGS =
MLT_INCLUDES = -isystem maplibre-tile-spec/cpp/include -isystem maplibre-tile-spec/cpp/vendor/fsst
MLT_STD = -std=c++20
MLT_DEPS = $(MLT_BUILD_STAMP)
MLT_DECODE_LIBS = mlt-build/libmlt-cpp.a mlt-build/libfsst-lib.a mlt-build/libfastpfor-lib.a
MLT_LIBS = mlt-build/libmlt-cpp-encoder.a $(MLT_DECODE_LIBS)
MLT_TESTS = mlt-test mlt-decode-test mlt-output-test
endif
# inherit from env if set
CC := $(CC)
CXX := $(CXX)
CFLAGS := $(CFLAGS) -fPIE -DBUILD_INFO=$(BUILD_INFO)
CXXFLAGS := $(CXXFLAGS) -std=c++17 -fPIE -DBUILD_INFO=$(BUILD_INFO) $(MLT_FLAGS)
CXXFLAGS := $(CXXFLAGS) -std=c++17 -fPIE -DBUILD_INFO=$(BUILD_INFO)
LDFLAGS := $(LDFLAGS)
WARNING_FLAGS := -Wall -Wshadow -Wsign-compare -Wextra -Wunreachable-code -Wuninitialized -Wshadow -Wvla
RELEASE_FLAGS := -O3 -DNDEBUG
@@ -119,40 +95,25 @@ C = $(wildcard *.c) $(wildcard *.cpp)
INCLUDES = -I/usr/local/include -I. -Iclipper2/include
LIBS = -L/usr/local/lib
$(MLT_BUILD_STAMP): maplibre-tile-spec/cpp/CMakeLists.txt
cmake -S maplibre-tile-spec/cpp -B mlt-build \
-DCMAKE_BUILD_TYPE=$(BUILDTYPE) \
-DMLT_WITH_JSON=OFF \
-DMLT_WITH_TESTS=OFF \
-DMLT_WITH_TOOLS=OFF \
-DCMAKE_CXX_STANDARD=20 \
$(if $(VERBOSE),,--log-level=WARNING) > /dev/null
cmake --build mlt-build --target mlt-cpp mlt-cpp-encoder $(if $(VERBOSE),,-- -s) > /dev/null
touch $@
ifneq ($(MLT),0)
$(MLT_LIBS): $(MLT_BUILD_STAMP)
endif
tippecanoe: geojson.o jsonpull/jsonpull.o tile.o pool.o mbtiles.o geometry.o projection.o memfile.o mvt.o mlt.o mlt_decode.o serial.o main.o platform.o text.o dirtiles.o pmtiles_file.o plugin.o read_json.o write_json.o geobuf.o flatgeobuf.o evaluator.o geocsv.o csv.o geojson-loop.o json_logger.o visvalingam.o compression.o clip.o sort.o attribute.o thread.o shared_borders.o usage.o clipper2/src/clipper.engine.o $(MLT_LIBS)
tippecanoe: geojson.o jsonpull/jsonpull.o tile.o pool.o mbtiles.o geometry.o projection.o memfile.o mvt.o serial.o main.o platform.o text.o dirtiles.o pmtiles_file.o plugin.o read_json.o write_json.o geobuf.o flatgeobuf.o evaluator.o geocsv.o csv.o geojson-loop.o json_logger.o visvalingam.o compression.o clip.o sort.o attribute.o thread.o shared_borders.o usage.o clipper2/src/clipper.engine.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
tippecanoe-enumerate: enumerate.o usage.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lsqlite3
tippecanoe-decode: decode.o projection.o mvt.o mlt_decode.o write_json.o text.o jsonpull/jsonpull.o dirtiles.o pmtiles_file.o usage.o $(MLT_DECODE_LIBS)
tippecanoe-decode: decode.o projection.o mvt.o write_json.o text.o jsonpull/jsonpull.o dirtiles.o pmtiles_file.o usage.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
tile-join: tile-join.o platform.o projection.o mbtiles.o mvt.o mlt.o mlt_decode.o memfile.o dirtiles.o jsonpull/jsonpull.o text.o evaluator.o csv.o write_json.o pmtiles_file.o clip.o attribute.o thread.o read_json.o usage.o clipper2/src/clipper.engine.o $(MLT_LIBS)
tile-join: tile-join.o platform.o projection.o mbtiles.o mvt.o memfile.o dirtiles.o jsonpull/jsonpull.o text.o evaluator.o csv.o write_json.o pmtiles_file.o clip.o attribute.o thread.o read_json.o usage.o clipper2/src/clipper.engine.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
tippecanoe-json-tool: jsontool.o jsonpull/jsonpull.o csv.o text.o geojson-loop.o usage.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
unit: unit.o text.o sort.o mvt.o mlt.o mlt_decode.o projection.o clip.o attribute.o jsonpull/jsonpull.o evaluator.o read_json.o clipper2/src/clipper.engine.o $(MLT_LIBS)
unit: unit.o text.o sort.o mvt.o projection.o clip.o attribute.o jsonpull/jsonpull.o evaluator.o read_json.o clipper2/src/clipper.engine.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
tippecanoe-overzoom: overzoom.o mvt.o mlt.o mlt_decode.o clip.o evaluator.o jsonpull/jsonpull.o text.o attribute.o read_json.o projection.o read_json.o usage.o clipper2/src/clipper.engine.o $(MLT_LIBS)
tippecanoe-overzoom: overzoom.o mvt.o clip.o evaluator.o jsonpull/jsonpull.o text.o attribute.o read_json.o projection.o read_json.o usage.o clipper2/src/clipper.engine.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
-include $(wildcard *.d)
@@ -160,22 +121,24 @@ tippecanoe-overzoom: overzoom.o mvt.o mlt.o mlt_decode.o clip.o evaluator.o json
%.o: %.c
$(CC) -MMD $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CFLAGS) -c -o $@ $<
mlt.o mlt_decode.o: %.o: %.cpp $(MLT_DEPS)
$(CXX) -MMD $(PG) $(INCLUDES) $(MLT_INCLUDES) $(FINAL_FLAGS) $(CXXFLAGS) $(MLT_STD) -c -o $@ $<
%.o: %.cpp
$(CXX) -MMD $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CXXFLAGS) -c -o $@ $<
clean:
rm -rf ./tippecanoe ./tippecanoe-* ./tile-join ./unit *.o *.d */*.o */*.d tests/**/*.mbtiles tests/**/*.check mlt-build
rm -f ./tippecanoe ./tippecanoe-* ./tile-join ./unit *.o *.d */*.o */*.d tests/**/*.mbtiles tests/**/*.check
# CI checks that the committed sources match what this produces, so run it before
# sending a pull request. Different clang-format versions format the same input
# differently, so the CI job pins one (see .github/workflows/test.yml); if your
# local version disagrees with it, let the job tell you what to fix rather than
# committing its idea of the formatting.
indent:
clang-format -i -style="{BasedOnStyle: Google, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, ColumnLimit: 0, ContinuationIndentWidth: 8, SpaceAfterCStyleCast: true, IndentCaseLabels: false, AllowShortBlocksOnASingleLine: false, AllowShortFunctionsOnASingleLine: false, SortIncludes: false}" $(filter-out flatgeobuf.cpp,$(C)) $(H) jsonpull/*.[ch]
clang-format -i -style="{BasedOnStyle: Google, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, ColumnLimit: 0, ContinuationIndentWidth: 8, SpaceAfterCStyleCast: true, IndentCaseLabels: false, AllowShortBlocksOnASingleLine: false, AllowShortFunctionsOnASingleLine: false, SortIncludes: false, PointerAlignment: Right, DerivePointerAlignment: false}" $(C) $(H) jsonpull/*.[ch]
TESTS = $(wildcard tests/*/out/*.json)
SPACE = $(NULL) $(NULL)
test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS)) raw-tiles-test parallel-test radix-sort-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 overzoom-test flatgeobuf-test $(MLT_TESTS)
test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS)) raw-tiles-test parallel-test radix-sort-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 overzoom-test flatgeobuf-test
./unit
suffixes = json json.gz
@@ -704,67 +667,6 @@ layer-json-test: tippecanoe tippecanoe-decode
cmp tests/layer-json/out.mbtiles.json.check tests/layer-json/out.mbtiles.json
rm -f tests/layer-json/out.mbtiles.json.check tests/layer-json/out.mbtiles
mlt-test: tippecanoe
./tippecanoe -q --output-format=mlt -z5 -f -o tests/mlt/points.mbtiles tests/mlt/points.geojson
./tippecanoe -q -z5 -f -o tests/mlt/points-mvt.mbtiles tests/mlt/points.geojson
@test $$(sqlite3 tests/mlt/points.mbtiles "SELECT COUNT(*) FROM tiles") -eq $$(sqlite3 tests/mlt/points-mvt.mbtiles "SELECT COUNT(*) FROM tiles") || (echo "FAIL: MLT and MVT tile counts differ" && exit 1)
@test "$$(sqlite3 tests/mlt/points.mbtiles "SELECT value FROM metadata WHERE name='format'")" = "mlt" || (echo "FAIL: format metadata is not 'mlt'" && exit 1)
@sqlite3 tests/mlt/points.mbtiles "SELECT hex(substr(tile_data, 1, 2)) FROM tiles LIMIT 1" | grep -q "1F8B" || (echo "FAIL: MLT tiles not gzip compressed" && exit 1)
rm -rf tests/mlt/dir-out
./tippecanoe -q --output-format=mlt -z2 -f -e tests/mlt/dir-out tests/mlt/points.geojson
@test $$(find tests/mlt/dir-out -name '*.mlt' | wc -l) -gt 0 || (echo "FAIL: No .mlt files in directory output" && exit 1)
@test $$(find tests/mlt/dir-out -name '*.pbf' | wc -l) -eq 0 || (echo "FAIL: .pbf files in MLT directory output" && exit 1)
./tippecanoe -q --output-format=mlt --pretessellate -z5 -f -o tests/mlt/points-tess.mbtiles tests/mlt/points.geojson
@test $$(sqlite3 tests/mlt/points-tess.mbtiles "SELECT COUNT(*) FROM tiles") -gt 0 || (echo "FAIL: No tiles with pretessellate" && exit 1)
rm -f tests/mlt/points.mbtiles tests/mlt/points-mvt.mbtiles tests/mlt/points-tess.mbtiles
rm -rf tests/mlt/dir-out
mlt-decode-test: tippecanoe tippecanoe-decode tile-join tippecanoe-overzoom
# tippecanoe-decode reads MLT tiles out of an mbtiles file
./tippecanoe -q --output-format=mlt -z5 -f -o tests/mlt/roundtrip.mbtiles tests/mlt/roundtrip.geojson
./tippecanoe-decode -x generator -x generator_options tests/mlt/roundtrip.mbtiles > tests/mlt/roundtrip.mbtiles.json.check
cmp tests/mlt/roundtrip.mbtiles.json.check tests/mlt/roundtrip.mbtiles.json
# tile-join reads MLT tiles and writes MVT tiles
./tile-join -f -o tests/mlt/joined.mbtiles tests/mlt/roundtrip.mbtiles
./tippecanoe-decode -x generator -x generator_options tests/mlt/joined.mbtiles > tests/mlt/joined.mbtiles.json.check
cmp tests/mlt/joined.mbtiles.json.check tests/mlt/joined.mbtiles.json
# tippecanoe-decode reads MLT tiles out of a tile directory
rm -rf tests/mlt/roundtrip-dir
./tippecanoe -q --output-format=mlt -z5 -f -e tests/mlt/roundtrip-dir tests/mlt/roundtrip.geojson
./tippecanoe-decode -x generator -x generator_options tests/mlt/roundtrip-dir > tests/mlt/roundtrip-dir.json.check
cmp tests/mlt/roundtrip-dir.json.check tests/mlt/roundtrip-dir.json
# tippecanoe-overzoom reads a single MLT tile
./tippecanoe-overzoom -o tests/mlt/overzoom.pbf tests/mlt/roundtrip-dir/2/0/1.mlt 2/0/1 4/2/6
./tippecanoe-decode tests/mlt/overzoom.pbf 4 2 6 > tests/mlt/overzoom.json.check
cmp tests/mlt/overzoom.json.check tests/mlt/overzoom.json
rm -f tests/mlt/roundtrip.mbtiles tests/mlt/roundtrip.mbtiles.json.check
rm -f tests/mlt/joined.mbtiles tests/mlt/joined.mbtiles.json.check
rm -f tests/mlt/roundtrip-dir.json.check tests/mlt/overzoom.pbf tests/mlt/overzoom.json.check
rm -rf tests/mlt/roundtrip-dir
mlt-output-test: tippecanoe tippecanoe-decode tile-join tippecanoe-overzoom
./tippecanoe -q -z5 -f -o tests/mlt/mvt-source.mbtiles tests/mlt/roundtrip.geojson
# tile-join writes MLT tiles to an mbtiles file, whatever the sources are encoded in
./tile-join -f --output-format=mlt -o tests/mlt/join-out.mbtiles tests/mlt/mvt-source.mbtiles
./tippecanoe-decode -x generator -x generator_options tests/mlt/join-out.mbtiles > tests/mlt/join-out.mbtiles.json.check
cmp tests/mlt/join-out.mbtiles.json.check tests/mlt/join-out.mbtiles.json
# tile-join writes MLT tiles to a tile directory
rm -rf tests/mlt/join-out-dir
./tile-join -f --output-format=mlt -e tests/mlt/join-out-dir tests/mlt/mvt-source.mbtiles
@test $$(find tests/mlt/join-out-dir -name '*.mlt' | wc -l) -gt 0 || (echo "FAIL: No .mlt files in tile-join directory output" && exit 1)
@test $$(find tests/mlt/join-out-dir -name '*.pbf' | wc -l) -eq 0 || (echo "FAIL: .pbf files in tile-join MLT directory output" && exit 1)
# tippecanoe-overzoom writes MLT tiles
rm -rf tests/mlt/mvt-source-dir
./tippecanoe -q -z5 -f -e tests/mlt/mvt-source-dir tests/mlt/roundtrip.geojson
# The same features come out whichever direction the formats are converted in,
# so this is compared against the standard for overzooming an MLT tile to MVT
./tippecanoe-overzoom --output-format=mlt -o tests/mlt/overzoom-out.mlt tests/mlt/mvt-source-dir/2/0/1.pbf 2/0/1 4/2/6
./tippecanoe-decode tests/mlt/overzoom-out.mlt 4 2 6 > tests/mlt/overzoom-out.json.check
cmp tests/mlt/overzoom-out.json.check tests/mlt/overzoom.json
rm -f tests/mlt/mvt-source.mbtiles tests/mlt/join-out.mbtiles tests/mlt/join-out.mbtiles.json.check
rm -f tests/mlt/overzoom-out.mlt tests/mlt/overzoom-out.json.check
rm -rf tests/mlt/join-out-dir tests/mlt/mvt-source-dir
# Use this target to regenerate the standards that the tests are compared against
# after making a change that legitimately changes their output
+4 -31
View File
@@ -44,18 +44,12 @@ $ brew install tippecanoe
On Ubuntu it will usually be easiest to build from the source repository:
```sh
$ git clone --recurse-submodules https://github.com/felt/tippecanoe.git
$ git clone https://github.com/felt/tippecanoe.git
$ cd tippecanoe
$ make -j
$ make install
```
The submodule is the [MapLibre Tile](https://github.com/maplibre/maplibre-tile-spec)
implementation, which is built with `cmake`. If you don't need MapLibre Tile support,
build with `make MLT=0` instead, which needs neither the submodule nor `cmake`. Such a
build can't read or write MLT, and rejects `--output-format=mlt`, but is otherwise the same.
Run `make clean` first if you are switching an existing build directory between the two.
See [Development](#development) below for how to upgrade your
C++ compiler or install prerequisite packages if you get
compiler errors.
@@ -566,10 +560,7 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
* `--limit-tile-feature-count-at-maximum-zoom=`_features_: Abruptly limit each tile at the maximum zoom level to the specified number of _features_, after ordering them if specified.
* `-pf` or `--no-feature-limit`: Don't limit tiles to 200,000 features
* `-pk` or `--no-tile-size-limit`: Don't limit tiles to 500K bytes
* `-pC` or `--no-tile-compression`: Don't compress the vector tile data. If you are getting "Unimplemented type 3" error messages from a renderer, it is probably because it expects uncompressed tiles using this option rather than the normal gzip-compressed tiles.
* `--output-format=`*format*: Set the tile encoding format. Supported values: `mvt` (default, Mapbox Vector Tiles) or `mlt` ([MapLibre Tiles](https://github.com/maplibre/maplibre-tile-spec)). MLT tilesets can be read back by `tippecanoe-decode`, `tile-join`, and `tippecanoe-overzoom`. Because MLT attribute columns have a single type for the whole layer, while MVT attribute values are individually typed, an attribute whose values are a mix of numbers and strings (or of booleans and numbers) is encoded as strings.
* `--pretessellate`: When using `--output-format=mlt`, pre-triangulate polygon geometries. Only applies to layers where all features are polygons.
* `--no-mlt-feature-sort`: When using `--output-format=mlt`, disable within-tile spatial sorting of features by Hilbert curve index. Sorting is on by default.
* `-pC` or `--no-tile-compression`: Don't compress the PBF vector tile data. If you are getting "Unimplemented type 3" error messages from a renderer, it is probably because it expects uncompressed tiles using this option rather than the normal gzip-compressed tiles.
* `-pg` or `--no-tile-stats`: Don't generate the `tilestats` row in the tileset metadata. Uploads without [tilestats](https://github.com/mapbox/mapbox-geostats) will take longer to process.
* `--tile-stats-attributes-limit=`*count*: Include `tilestats` information about at most *count* attributes instead of the default 1000.
* `--tile-stats-sample-values-limit=`*count*: Calculate `tilestats` attribute statistics based on *count* values instead of the default 1000.
@@ -803,10 +794,6 @@ all the sources are read and their combined contents are written to the new
mbtiles output. If they define the same layers or the same tiles, the layers
or tiles are merged.
Sources may contain either Mapbox Vector Tiles or MapLibre Tiles, in any combination,
since the encoding is detected from the tile data. The output is written as Mapbox
Vector Tiles unless `--output-format=mlt` is specified.
The options are:
### Output tileset
@@ -860,10 +847,7 @@ The options are:
### Setting or disabling tile size limits
* `-pk` or `--no-tile-size-limit`: Don't skip tiles larger than 500K.
* `-pC` or `--no-tile-compression`: Don't compress the vector tile data.
* `--output-format=`*format*: Set the tile encoding format. Supported values: `mvt` (default, Mapbox Vector Tiles) or `mlt` ([MapLibre Tiles](https://github.com/maplibre/maplibre-tile-spec)). Applies regardless of what the sources are encoded in.
* `--pretessellate`: When using `--output-format=mlt`, pre-triangulate polygon geometries. Only applies to layers where all features are polygons.
* `--no-mlt-feature-sort`: When using `--output-format=mlt`, disable within-tile spatial sorting of features by Hilbert curve index. Sorting is on by default.
* `-pC` or `--no-tile-compression`: Don't compress the PBF vector tile data.
* `-pg` or `--no-tile-stats`: Don't generate the `tilestats` row in the tileset metadata. Uploads without [tilestats](https://github.com/mapbox/mapbox-geostats) will take longer to process.
* `--tile-stats-attributes-limit=`*count*: Include `tilestats` information about at most *count* attributes instead of the default 1000.
* `--tile-stats-sample-values-limit=`*count*: Calculate `tilestats` attribute statistics based on *count* values instead of the default 1000.
@@ -949,10 +933,6 @@ or on an individual tile:
tippecanoe-decode file.mbtiles zoom x y
tippecanoe-decode file.vector.pbf zoom x y
Tiles can be either Mapbox Vector Tiles or MapLibre Tiles; the encoding is detected
from the tile data, so no option is needed to decode a tileset that was written with
`--output-format=mlt`.
Unless you use `-c`, the output is a set of nested FeatureCollections identifying each
tile and layer separately. Note that the same features generally appear at all zooms,
so the output for the file will have many copies of the same features at different
@@ -1055,10 +1035,6 @@ reads tile `inz/inx/iny` of `in.mvt.gz` and produces tile `outz/outx/outy` of `o
reads tile `inz/inx/iny` of `in.mvt.gz`, tile `in2z/in2x/in2y` of `in2.mvt.gz`, and tile `in3z/in3x/in3y` of `in3.mvt.gz`,
and produces tile `outz/outx/outy` of `out.mvt.gz` from them.
The input tiles may be either Mapbox Vector Tiles or MapLibre Tiles, since the encoding
is detected from the tile data. The output tile is a Mapbox Vector Tile unless
`--output-format=mlt` is specified.
### Options
* `-o` *file* or `--output=`*file*: Write the output tile to the named *file*.
@@ -1076,7 +1052,4 @@ is detected from the tile data. The output tile is a Mapbox Vector Tile unless
* `--deduplicate-by-id`: When several input tiles are combined, include only the first feature with any given feature ID within each layer, so that features that appear in more than one input tile are not duplicated in the output.
* `--preserve-input-order`: Restore a set of filtered features to its original input order
* `-E` *attribute*`:`*operation* or `--accumulate-attribute=`*attribute*`:`*operation*: Behaves as in `tippecanoe` to sum attributes from the features of a multiplier cluster that are not included in the final output. The attributes from features that are filtered away with `-j` are *not* accumulated onto the output feature.
* `--no-tile-compression`: Don't compress the vector tile data in the output tile.
* `--output-format=`*format*: Set the tile encoding format. Supported values: `mvt` (default, Mapbox Vector Tiles) or `mlt` ([MapLibre Tiles](https://github.com/maplibre/maplibre-tile-spec)). Applies regardless of what the input tiles are encoded in.
* `--pretessellate`: When using `--output-format=mlt`, pre-triangulate polygon geometries. Only applies to layers where all features are polygons.
* `--no-mlt-feature-sort`: When using `--output-format=mlt`, disable within-tile spatial sorting of features by Hilbert curve index. Sorting is on by default.
* `--no-tile-compression`: Don't compress the PBF vector tile data in the output tile.
+4 -7
View File
@@ -10,7 +10,6 @@
#include "errors.hpp"
#include "compression.hpp"
#include "mvt.hpp"
#include "mlt.hpp"
#include "evaluator.hpp"
#include "serial.hpp"
#include "attribute.hpp"
@@ -1229,8 +1228,7 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
std::vector<mvt_layer> const &unused2, std::string const &unused3,
std::string const &unused, size_t feature_limit,
std::vector<clipbbox> const &unused4,
bool deduplicate_by_id,
int tile_format) {
bool deduplicate_by_id) {
std::vector<source_tile> decoded;
for (auto const &t : tiles) {
@@ -1256,7 +1254,7 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
decoded.push_back(out);
}
return overzoom(decoded, nz, nx, ny, detail_or_unspecified, buffer, keep, exclude, exclude_prefix, do_compress, next_overzoomed_tiles, demultiply, filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, unused2, unused3, unused, feature_limit, unused4, deduplicate_by_id, tile_format);
return overzoom(decoded, nz, nx, ny, detail_or_unspecified, buffer, keep, exclude, exclude_prefix, do_compress, next_overzoomed_tiles, demultiply, filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, unused2, unused3, unused, feature_limit, unused4, deduplicate_by_id);
}
// like a minimal serial_feature, but with mvt_feature-style attributes
@@ -1466,8 +1464,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
std::vector<mvt_layer> const &unused2, std::string const &unused3,
std::string const &unused, size_t feature_limit,
std::vector<clipbbox> const &unused4,
bool deduplicate_by_id,
int tile_format) {
bool deduplicate_by_id) {
mvt_tile outtile;
key_pool key_pool;
@@ -1740,7 +1737,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
}
if (outtile.layers.size() > 0) {
std::string pbf = encode_tile(outtile, tile_format);
std::string pbf = outtile.encode();
std::string compressed;
if (do_compress) {
+9 -14
View File
@@ -25,7 +25,7 @@ std::string dir_read_tile(std::string base, struct zxy tile) {
return (contents.str());
}
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf, const char *ext) {
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf) {
// Don't check mkdir error returns, since most of these calls to
// mkdir will be creating directories that already exist.
mkdir(outdir, S_IRWXU | S_IRWXG | S_IRWXO);
@@ -39,7 +39,7 @@ void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const
newdir = newdir + "/" + std::to_string(tx);
mkdir(newdir.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
newdir = newdir + "/" + std::to_string(ty) + ext;
newdir = newdir + "/" + std::to_string(ty) + ".pbf";
struct stat st;
if (stat(newdir.c_str(), &st) == 0) {
@@ -76,18 +76,12 @@ static bool numeric(const char *s) {
return true;
}
// If this is the name of a tile within a tile directory, returns the
// extension that it uses, or NULL if it isn't a tile at all.
static const char *tile_extension(const char *s) {
static bool pbfname(const char *s) {
while (*s >= '0' && *s <= '9') {
s++;
}
if (strcmp(s, ".pbf") == 0 || strcmp(s, ".mvt") == 0 || strcmp(s, ".mlt") == 0) {
return s;
}
return NULL;
return strcmp(s, ".pbf") == 0 || strcmp(s, ".mvt") == 0;
}
void check_dir(const char *dir, char **argv, bool force, bool forcetable) {
@@ -160,11 +154,12 @@ std::vector<zxy> enumerate_dirtiles(const char *fname, int minzoom, int maxzoom)
struct dirent *dp3;
while ((dp3 = readdir(d3)) != NULL) {
const char *ext = tile_extension(dp3->d_name);
if (ext != NULL) {
if (pbfname(dp3->d_name)) {
int ty = atoi(dp3->d_name);
zxy tile(tz, tx, ty);
tile.extension = ext;
if (strstr(dp3->d_name, ".mvt") != NULL) {
tile.extension = ".mvt";
}
tiles.push_back(tile);
}
@@ -212,7 +207,7 @@ void dir_erase_zoom(const char *fname, int zoom) {
struct dirent *dp3;
while ((dp3 = readdir(d3)) != NULL) {
if (tile_extension(dp3->d_name) != NULL) {
if (pbfname(dp3->d_name)) {
std::string y = x + "/" + dp3->d_name;
if (unlink(y.c_str()) != 0) {
perror(y.c_str());
+1 -1
View File
@@ -6,7 +6,7 @@
#ifndef DIRTILES_HPP
#define DIRTILES_HPP
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf, const char *ext = ".pbf");
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf);
void dir_erase_zoom(const char *outdir, int z);
void dir_write_metadata(const char *outdir, const metadata &m);
+64 -61
View File
@@ -9,43 +9,42 @@
#include "errors.hpp"
#include "thread.hpp"
static constexpr uint8_t magicbytes[8] = { 0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x01 };
static constexpr uint8_t magicbytes[8] = {0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x01};
struct NodeItem {
double minX;
double minY;
double maxX;
double maxY;
uint64_t offset;
double minX;
double minY;
double maxX;
double maxY;
uint64_t offset;
};
// copied from https://github.com/flatgeobuf/flatgeobuf/blob/master/src/cpp/packedrtree.cpp#L365
uint64_t PackedRTreeSize(const uint64_t numItems, const uint16_t nodeSize)
{
if (nodeSize < 2)
throw std::invalid_argument("Node size must be at least 2");
if (numItems == 0)
throw std::invalid_argument("Number of items must be greater than 0");
const uint16_t nodeSizeMin = std::min(std::max(nodeSize, static_cast<uint16_t>(2)), static_cast<uint16_t>(65535));
// limit so that resulting size in bytes can be represented by uint64_t
if (numItems > static_cast<uint64_t>(1) << 56)
throw std::overflow_error("Number of items must be less than 2^56");
uint64_t n = numItems;
uint64_t numNodes = n;
do {
n = (n + nodeSizeMin - 1) / nodeSizeMin;
numNodes += n;
} while (n != 1);
return numNodes * sizeof(NodeItem);
uint64_t PackedRTreeSize(const uint64_t numItems, const uint16_t nodeSize) {
if (nodeSize < 2)
throw std::invalid_argument("Node size must be at least 2");
if (numItems == 0)
throw std::invalid_argument("Number of items must be greater than 0");
const uint16_t nodeSizeMin = std::min(std::max(nodeSize, static_cast<uint16_t>(2)), static_cast<uint16_t>(65535));
// limit so that resulting size in bytes can be represented by uint64_t
if (numItems > static_cast<uint64_t>(1) << 56)
throw std::overflow_error("Number of items must be less than 2^56");
uint64_t n = numItems;
uint64_t numNodes = n;
do {
n = (n + nodeSizeMin - 1) / nodeSizeMin;
numNodes += n;
} while (n != 1);
return numNodes * sizeof(NodeItem);
}
drawvec readPoints(const FlatGeobuf::Geometry *geometry) {
auto xy = geometry->xy();
drawvec dv;
for (unsigned int i = 0; i < xy->size(); i+=2) {
for (unsigned int i = 0; i < xy->size(); i += 2) {
long long x, y;
projection->project(xy->Get(i), xy->Get(i+1), 32, &x, &y);
projection->project(xy->Get(i), xy->Get(i + 1), 32, &x, &y);
dv.push_back(draw(VT_MOVETO, x, y));
}
return dv;
@@ -57,12 +56,13 @@ drawvec readLinePart(const FlatGeobuf::Geometry *geometry) {
size_t current_end = 0;
drawvec dv;
for (unsigned int i = 0; i < xy->size(); i+=2) {
for (unsigned int i = 0; i < xy->size(); i += 2) {
long long x, y;
projection->project(xy->Get(i), xy->Get(i+1), 32, &x, &y);
if (i == 0 || (ends != NULL && current_end < ends->size() && i == ends->Get(current_end)*2)) {
projection->project(xy->Get(i), xy->Get(i + 1), 32, &x, &y);
if (i == 0 || (ends != NULL && current_end < ends->size() && i == ends->Get(current_end) * 2)) {
dv.push_back(draw(VT_MOVETO, x, y));
if (i > 0) current_end++;
if (i > 0)
current_end++;
} else {
dv.push_back(draw(VT_LINETO, x, y));
}
@@ -72,12 +72,13 @@ drawvec readLinePart(const FlatGeobuf::Geometry *geometry) {
drawvec readGeometry(const FlatGeobuf::Geometry *geometry, FlatGeobuf::GeometryType h_geometry_type) {
FlatGeobuf::GeometryType geometry_type = h_geometry_type;
if (h_geometry_type == FlatGeobuf::GeometryType_Unknown) geometry_type = geometry->type();
if (h_geometry_type == FlatGeobuf::GeometryType_Unknown)
geometry_type = geometry->type();
if (geometry_type == FlatGeobuf::GeometryType_Point) {
return readPoints(geometry);
} else if (geometry_type == FlatGeobuf::GeometryType_MultiPoint) {
return readPoints(geometry);
return readPoints(geometry);
} else if (geometry_type == FlatGeobuf::GeometryType_LineString) {
return readLinePart(geometry);
} else if (geometry_type == FlatGeobuf::GeometryType_MultiLineString) {
@@ -85,7 +86,7 @@ drawvec readGeometry(const FlatGeobuf::Geometry *geometry, FlatGeobuf::GeometryT
} else if (geometry_type == FlatGeobuf::GeometryType_Polygon) {
return readLinePart(geometry);
} else if (geometry_type == FlatGeobuf::GeometryType_MultiPolygon) {
// if it is a GeometryCollection, parse Parts, ignore XY
// if it is a GeometryCollection, parse Parts, ignore XY
drawvec dv;
for (size_t part = 0; part < geometry->parts()->size(); part++) {
drawvec dv2 = readLinePart(geometry->parts()->Get(part));
@@ -96,7 +97,7 @@ drawvec readGeometry(const FlatGeobuf::Geometry *geometry, FlatGeobuf::GeometryT
}
return dv;
} else {
fprintf(stderr, "flatgeobuf has unsupported geometry type %u\n", (unsigned int)h_geometry_type);
fprintf(stderr, "flatgeobuf has unsupported geometry type %u\n", (unsigned int) h_geometry_type);
exit(EXIT_IMPOSSIBLE);
}
}
@@ -107,26 +108,27 @@ void readFeature(const FlatGeobuf::Feature *feature, long long feature_sequence_
int drawvec_type = -1;
FlatGeobuf::GeometryType geometry_type = h_geometry_type;
if (h_geometry_type == FlatGeobuf::GeometryType_Unknown) geometry_type = feature->geometry()->type();
if (h_geometry_type == FlatGeobuf::GeometryType_Unknown)
geometry_type = feature->geometry()->type();
switch (geometry_type) {
case FlatGeobuf::GeometryType_Point :
case FlatGeobuf::GeometryType_MultiPoint :
drawvec_type = 1;
break;
case FlatGeobuf::GeometryType_LineString :
case FlatGeobuf::GeometryType_MultiLineString :
drawvec_type = 2;
break;
case FlatGeobuf::GeometryType_Polygon :
case FlatGeobuf::GeometryType_MultiPolygon :
drawvec_type = 3;
break;
case FlatGeobuf::GeometryType_Unknown :
case FlatGeobuf::GeometryType_GeometryCollection :
default:
fprintf(stderr, "flatgeobuf has unsupported geometry type %u\n", (unsigned int)h_geometry_type);
exit(EXIT_IMPOSSIBLE);
case FlatGeobuf::GeometryType_Point:
case FlatGeobuf::GeometryType_MultiPoint:
drawvec_type = 1;
break;
case FlatGeobuf::GeometryType_LineString:
case FlatGeobuf::GeometryType_MultiLineString:
drawvec_type = 2;
break;
case FlatGeobuf::GeometryType_Polygon:
case FlatGeobuf::GeometryType_MultiPolygon:
drawvec_type = 3;
break;
case FlatGeobuf::GeometryType_Unknown:
case FlatGeobuf::GeometryType_GeometryCollection:
default:
fprintf(stderr, "flatgeobuf has unsupported geometry type %u\n", (unsigned int) h_geometry_type);
exit(EXIT_IMPOSSIBLE);
}
serial_feature sf;
@@ -148,7 +150,7 @@ void readFeature(const FlatGeobuf::Feature *feature, long long feature_sequence_
std::vector<std::shared_ptr<std::string>> full_keys;
std::vector<serial_val> full_values;
key_pool key_pool;
key_pool key_pool;
// assume tabular schema with columns in header
size_t p_pos = 0;
@@ -236,12 +238,12 @@ void readFeature(const FlatGeobuf::Feature *feature, long long feature_sequence_
sv.type = mvt_string;
uint32_t val_len;
memcpy(&val_len, feature->properties()->data() + p_pos + sizeof(uint16_t), sizeof(val_len));
std::string s{reinterpret_cast<const char*>(feature->properties()->data() + p_pos + sizeof(uint16_t) + sizeof(uint32_t)), val_len};
std::string s{reinterpret_cast<const char *>(feature->properties()->data() + p_pos + sizeof(uint16_t) + sizeof(uint32_t)), val_len};
sv.s = s;
p_pos += sizeof(uint16_t) + sizeof(uint32_t) + val_len;
} else {
// Binary is not representable in MVT
fprintf(stderr, "flatgeobuf has unsupported column type %u\n", (unsigned int)col_type);
fprintf(stderr, "flatgeobuf has unsupported column type %u\n", (unsigned int) col_type);
exit(EXIT_IMPOSSIBLE);
}
full_keys.push_back(key_pool.pool(h_column_names[col_idx]));
@@ -347,9 +349,9 @@ void queueFeature(const FlatGeobuf::Feature *feature, long long feature_sequence
}
void parse_flatgeobuf(std::vector<struct serialization_state> *sst, const char *src, size_t len, int layer, std::string layername) {
auto header_size = flatbuffers::GetPrefixedSize((const uint8_t *)src + sizeof(magicbytes));
auto header_size = flatbuffers::GetPrefixedSize((const uint8_t *) src + sizeof(magicbytes));
flatbuffers::Verifier v((const uint8_t *)src+sizeof(magicbytes),header_size+sizeof(uint32_t));
flatbuffers::Verifier v((const uint8_t *) src + sizeof(magicbytes), header_size + sizeof(uint32_t));
const auto ok = FlatGeobuf::VerifySizePrefixedHeaderBuffer(v);
if (!ok) {
fprintf(stderr, "flatgeobuf header verification failed\n");
@@ -378,15 +380,15 @@ void parse_flatgeobuf(std::vector<struct serialization_state> *sst, const char *
if (!quiet) {
fprintf(stderr, "detected indexed FlatGeobuf: assigning feature IDs by sequence\n");
}
index_size = PackedRTreeSize(features_count,node_size);
index_size = PackedRTreeSize(features_count, node_size);
feature_sequence_id = 0;
}
const char* start = src + sizeof(magicbytes) + sizeof(uint32_t) + header_size + index_size;
const char *start = src + sizeof(magicbytes) + sizeof(uint32_t) + header_size + index_size;
while (start < src + len) {
auto feature_size = flatbuffers::GetPrefixedSize((const uint8_t *)start);
auto feature_size = flatbuffers::GetPrefixedSize((const uint8_t *) start);
flatbuffers::Verifier v2((const uint8_t *)start,feature_size+sizeof(uint32_t));
flatbuffers::Verifier v2((const uint8_t *) start, feature_size + sizeof(uint32_t));
const auto ok2 = FlatGeobuf::VerifySizePrefixedFeatureBuffer(v2);
if (!ok2) {
fprintf(stderr, "flatgeobuf feature buffer verification failed\n");
@@ -397,7 +399,8 @@ void parse_flatgeobuf(std::vector<struct serialization_state> *sst, const char *
queueFeature(feature, feature_sequence_id, h_geometry_type, h_column_names, h_column_types, sst, layer, layername);
if (feature_sequence_id >= 0) feature_sequence_id ++;
if (feature_sequence_id >= 0)
feature_sequence_id++;
start += sizeof(uint32_t) + feature_size;
}
+1 -1
View File
@@ -693,7 +693,7 @@ struct sorty {
struct sorty_sorter {
int kind;
sorty_sorter(int k)
: kind(k){};
: kind(k) {};
bool operator()(const sorty &a, const sorty &b) const {
long long xa, ya, xb, yb;
+2 -4
View File
@@ -148,8 +148,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
std::vector<mvt_layer> const &bins, std::string const &bin_by_id_list,
std::string const &accumulate_numeric, size_t feature_limit,
std::vector<clipbbox> const &clipbboxes,
bool deduplicate_by_id,
int tile_format = OUTPUT_MVT);
bool deduplicate_by_id);
std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int ny,
int detail, int buffer,
@@ -165,8 +164,7 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
std::vector<mvt_layer> const &bins, std::string const &bin_by_id_list,
std::string const &accumulate_numeric, size_t feature_limit,
std::vector<clipbbox> const &clipbboxes,
bool deduplicate_by_id,
int tile_format = OUTPUT_MVT);
bool deduplicate_by_id);
draw center_of_mass_mp(const drawvec &dv);
+1 -12
View File
@@ -50,7 +50,6 @@
#include "projection.hpp"
#include "memfile.hpp"
#include "main.hpp"
#include "mlt.hpp"
#include "geojson.hpp"
#include "geobuf.hpp"
#include "flatgeobuf.hpp"
@@ -2836,8 +2835,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
ai->second.maxzoom = maxzoom;
}
const char *tile_format = tile_format_name(output_format);
metadata m = make_metadata(fname, minzoom, maxzoom, minlat, minlon, maxlat, maxlon, minlat2, minlon2, maxlat2, maxlon2, midlat, midlon, attribution, merged_lm, tile_format, description, !prevent[P_TILE_STATS], attribute_descriptions, "tippecanoe", commandline, strategies, basezoom, droprate, retain_points_multiplier);
metadata m = make_metadata(fname, minzoom, maxzoom, minlat, minlon, maxlat, maxlon, minlat2, minlon2, maxlat2, maxlon2, midlat, midlon, attribution, merged_lm, true, description, !prevent[P_TILE_STATS], attribute_descriptions, "tippecanoe", commandline, strategies, basezoom, droprate, retain_points_multiplier);
if (outdb != NULL) {
mbtiles_write_metadata(outdb, m, forcetable);
} else {
@@ -3120,9 +3118,6 @@ static const struct option long_options_orig[] = {
{"no-feature-limit", no_argument, &prevent[P_FEATURE_LIMIT], 1},
{"no-tile-size-limit", no_argument, &prevent[P_KILOBYTE_LIMIT], 1},
{"no-tile-compression", no_argument, &prevent[P_TILE_COMPRESSION], 1},
{"output-format", required_argument, 0, '~'},
{"pretessellate", no_argument, 0, '~'},
{"no-mlt-feature-sort", no_argument, 0, '~'},
{"no-tile-stats", no_argument, &prevent[P_TILE_STATS], 1},
{"tile-stats-attributes-limit", required_argument, 0, '~'},
{"tile-stats-sample-values-limit", required_argument, 0, '~'},
@@ -3351,12 +3346,6 @@ int main(int argc, char **argv) {
unidecode_data = read_unidecode(optarg);
} else if (strcmp(opt, "maximum-string-attribute-length") == 0) {
maximum_string_attribute_length = atoll_require(optarg, "Maximum string attribute length");
} else if (strcmp(opt, "output-format") == 0) {
set_output_format(argv, optarg);
} else if (strcmp(opt, "pretessellate") == 0) {
mlt_pretessellate = true;
} else if (strcmp(opt, "no-mlt-feature-sort") == 0) {
mlt_sort_features = false;
} else {
fprintf(stderr, "%s: Unrecognized option --%s\n", argv[0], opt);
exit(EXIT_ARGS);
+4 -44
View File
@@ -49,19 +49,12 @@ $ brew install tippecanoe
.PP
On Ubuntu it will usually be easiest to build from the source repository:
.EX
$ git clone --recurse-submodules https://github.com/felt/tippecanoe.git
$ git clone https://github.com/felt/tippecanoe.git
$ cd tippecanoe
$ make -j
$ make install
.EE
.PP
The submodule is the MapLibre Tile
\[la]https://github.com/maplibre/maplibre\-tile\-spec\[ra]
implementation, which is built with \fBcmake\fR\&. If you don't need MapLibre Tile support,
build with \fBmake MLT=0\fR instead, which needs neither the submodule nor \fBcmake\fR\&. Such a
build can't read or write MLT, and rejects \fB--output-format=mlt\fR, but is otherwise the same.
Run \fBmake clean\fR first if you are switching an existing build directory between the two.
.PP
See Development
\[la]#development\[ra] below for how to upgrade your
C++ compiler or install prerequisite packages if you get
@@ -622,14 +615,7 @@ the line or polygon within one tile unit of its proper location. You can probabl
.IP \(bu 2
\fB-pk\fR or \fB--no-tile-size-limit\fR: Don't limit tiles to 500K bytes
.IP \(bu 2
\fB-pC\fR or \fB--no-tile-compression\fR: Don't compress the vector tile data. If you are getting "Unimplemented type 3" error messages from a renderer, it is probably because it expects uncompressed tiles using this option rather than the normal gzip-compressed tiles.
.IP \(bu 2
\fB--output-format=\fR\fIformat\fP: Set the tile encoding format. Supported values: \fBmvt\fR (default, Mapbox Vector Tiles) or \fBmlt\fR (MapLibre Tiles
\[la]https://github.com/maplibre/maplibre\-tile\-spec\[ra]). MLT tilesets can be read back by \fBtippecanoe-decode\fR, \fBtile-join\fR, and \fBtippecanoe-overzoom\fR\&. Because MLT attribute columns have a single type for the whole layer, while MVT attribute values are individually typed, an attribute whose values are a mix of numbers and strings (or of booleans and numbers) is encoded as strings.
.IP \(bu 2
\fB--pretessellate\fR: When using \fB--output-format=mlt\fR, pre-triangulate polygon geometries. Only applies to layers where all features are polygons.
.IP \(bu 2
\fB--no-mlt-feature-sort\fR: When using \fB--output-format=mlt\fR, disable within-tile spatial sorting of features by Hilbert curve index. Sorting is on by default.
\fB-pC\fR or \fB--no-tile-compression\fR: Don't compress the PBF vector tile data. If you are getting "Unimplemented type 3" error messages from a renderer, it is probably because it expects uncompressed tiles using this option rather than the normal gzip-compressed tiles.
.IP \(bu 2
\fB-pg\fR or \fB--no-tile-stats\fR: Don't generate the \fBtilestats\fR row in the tileset metadata. Uploads without tilestats
\[la]https://github.com/mapbox/mapbox\-geostats\[ra] will take longer to process.
@@ -844,10 +830,6 @@ all the sources are read and their combined contents are written to the new
mbtiles output. If they define the same layers or the same tiles, the layers
or tiles are merged.
.PP
Sources may contain either Mapbox Vector Tiles or MapLibre Tiles, in any combination,
since the encoding is detected from the tile data. The output is written as Mapbox
Vector Tiles unless \fB--output-format=mlt\fR is specified.
.PP
The options are:
.SS Output tileset
.IP \(bu 2
@@ -910,14 +892,7 @@ The options are:
.IP \(bu 2
\fB-pk\fR or \fB--no-tile-size-limit\fR: Don't skip tiles larger than 500K.
.IP \(bu 2
\fB-pC\fR or \fB--no-tile-compression\fR: Don't compress the vector tile data.
.IP \(bu 2
\fB--output-format=\fR\fIformat\fP: Set the tile encoding format. Supported values: \fBmvt\fR (default, Mapbox Vector Tiles) or \fBmlt\fR (MapLibre Tiles
\[la]https://github.com/maplibre/maplibre\-tile\-spec\[ra]). Applies regardless of what the sources are encoded in.
.IP \(bu 2
\fB--pretessellate\fR: When using \fB--output-format=mlt\fR, pre-triangulate polygon geometries. Only applies to layers where all features are polygons.
.IP \(bu 2
\fB--no-mlt-feature-sort\fR: When using \fB--output-format=mlt\fR, disable within-tile spatial sorting of features by Hilbert curve index. Sorting is on by default.
\fB-pC\fR or \fB--no-tile-compression\fR: Don't compress the PBF vector tile data.
.IP \(bu 2
\fB-pg\fR or \fB--no-tile-stats\fR: Don't generate the \fBtilestats\fR row in the tileset metadata. Uploads without tilestats
\[la]https://github.com/mapbox/mapbox\-geostats\[ra] will take longer to process.
@@ -997,10 +972,6 @@ tippecanoe-decode file.mbtiles zoom x y
tippecanoe-decode file.vector.pbf zoom x y
.EE
.PP
Tiles can be either Mapbox Vector Tiles or MapLibre Tiles; the encoding is detected
from the tile data, so no option is needed to decode a tileset that was written with
\fB--output-format=mlt\fR\&.
.PP
Unless you use \fB-c\fR, the output is a set of nested FeatureCollections identifying each
tile and layer separately. Note that the same features generally appear at all zooms,
so the output for the file will have many copies of the same features at different
@@ -1105,10 +1076,6 @@ tippecanoe-overzoom -o out.mvt.gz -t outz/outx/outy in.mvt.gz inz/inx/iny in2.mv
.PP
reads tile \fBinz/inx/iny\fR of \fBin.mvt.gz\fR, tile \fBin2z/in2x/in2y\fR of \fBin2.mvt.gz\fR, and tile \fBin3z/in3x/in3y\fR of \fBin3.mvt.gz\fR,
and produces tile \fBoutz/outx/outy\fR of \fBout.mvt.gz\fR from them.
.PP
The input tiles may be either Mapbox Vector Tiles or MapLibre Tiles, since the encoding
is detected from the tile data. The output tile is a Mapbox Vector Tile unless
\fB--output-format=mlt\fR is specified.
.SS Options
.IP \(bu 2
\fB-o\fR \fIfile\fP or \fB--output=\fR\fIfile\fP: Write the output tile to the named \fIfile\fP\&.
@@ -1141,11 +1108,4 @@ is detected from the tile data. The output tile is a Mapbox Vector Tile unless
.IP \(bu 2
\fB-E\fR \fIattribute\fP\fB:\fR\fIoperation\fP or \fB--accumulate-attribute=\fR\fIattribute\fP\fB:\fR\fIoperation\fP: Behaves as in \fBtippecanoe\fR to sum attributes from the features of a multiplier cluster that are not included in the final output. The attributes from features that are filtered away with \fB-j\fR are \fInot\fP accumulated onto the output feature.
.IP \(bu 2
\fB--no-tile-compression\fR: Don't compress the vector tile data in the output tile.
.IP \(bu 2
\fB--output-format=\fR\fIformat\fP: Set the tile encoding format. Supported values: \fBmvt\fR (default, Mapbox Vector Tiles) or \fBmlt\fR (MapLibre Tiles
\[la]https://github.com/maplibre/maplibre\-tile\-spec\[ra]). Applies regardless of what the input tiles are encoded in.
.IP \(bu 2
\fB--pretessellate\fR: When using \fB--output-format=mlt\fR, pre-triangulate polygon geometries. Only applies to layers where all features are polygons.
.IP \(bu 2
\fB--no-mlt-feature-sort\fR: When using \fB--output-format=mlt\fR, disable within-tile spatial sorting of features by Hilbert curve index. Sorting is on by default.
\fB--no-tile-compression\fR: Don't compress the PBF vector tile data in the output tile.
+3 -4
View File
@@ -665,14 +665,14 @@ std::string version_str() {
return s;
}
metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map<std::string, layermap_entry> const &layermap, const char *tile_format, const char *description, bool do_tilestats, std::map<std::string, std::string> const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector<strategy> const &strategies, int basezoom, double droprate, int retain_points_multiplier) {
metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map<std::string, layermap_entry> const &layermap, bool vector, const char *description, bool do_tilestats, std::map<std::string, std::string> const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector<strategy> const &strategies, int basezoom, double droprate, int retain_points_multiplier) {
metadata m;
m.name = fname;
m.description = description != NULL ? description : fname;
m.version = 2;
m.type = "overlay";
m.format = tile_format;
m.format = vector ? "pbf" : "png";
m.minzoom = minzoom;
m.maxzoom = maxzoom;
@@ -714,8 +714,7 @@ metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minla
std::string("}");
}
bool is_vector_format = (strcmp(tile_format, "pbf") == 0 || strcmp(tile_format, "mlt") == 0);
if (is_vector_format) {
if (vector) {
{
json_writer state(&m.vector_layers_json);
+1 -1
View File
@@ -68,7 +68,7 @@ sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable);
void mbtiles_write_tile(sqlite3 *outdb, int z, int tx, int ty, const char *data, int size);
void mbtiles_erase_zoom(sqlite3 *outdb, int z);
metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map<std::string, layermap_entry> const &layermap, const char *tile_format, const char *description, bool do_tilestats, std::map<std::string, std::string> const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector<strategy> const &strategies, int basezoom, double droprate, int retain_points_multiplier);
metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double minlat2, double minlon2, double maxlat2, double maxlon2, double midlat, double midlon, const char *attribution, std::map<std::string, layermap_entry> const &layermap, bool vector, const char *description, bool do_tilestats, std::map<std::string, std::string> const &attribute_descriptions, std::string const &program, std::string const &commandline, std::vector<strategy> const &strategies, int basezoom, double droprate, int retain_points_multiplier);
void mbtiles_write_metadata(sqlite3 *db, const metadata &m, bool forcetable);
void mbtiles_close(sqlite3 *outdb, const char *pgm);
-344
View File
@@ -1,344 +0,0 @@
#include "mlt.hpp"
#include "errors.hpp"
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <map>
#include <optional>
#include <string>
#include <vector>
#ifndef NO_MLT
#include <mlt/encoder.hpp>
using Vertex = mlt::Encoder::Vertex;
#endif
int output_format = OUTPUT_MVT;
bool mlt_sort_features = true;
bool mlt_pretessellate = false;
void set_output_format(char **argv, const char *format) {
if (strcmp(format, "mvt") == 0 || strcmp(format, "pbf") == 0) {
output_format = OUTPUT_MVT;
} else if (strcmp(format, "mlt") == 0) {
#ifdef NO_MLT
fprintf(stderr, "%s: this build was compiled without MapLibre Tile support\n", argv[0]);
exit(EXIT_ARGS);
#else
output_format = OUTPUT_MLT;
#endif
} else {
fprintf(stderr, "%s: --output-format must be 'mvt' or 'mlt'\n", argv[0]);
exit(EXIT_ARGS);
}
}
const char *tile_format_name(int format) {
return (format == OUTPUT_MLT) ? "mlt" : "pbf";
}
const char *tile_format_extension(int format) {
return (format == OUTPUT_MLT) ? ".mlt" : ".pbf";
}
std::string encode_tile(mvt_tile &tile, int format) {
#ifndef NO_MLT
if (format == OUTPUT_MLT) {
return encode_as_mlt(tile, mlt_sort_features, mlt_pretessellate);
}
#else
(void) format;
#endif
return tile.encode();
}
#ifndef NO_MLT
// An MLT property column has a single type for the whole layer, while MVT
// values each carry their own type, so a type that can hold every value of
// an attribute has to be chosen before the layer can be converted.
enum mlt_column_type {
MLT_COLUMN_BOOL,
MLT_COLUMN_INT32,
MLT_COLUMN_INT64,
MLT_COLUMN_UINT32,
MLT_COLUMN_UINT64,
MLT_COLUMN_DOUBLE,
MLT_COLUMN_STRING,
};
struct column_summary {
bool has_bool = false;
bool has_string = false;
bool has_floating = false;
bool has_signed = false;
bool has_unsigned = false;
long long min_signed = 0;
long long max_signed = 0;
unsigned long long max_unsigned = 0;
void add(const mvt_value &val) {
switch (val.type) {
case mvt_bool:
has_bool = true;
break;
case mvt_float:
case mvt_double:
has_floating = true;
break;
case mvt_int:
case mvt_sint: {
long long v = (val.type == mvt_int) ? val.numeric_value.int_value : val.numeric_value.sint_value;
if (!has_signed) {
min_signed = max_signed = v;
has_signed = true;
} else {
min_signed = std::min(min_signed, v);
max_signed = std::max(max_signed, v);
}
break;
}
case mvt_uint:
has_unsigned = true;
max_unsigned = std::max(max_unsigned, val.numeric_value.uint_value);
break;
default:
has_string = true;
break;
}
}
mlt_column_type resolve() const {
if (has_string) {
return MLT_COLUMN_STRING;
}
bool has_number = has_floating || has_signed || has_unsigned;
if (has_bool) {
// A column of booleans and numbers has no common numeric type
return has_number ? MLT_COLUMN_STRING : MLT_COLUMN_BOOL;
}
if (has_floating) {
return MLT_COLUMN_DOUBLE;
}
if (has_unsigned && !has_signed) {
return max_unsigned <= UINT32_MAX ? MLT_COLUMN_UINT32 : MLT_COLUMN_UINT64;
}
if (has_signed && !has_unsigned) {
return (min_signed >= INT32_MIN && max_signed <= INT32_MAX) ? MLT_COLUMN_INT32 : MLT_COLUMN_INT64;
}
if (has_signed && has_unsigned) {
if (max_unsigned > (unsigned long long) INT64_MAX) {
// Too wide for any integer type that can also hold the signed values
return MLT_COLUMN_DOUBLE;
}
return MLT_COLUMN_INT64;
}
return MLT_COLUMN_STRING;
}
};
static mlt::Encoder::PropertyValue convert_value(const mvt_value &val, mlt_column_type type) {
switch (type) {
case MLT_COLUMN_BOOL:
return val.numeric_value.bool_value;
case MLT_COLUMN_INT32:
return static_cast<std::int32_t>(mvt_value_to_long_long(val));
case MLT_COLUMN_INT64:
return static_cast<std::int64_t>(mvt_value_to_long_long(val));
case MLT_COLUMN_UINT32:
return static_cast<std::uint32_t>(val.numeric_value.uint_value);
case MLT_COLUMN_UINT64:
return static_cast<std::uint64_t>(val.numeric_value.uint_value);
case MLT_COLUMN_DOUBLE:
return val.to_double();
case MLT_COLUMN_STRING:
default:
// Nested JSON objects stay JSON text, the way MVT carries them,
// because MLT struct columns can only hold strings and are
// flattened into their parent column name when decoded.
return val.get_string_value();
}
}
static std::vector<std::vector<Vertex>> extract_rings(const mvt_feature &feature) {
std::vector<std::vector<Vertex>> rings;
for (size_t i = 0; i < feature.geometry.size(); i++) {
const auto &g = feature.geometry[i];
if (g.op == mvt_moveto) {
rings.emplace_back();
rings.back().push_back({static_cast<int32_t>(g.x), static_cast<int32_t>(g.y)});
} else if (g.op == mvt_lineto) {
rings.back().push_back({static_cast<int32_t>(g.x), static_cast<int32_t>(g.y)});
}
}
return rings;
}
static mlt::Encoder::Geometry convert_geometry(const mvt_feature &feature) {
mlt::Encoder::Geometry geom;
auto rings = extract_rings(feature);
switch (feature.type) {
case mvt_point:
if (rings.size() == 1 && rings[0].size() == 1) {
geom.type = mlt::Encoder::GeometryType::POINT;
geom.coordinates = std::move(rings[0]);
} else {
geom.type = mlt::Encoder::GeometryType::MULTIPOINT;
for (auto &ring : rings) {
for (auto &v : ring) {
geom.coordinates.push_back(v);
}
}
}
break;
case mvt_linestring:
if (rings.size() == 1) {
geom.type = mlt::Encoder::GeometryType::LINESTRING;
geom.coordinates = std::move(rings[0]);
} else {
geom.type = mlt::Encoder::GeometryType::MULTILINESTRING;
geom.parts = std::move(rings);
}
break;
case mvt_polygon: {
std::vector<std::vector<std::vector<Vertex>>> polygons;
for (auto &ring : rings) {
long long area2 = 0;
for (size_t i = 0; i < ring.size(); i++) {
size_t j = (i + 1) % ring.size();
area2 += (long long) ring[i].x * ring[j].y - (long long) ring[j].x * ring[i].y;
}
if (area2 >= 0) {
polygons.emplace_back();
}
if (!polygons.empty()) {
polygons.back().push_back(std::move(ring));
}
}
if (polygons.size() == 1) {
geom.type = mlt::Encoder::GeometryType::POLYGON;
for (auto &ring : polygons[0]) {
geom.ringSizes.push_back(static_cast<uint32_t>(ring.size()));
geom.coordinates.insert(geom.coordinates.end(), ring.begin(), ring.end());
}
} else {
geom.type = mlt::Encoder::GeometryType::MULTIPOLYGON;
for (auto &poly : polygons) {
std::vector<Vertex> part_verts;
std::vector<uint32_t> part_rings;
for (auto &ring : poly) {
part_rings.push_back(static_cast<uint32_t>(ring.size()));
part_verts.insert(part_verts.end(), ring.begin(), ring.end());
}
geom.parts.push_back(std::move(part_verts));
geom.partRingSizes.push_back(std::move(part_rings));
}
}
break;
}
}
return geom;
}
static mlt::Encoder::Layer convert_layer(const mvt_layer &layer) {
mlt::Encoder::Layer out;
out.name = layer.name;
out.extent = static_cast<uint32_t>(layer.extent);
std::vector<column_summary> summaries(layer.keys.size());
for (const auto &feature : layer.features) {
for (size_t t = 0; t + 1 < feature.tags.size(); t += 2) {
unsigned key_idx = feature.tags[t];
unsigned val_idx = feature.tags[t + 1];
if (key_idx < layer.keys.size() && val_idx < layer.values.size()) {
const auto &val = layer.values[val_idx];
if (val.type != mvt_null) {
summaries[key_idx].add(val);
}
}
}
}
std::vector<mlt_column_type> types(layer.keys.size(), MLT_COLUMN_STRING);
for (size_t i = 0; i < summaries.size(); i++) {
types[i] = summaries[i].resolve();
}
for (const auto &feature : layer.features) {
mlt::Encoder::Feature f;
if (feature.has_id) {
f.id = feature.id;
} else {
f.id = std::nullopt;
}
f.geometry = convert_geometry(feature);
for (size_t t = 0; t + 1 < feature.tags.size(); t += 2) {
unsigned key_idx = feature.tags[t];
unsigned val_idx = feature.tags[t + 1];
if (key_idx < layer.keys.size() && val_idx < layer.values.size()) {
const auto &val = layer.values[val_idx];
if (val.type != mvt_null) {
f.properties[layer.keys[key_idx]] = convert_value(val, types[key_idx]);
}
}
}
out.features.push_back(std::move(f));
}
return out;
}
std::string encode_as_mlt(const mvt_tile &tile, bool sort_features, bool pretessellate) {
mlt::Encoder encoder;
mlt::EncoderConfig config;
config.sortFeatures = sort_features;
config.preTessellate = pretessellate;
bool any_has_id = false;
for (const auto &layer : tile.layers) {
for (const auto &feature : layer.features) {
if (feature.has_id) {
any_has_id = true;
break;
}
}
if (any_has_id) {
break;
}
}
config.includeIds = any_has_id;
std::vector<mlt::Encoder::Layer> layers;
layers.reserve(tile.layers.size());
for (const auto &layer : tile.layers) {
layers.push_back(convert_layer(layer));
}
auto bytes = encoder.encode(layers, config);
return std::string(reinterpret_cast<const char *>(bytes.data()), bytes.size());
}
#endif
-40
View File
@@ -1,40 +0,0 @@
#ifndef MLT_HPP
#define MLT_HPP
#include <string>
#include "mvt.hpp"
// The tile format to write, and the MLT encoder options to write it with,
// as selected on the command line.
extern int output_format;
extern bool mlt_sort_features;
extern bool mlt_pretessellate;
// Set output_format from an --output-format argument, complaining and
// exiting if it names a format we can't write.
void set_output_format(char **argv, const char *format);
// What this tile format is called in tileset metadata
const char *tile_format_name(int format);
// What tiles of this format are named in a tile directory
const char *tile_format_extension(int format);
// Encode a tile in the specified format, using whichever MLT encoder
// options were selected on the command line
std::string encode_tile(mvt_tile &tile, int format);
#ifndef NO_MLT
std::string encode_as_mlt(const mvt_tile &tile, bool sort_features, bool pretessellate);
#endif
// Does this (already decompressed) tile look like MapLibre Tile rather than
// Mapbox Vector Tile data?
bool is_mlt(const std::string &message);
// Decode a MapLibre Tile into the equivalent vector tile, returning false
// (and complaining to stderr) if it can't be parsed, or if this build
// doesn't have MLT support compiled in.
bool decode_mlt(const std::string &message, mvt_tile &out);
#endif
-311
View File
@@ -1,311 +0,0 @@
#include "mlt.hpp"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <exception>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <variant>
#include <vector>
#ifndef NO_MLT
#include <mlt/decoder.hpp>
#include <mlt/geometry.hpp>
#include <mlt/layer.hpp>
#include <mlt/properties.hpp>
#include <mlt/tile.hpp>
#endif
namespace {
bool read_varint(const char *&p, const char *end, unsigned long long &out) {
out = 0;
int shift = 0;
while (p < end) {
unsigned char c = (unsigned char) *p++;
if (shift > 63) {
return false;
}
out |= ((unsigned long long) (c & 0x7F)) << shift;
if ((c & 0x80) == 0) {
return true;
}
shift += 7;
}
return false;
}
#ifndef NO_MLT
long long round_coord(float v) {
return (long long) std::llround(v);
}
// Append a sequence of coordinates as a moveto followed by linetos. Rings
// come out of the MLT decoder explicitly closed, but MVT rings are closed
// implicitly by the closepath operation, so the repeated final point is
// dropped.
void add_line(mvt_feature &feature, const mlt::CoordVec &coords, bool ring) {
size_t n = coords.size();
if (ring && n > 1 && coords.front() == coords.back()) {
n--;
}
for (size_t i = 0; i < n; i++) {
feature.geometry.emplace_back(i == 0 ? mvt_moveto : mvt_lineto,
round_coord(coords[i].x), round_coord(coords[i].y));
}
if (ring && n > 0) {
feature.geometry.emplace_back(mvt_closepath, 0, 0);
}
}
void convert_geometry(const mlt::geometry::Geometry &geom, mvt_feature &feature) {
using GeometryType = mlt::metadata::tileset::GeometryType;
namespace geometry = mlt::geometry;
switch (geom.type) {
case GeometryType::POINT: {
const auto &point = static_cast<const geometry::Point &>(geom);
feature.type = mvt_point;
feature.geometry.emplace_back(mvt_moveto,
round_coord(point.getCoordinate().x),
round_coord(point.getCoordinate().y));
break;
}
case GeometryType::MULTIPOINT: {
const auto &multipoint = static_cast<const geometry::MultiPoint &>(geom);
feature.type = mvt_point;
for (const auto &coord : multipoint.getCoordinates()) {
feature.geometry.emplace_back(mvt_moveto, round_coord(coord.x), round_coord(coord.y));
}
break;
}
case GeometryType::LINESTRING: {
const auto &linestring = static_cast<const geometry::LineString &>(geom);
feature.type = mvt_linestring;
add_line(feature, linestring.getCoordinates(), false);
break;
}
case GeometryType::MULTILINESTRING: {
const auto &multilinestring = static_cast<const geometry::MultiLineString &>(geom);
feature.type = mvt_linestring;
for (const auto &linestring : multilinestring.getLineStrings()) {
add_line(feature, linestring, false);
}
break;
}
case GeometryType::POLYGON: {
const auto &polygon = static_cast<const geometry::Polygon &>(geom);
feature.type = mvt_polygon;
for (const auto &ring : polygon.getRings()) {
add_line(feature, ring, true);
}
break;
}
case GeometryType::MULTIPOLYGON: {
const auto &multipolygon = static_cast<const geometry::MultiPolygon &>(geom);
feature.type = mvt_polygon;
for (const auto &polygon : multipolygon.getPolygons()) {
for (const auto &ring : polygon) {
add_line(feature, ring, true);
}
}
break;
}
}
}
// Converts one MLT property into the equivalent MVT value, returning false
// for properties that MVT has no way to represent, which are left off the
// feature instead.
struct property_converter {
mvt_value &out;
const std::shared_ptr<std::string> &pool;
bool operator()(std::nullptr_t) const {
return false;
}
bool operator()(bool v) const {
out.type = mvt_bool;
out.numeric_value.bool_value = v;
return true;
}
bool operator()(std::int32_t v) const {
out.type = mvt_int;
out.numeric_value.int_value = v;
return true;
}
bool operator()(std::int64_t v) const {
out.type = mvt_int;
out.numeric_value.int_value = v;
return true;
}
bool operator()(std::uint32_t v) const {
out.type = mvt_uint;
out.numeric_value.uint_value = v;
return true;
}
bool operator()(std::uint64_t v) const {
out.type = mvt_uint;
out.numeric_value.uint_value = v;
return true;
}
bool operator()(float v) const {
out.type = mvt_float;
out.numeric_value.float_value = v;
return true;
}
bool operator()(double v) const {
out.type = mvt_double;
out.numeric_value.double_value = v;
return true;
}
bool operator()(std::string_view v) const {
out.s = pool;
out.set_string_value(v);
return true;
}
template <typename T>
bool operator()(const std::optional<T> &v) const {
if (v.has_value()) {
return (*this)(*v);
}
return false;
}
};
void convert_layer(const mlt::Layer &in, mvt_layer &out, const std::shared_ptr<std::string> &pool) {
out.version = 2;
out.name = in.getName();
out.extent = in.getExtent();
// The property columns are held in an unordered map, so sort the names
// to keep the attributes of the decoded tile in a stable order.
std::vector<std::pair<const std::string *, const mlt::PresentProperties *>> columns;
columns.reserve(in.getProperties().size());
for (const auto &property : in.getProperties()) {
columns.emplace_back(&property.first, &property.second);
}
std::sort(columns.begin(), columns.end(), [](auto const &a, auto const &b) {
return *a.first < *b.first;
});
out.features.reserve(in.getFeatures().size());
for (const auto &in_feature : in.getFeatures()) {
mvt_feature feature;
if (in_feature.getID()) {
feature.id = *in_feature.getID();
feature.has_id = true;
}
convert_geometry(in_feature.getGeometry(), feature);
for (const auto &column : columns) {
auto property = column.second->getProperty(in_feature.getIndex());
if (!property) {
continue;
}
mvt_value value;
if (std::visit(property_converter{value, pool}, *property)) {
out.tag(feature, *column.first, value);
}
}
out.features.push_back(std::move(feature));
}
}
#endif
} // namespace
bool is_mlt(const std::string &message) {
// An MLT tile is a sequence of layers, each of which is a varint byte
// count followed by a varint tag whose only defined value is 1.
//
// An MVT tile is a protobuf whose only field is the repeated layer
// field 3, so it begins with the byte 0x1a followed by the byte count
// of a layer, which can never be as short as the single byte that
// would be needed to masquerade as an MLT layer tag.
const char *p = message.data();
const char *end = p + message.size();
unsigned long long layer_length;
if (!read_varint(p, end, layer_length)) {
return false;
}
if (layer_length < 2 || layer_length > (unsigned long long) (end - p)) {
return false;
}
unsigned long long layer_tag;
if (!read_varint(p, end, layer_tag)) {
return false;
}
return layer_tag == 1;
}
#ifdef NO_MLT
bool decode_mlt(const std::string &message, mvt_tile &out) {
(void) message;
(void) out;
fprintf(stderr, "This build was compiled without MapLibre Tile support\n");
return false;
}
#else
bool decode_mlt(const std::string &message, mvt_tile &out) {
try {
mlt::Decoder decoder(true);
mlt::MapLibreTile tile = decoder.decode(mlt::DataView(message.data(), message.size()));
std::shared_ptr<std::string> pool = std::make_shared<std::string>();
out.layers.clear();
out.layers.reserve(tile.getLayers().size());
for (const auto &layer : tile.getLayers()) {
mvt_layer out_layer;
convert_layer(layer, out_layer, pool);
out.layers.push_back(std::move(out_layer));
}
return true;
} catch (std::exception const &e) {
fprintf(stderr, "MLT decoding error: %s\n", e.what());
return false;
}
}
#endif
+1 -6
View File
@@ -8,7 +8,6 @@
#include <limits.h>
#include <ctype.h>
#include "mvt.hpp"
#include "mlt.hpp"
#include "geometry.hpp"
#include "protozero/varint.hpp"
#include "protozero/pbf_reader.hpp"
@@ -128,10 +127,6 @@ bool mvt_tile::decode(const std::string &message, bool &was_compressed) {
was_compressed = false;
}
if (is_mlt(src)) {
return decode_mlt(src, *this);
}
protozero::pbf_reader reader(src);
std::shared_ptr<std::string> string_pool = std::make_shared<std::string>();
@@ -412,7 +407,7 @@ std::string mvt_tile::encode() {
std::string feature_string;
protozero::pbf_writer feature_writer(feature_string);
if (layers[i].features[f].type >= 0)
if (layers[i].features[f].type >= 0)
feature_writer.add_enum(3, layers[i].features[f].type);
std::vector<unsigned> sorted_tags = layers[i].features[f].tags;
-4
View File
@@ -17,10 +17,6 @@
struct mvt_value;
struct mvt_layer;
// Which of the two vector tile encodings a tile is written in
#define OUTPUT_MVT 0
#define OUTPUT_MLT 1
enum mvt_operation {
mvt_moveto = 1,
mvt_lineto = 2,
+1 -17
View File
@@ -5,7 +5,6 @@
#include <set>
#include "errors.hpp"
#include "mvt.hpp"
#include "mlt.hpp"
#include "geometry.hpp"
#include "evaluator.hpp"
#include "attribute.hpp"
@@ -37,9 +36,6 @@ static const struct option long_options[] = {
{"output", required_argument, 0, 'o'},
{"source-tile", required_argument, 0, 't'},
{"no-tile-compression", no_argument, 0, 'd' & 0x1F},
{"output-format", required_argument, 0, 'f' & 0x1F},
{"pretessellate", no_argument, 0, 'p' & 0x1F},
{"no-mlt-feature-sort", no_argument, 0, 'r' & 0x1F},
{"Tile resolution", 0, 0, 0},
{"full-detail", required_argument, 0, 'd'},
@@ -196,18 +192,6 @@ int main(int argc, char **argv) {
break;
}
case 'f' & 0x1F:
set_output_format(argv, optarg);
break;
case 'p' & 0x1F:
mlt_pretessellate = true;
break;
case 'r' & 0x1F:
mlt_sort_features = false;
break;
default:
fprintf(stderr, "Unrecognized flag -%c\n", i);
usage(argv);
@@ -305,7 +289,7 @@ int main(int argc, char **argv) {
its.push_back(std::move(t));
}
out = overzoom(its, nz, nx, ny, detail, buffer, keep, exclude, exclude_prefix, do_compress, NULL, demultiply, json_filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, std::vector<mvt_layer>(), "", "", SIZE_MAX, std::vector<clipbbox>(), deduplicate_by_id, output_format);
out = overzoom(its, nz, nx, ny, detail, buffer, keep, exclude, exclude_prefix, do_compress, NULL, demultiply, json_filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, std::vector<mvt_layer>(), "", "", SIZE_MAX, std::vector<clipbbox>(), deduplicate_by_id);
}
FILE *f = fopen(outfile, "wb");
+1 -1
View File
@@ -676,7 +676,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
} else if (extent < 0) {
sf.extent = LLONG_MIN;
} else {
sf.extent = LLONG_MAX; // also the NaN case
sf.extent = LLONG_MAX; // also the NaN case
}
if (sst->want_dist && sf.t == VT_POLYGON) {
-104
View File
@@ -1,104 +0,0 @@
{ "type": "FeatureCollection", "properties": {
"antimeridian_adjusted_bounds": "-122.915039,37.160317,-122.343750,37.961523",
"bounds": "-122.915039,37.160317,-122.343750,37.961523",
"center": "-122.350000,37.200000,5",
"description": "tests/mlt/mvt-source.mbtiles",
"format": "mlt",
"json": "{\"vector_layers\":[{\"id\":\"roundtrip\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":5,\"fields\":{\"active\":\"Boolean\",\"count\":\"Number\",\"kind\":\"String\",\"name\":\"String\",\"nested\":\"String\",\"ratio\":\"Number\",\"unicode\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"roundtrip\",\"count\":33,\"geometry\":\"LineString\",\"attributeCount\":7,\"attributes\":[{\"attribute\":\"active\",\"count\":2,\"type\":\"boolean\",\"values\":[false,true]},{\"attribute\":\"count\",\"count\":6,\"type\":\"number\",\"values\":[-200,100,300,4000000000,500,600],\"min\":-200,\"max\":4000000000},{\"attribute\":\"kind\",\"count\":3,\"type\":\"string\",\"values\":[\"line\",\"point\",\"polygon\"]},{\"attribute\":\"name\",\"count\":7,\"type\":\"string\",\"values\":[\"line\",\"multiline\",\"multipoint\",\"multipolygon\",\"no id\",\"point\",\"polygon with hole\"]},{\"attribute\":\"nested\",\"count\":1,\"type\":\"string\",\"values\":[\"{\\\"a\\\":1,\\\"b\\\":\\\"two\\\"}\"]},{\"attribute\":\"ratio\",\"count\":5,\"type\":\"number\",\"values\":[-0.25,0.125,1.5,2,3.25],\"min\":-0.25,\"max\":3.25},{\"attribute\":\"unicode\",\"count\":1,\"type\":\"string\",\"values\":[\"påíñtß 堤防\"]}]}]}}",
"maxzoom": "5",
"minzoom": "0",
"name": "tests/mlt/mvt-source.mbtiles",
"strategies": "[{\"dropped_by_rate\":2,\"tiny_polygons\":1},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":1}]",
"type": "overlay",
"version": "2"
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.926868 ], [ -122.431641, 37.857507 ], [ -122.519531, 37.926868 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.579413 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.579413 ], [ -122.431641, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.718590 ], [ -122.431641, 37.718590 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.431641, 37.579413 ], [ -122.431641, 37.370157 ], [ -122.783203, 37.370157 ], [ -122.783203, 37.579413 ], [ -122.431641, 37.579413 ] ], [ [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.519531, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.343750, 37.300275 ], [ -122.343750, 37.160317 ], [ -122.519531, 37.160317 ], [ -122.519531, 37.300275 ], [ -122.343750, 37.300275 ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.892196 ], [ -122.431641, 37.857507 ], [ -122.563477, 37.961523 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.614231 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.614231 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.683820 ], [ -122.519531, 37.753344 ], [ -122.387695, 37.683820 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.783203, 37.405074 ], [ -122.783203, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.439974 ], [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.695312, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.915039, 37.195331 ], [ -122.915039, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.563477, 37.230328 ], [ -122.431641, 37.230328 ], [ -122.431641, 37.265310 ], [ -122.563477, 37.265310 ], [ -122.563477, 37.230328 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 0, "y": 1 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.892196 ], [ -122.453613, 37.857507 ], [ -122.541504, 37.944198 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.607422, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.701207 ], [ -122.497559, 37.753344 ], [ -122.387695, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.805176, 37.405074 ], [ -122.805176, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.457418 ], [ -122.497559, 37.457418 ], [ -122.497559, 37.492294 ], [ -122.695312, 37.492294 ], [ -122.695312, 37.457418 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.893066, 37.195331 ], [ -122.893066, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.541504, 37.212832 ], [ -122.453613, 37.212832 ], [ -122.453613, 37.282795 ], [ -122.541504, 37.282795 ], [ -122.541504, 37.212832 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 1, "y": 3 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.453613, 37.848833 ], [ -122.552490, 37.952861 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.701207 ], [ -122.497559, 37.744657 ], [ -122.398682, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.544577 ], [ -122.398682, 37.396346 ], [ -122.794189, 37.396346 ], [ -122.794189, 37.544577 ], [ -122.398682, 37.544577 ] ], [ [ -122.695312, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.695312, 37.501010 ], [ -122.695312, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.904053, 37.195331 ], [ -122.904053, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.195331 ], [ -122.596436, 37.195331 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.552490, 37.221580 ], [ -122.453613, 37.221580 ], [ -122.453613, 37.282795 ], [ -122.552490, 37.282795 ], [ -122.552490, 37.221580 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 2, "y": 6 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.448120, 37.848833 ], [ -122.546997, 37.948529 ] ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.696861 ], [ -122.497559, 37.749001 ], [ -122.398682, 37.696861 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.898560, 37.199706 ], [ -122.898560, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.596436, 37.199706 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.546997, 37.217206 ], [ -122.448120, 37.217206 ], [ -122.448120, 37.278424 ], [ -122.546997, 37.278424 ], [ -122.546997, 37.217206 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 5, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.500305, 37.900865 ], [ -122.450867, 37.851001 ], [ -122.549744, 37.950695 ] ] } }
,
{ "type": "Feature", "id": 1, "properties": { "active": true, "count": 100, "kind": "point", "name": "point", "nested": "{\"a\":1,\"b\":\"two\"}", "ratio": 1.5 }, "geometry": { "type": "Point", "coordinates": [ -122.398682, 37.798933 ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.599000 ], [ -122.599182, 37.649034 ] ], [ [ -122.500305, 37.599000 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.599182, 37.699034 ], [ -122.500305, 37.749001 ], [ -122.398682, 37.699034 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.450877 ], [ -122.500305, 37.450877 ], [ -122.500305, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.450877 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.901306, 37.199706 ], [ -122.901306, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.599182, 37.199706 ], [ -122.599182, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.549744, 37.219393 ], [ -122.450867, 37.219393 ], [ -122.450867, 37.280609 ], [ -122.549744, 37.280609 ], [ -122.549744, 37.219393 ] ] ] ] } }
] }
] }
] }
-104
View File
@@ -1,104 +0,0 @@
{ "type": "FeatureCollection", "properties": {
"antimeridian_adjusted_bounds": "-122.915039,37.160317,-122.343750,37.961523",
"bounds": "-122.915039,37.160317,-122.343750,37.961523",
"center": "-122.350000,37.200000,5",
"description": "tests/mlt/roundtrip.mbtiles",
"format": "pbf",
"json": "{\"vector_layers\":[{\"id\":\"roundtrip\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":5,\"fields\":{\"active\":\"Boolean\",\"count\":\"Number\",\"kind\":\"String\",\"name\":\"String\",\"nested\":\"String\",\"ratio\":\"Number\",\"unicode\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"roundtrip\",\"count\":33,\"geometry\":\"LineString\",\"attributeCount\":7,\"attributes\":[{\"attribute\":\"active\",\"count\":2,\"type\":\"boolean\",\"values\":[false,true]},{\"attribute\":\"count\",\"count\":6,\"type\":\"number\",\"values\":[-200,100,300,4000000000,500,600],\"min\":-200,\"max\":4000000000},{\"attribute\":\"kind\",\"count\":3,\"type\":\"string\",\"values\":[\"line\",\"point\",\"polygon\"]},{\"attribute\":\"name\",\"count\":7,\"type\":\"string\",\"values\":[\"line\",\"multiline\",\"multipoint\",\"multipolygon\",\"no id\",\"point\",\"polygon with hole\"]},{\"attribute\":\"nested\",\"count\":1,\"type\":\"string\",\"values\":[\"{\\\"a\\\":1,\\\"b\\\":\\\"two\\\"}\"]},{\"attribute\":\"ratio\",\"count\":5,\"type\":\"number\",\"values\":[-0.25,0.125,1.5,2,3.25],\"min\":-0.25,\"max\":3.25},{\"attribute\":\"unicode\",\"count\":1,\"type\":\"string\",\"values\":[\"påíñtß 堤防\"]}]}]}}",
"maxzoom": "5",
"minzoom": "0",
"name": "tests/mlt/roundtrip.mbtiles",
"strategies": "[{\"dropped_by_rate\":2,\"tiny_polygons\":1},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":1}]",
"type": "overlay",
"version": "2"
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.926868 ], [ -122.431641, 37.857507 ], [ -122.519531, 37.926868 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.579413 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.579413 ], [ -122.431641, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.718590 ], [ -122.431641, 37.718590 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.431641, 37.579413 ], [ -122.431641, 37.370157 ], [ -122.783203, 37.370157 ], [ -122.783203, 37.579413 ], [ -122.431641, 37.579413 ] ], [ [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.519531, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.343750, 37.300275 ], [ -122.343750, 37.160317 ], [ -122.519531, 37.160317 ], [ -122.519531, 37.300275 ], [ -122.343750, 37.300275 ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.892196 ], [ -122.431641, 37.857507 ], [ -122.563477, 37.961523 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.614231 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.614231 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.683820 ], [ -122.519531, 37.753344 ], [ -122.387695, 37.683820 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.783203, 37.405074 ], [ -122.783203, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.439974 ], [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.695312, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.915039, 37.195331 ], [ -122.915039, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.563477, 37.230328 ], [ -122.431641, 37.230328 ], [ -122.431641, 37.265310 ], [ -122.563477, 37.265310 ], [ -122.563477, 37.230328 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 0, "y": 1 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.892196 ], [ -122.453613, 37.857507 ], [ -122.541504, 37.944198 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.607422, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.701207 ], [ -122.497559, 37.753344 ], [ -122.387695, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.805176, 37.405074 ], [ -122.805176, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.457418 ], [ -122.497559, 37.457418 ], [ -122.497559, 37.492294 ], [ -122.695312, 37.492294 ], [ -122.695312, 37.457418 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.893066, 37.195331 ], [ -122.893066, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.541504, 37.212832 ], [ -122.453613, 37.212832 ], [ -122.453613, 37.282795 ], [ -122.541504, 37.282795 ], [ -122.541504, 37.212832 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 1, "y": 3 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.453613, 37.848833 ], [ -122.552490, 37.952861 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.701207 ], [ -122.497559, 37.744657 ], [ -122.398682, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.544577 ], [ -122.398682, 37.396346 ], [ -122.794189, 37.396346 ], [ -122.794189, 37.544577 ], [ -122.398682, 37.544577 ] ], [ [ -122.695312, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.695312, 37.501010 ], [ -122.695312, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.904053, 37.195331 ], [ -122.904053, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.195331 ], [ -122.596436, 37.195331 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.552490, 37.221580 ], [ -122.453613, 37.221580 ], [ -122.453613, 37.282795 ], [ -122.552490, 37.282795 ], [ -122.552490, 37.221580 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 2, "y": 6 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.448120, 37.848833 ], [ -122.546997, 37.948529 ] ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.696861 ], [ -122.497559, 37.749001 ], [ -122.398682, 37.696861 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.898560, 37.199706 ], [ -122.898560, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.596436, 37.199706 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.546997, 37.217206 ], [ -122.448120, 37.217206 ], [ -122.448120, 37.278424 ], [ -122.546997, 37.278424 ], [ -122.546997, 37.217206 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 5, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.500305, 37.900865 ], [ -122.450867, 37.851001 ], [ -122.549744, 37.950695 ] ] } }
,
{ "type": "Feature", "id": 1, "properties": { "active": true, "count": 100, "kind": "point", "name": "point", "nested": "{\"a\":1,\"b\":\"two\"}", "ratio": 1.5 }, "geometry": { "type": "Point", "coordinates": [ -122.398682, 37.798933 ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.599000 ], [ -122.599182, 37.649034 ] ], [ [ -122.500305, 37.599000 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.599182, 37.699034 ], [ -122.500305, 37.749001 ], [ -122.398682, 37.699034 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.450877 ], [ -122.500305, 37.450877 ], [ -122.500305, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.450877 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.901306, 37.199706 ], [ -122.901306, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.599182, 37.199706 ], [ -122.599182, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.549744, 37.219393 ], [ -122.450867, 37.219393 ], [ -122.450867, 37.280609 ], [ -122.549744, 37.280609 ], [ -122.549744, 37.219393 ] ] ] ] } }
] }
] }
] }
-13
View File
@@ -1,13 +0,0 @@
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 2, "y": 6 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.892196 ], [ -122.453613, 37.857507 ], [ -122.541504, 37.944198 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.607422, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.701207 ], [ -122.497559, 37.753344 ], [ -122.387695, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.805176, 37.405074 ], [ -122.805176, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.457418 ], [ -122.497559, 37.457418 ], [ -122.497559, 37.492294 ], [ -122.695312, 37.492294 ], [ -122.695312, 37.457418 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.893066, 37.195331 ], [ -122.893066, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.541504, 37.212832 ], [ -122.453613, 37.212832 ], [ -122.453613, 37.282795 ], [ -122.541504, 37.282795 ], [ -122.541504, 37.212832 ] ] ] ] } }
] }
] }
-5
View File
@@ -1,5 +0,0 @@
{"type":"FeatureCollection","features":[
{"type":"Feature","id":1,"properties":{"name":"point1","count":100,"active":true},"geometry":{"type":"Point","coordinates":[-122.4,37.8]}},
{"type":"Feature","id":2,"properties":{"name":"point2","count":200,"active":false},"geometry":{"type":"Point","coordinates":[-122.5,37.9]}},
{"type":"Feature","id":3,"properties":{"name":"point3","count":300},"geometry":{"type":"Point","coordinates":[-122.6,38.0]}}
]}
-104
View File
@@ -1,104 +0,0 @@
{ "type": "FeatureCollection", "properties": {
"antimeridian_adjusted_bounds": "-122.900000,37.200000,-122.350000,37.950000",
"bounds": "-122.900000,37.200000,-122.350000,37.950000",
"center": "-122.350000,37.200000,5",
"description": "tests/mlt/roundtrip-dir",
"format": "mlt",
"json": "{\"vector_layers\":[{\"id\":\"roundtrip\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":5,\"fields\":{\"active\":\"Boolean\",\"count\":\"Number\",\"kind\":\"String\",\"name\":\"String\",\"nested\":\"String\",\"ratio\":\"Number\",\"unicode\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"roundtrip\",\"count\":7,\"geometry\":\"Point\",\"attributeCount\":7,\"attributes\":[{\"attribute\":\"active\",\"count\":2,\"type\":\"boolean\",\"values\":[false,true]},{\"attribute\":\"count\",\"count\":6,\"type\":\"number\",\"values\":[-200,100,300,4000000000,500,600],\"min\":-200,\"max\":4000000000},{\"attribute\":\"kind\",\"count\":3,\"type\":\"string\",\"values\":[\"line\",\"point\",\"polygon\"]},{\"attribute\":\"name\",\"count\":7,\"type\":\"string\",\"values\":[\"line\",\"multiline\",\"multipoint\",\"multipolygon\",\"no id\",\"point\",\"polygon with hole\"]},{\"attribute\":\"nested\",\"count\":1,\"type\":\"string\",\"values\":[\"{\\\"a\\\":1,\\\"b\\\":\\\"two\\\"}\"]},{\"attribute\":\"ratio\",\"count\":5,\"type\":\"number\",\"values\":[-0.25,0.125,1.5,2,3.25],\"min\":-0.25,\"max\":3.25},{\"attribute\":\"unicode\",\"count\":1,\"type\":\"string\",\"values\":[\"påíñtß 堤防\"]}]}]}}",
"maxzoom": "5",
"minzoom": "0",
"name": "tests/mlt/roundtrip-dir",
"strategies": "[{\"dropped_by_rate\":2,\"tiny_polygons\":1},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":1},{}]",
"type": "overlay",
"version": "2"
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.926868 ], [ -122.431641, 37.857507 ], [ -122.519531, 37.926868 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.579413 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.579413 ], [ -122.431641, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.718590 ], [ -122.431641, 37.718590 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.431641, 37.579413 ], [ -122.431641, 37.370157 ], [ -122.783203, 37.370157 ], [ -122.783203, 37.579413 ], [ -122.431641, 37.579413 ] ], [ [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.519531, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.343750, 37.300275 ], [ -122.343750, 37.160317 ], [ -122.519531, 37.160317 ], [ -122.519531, 37.300275 ], [ -122.343750, 37.300275 ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.892196 ], [ -122.431641, 37.857507 ], [ -122.563477, 37.961523 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.614231 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.614231 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.683820 ], [ -122.519531, 37.753344 ], [ -122.387695, 37.683820 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.783203, 37.405074 ], [ -122.783203, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.439974 ], [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.695312, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.915039, 37.195331 ], [ -122.915039, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.563477, 37.230328 ], [ -122.431641, 37.230328 ], [ -122.431641, 37.265310 ], [ -122.563477, 37.265310 ], [ -122.563477, 37.230328 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 0, "y": 1 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.892196 ], [ -122.453613, 37.857507 ], [ -122.541504, 37.944198 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.607422, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.701207 ], [ -122.497559, 37.753344 ], [ -122.387695, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.805176, 37.405074 ], [ -122.805176, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.457418 ], [ -122.497559, 37.457418 ], [ -122.497559, 37.492294 ], [ -122.695312, 37.492294 ], [ -122.695312, 37.457418 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.893066, 37.195331 ], [ -122.893066, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.541504, 37.212832 ], [ -122.453613, 37.212832 ], [ -122.453613, 37.282795 ], [ -122.541504, 37.282795 ], [ -122.541504, 37.212832 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 1, "y": 3 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.453613, 37.848833 ], [ -122.552490, 37.952861 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.701207 ], [ -122.497559, 37.744657 ], [ -122.398682, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.544577 ], [ -122.398682, 37.396346 ], [ -122.794189, 37.396346 ], [ -122.794189, 37.544577 ], [ -122.398682, 37.544577 ] ], [ [ -122.695312, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.695312, 37.501010 ], [ -122.695312, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.904053, 37.195331 ], [ -122.904053, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.195331 ], [ -122.596436, 37.195331 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.552490, 37.221580 ], [ -122.453613, 37.221580 ], [ -122.453613, 37.282795 ], [ -122.552490, 37.282795 ], [ -122.552490, 37.221580 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 2, "y": 6 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.448120, 37.848833 ], [ -122.546997, 37.948529 ] ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.696861 ], [ -122.497559, 37.749001 ], [ -122.398682, 37.696861 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.898560, 37.199706 ], [ -122.898560, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.596436, 37.199706 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.546997, 37.217206 ], [ -122.448120, 37.217206 ], [ -122.448120, 37.278424 ], [ -122.546997, 37.278424 ], [ -122.546997, 37.217206 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 5, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.500305, 37.900865 ], [ -122.450867, 37.851001 ], [ -122.549744, 37.950695 ] ] } }
,
{ "type": "Feature", "id": 1, "properties": { "active": true, "count": 100, "kind": "point", "name": "point", "nested": "{\"a\":1,\"b\":\"two\"}", "ratio": 1.5 }, "geometry": { "type": "Point", "coordinates": [ -122.398682, 37.798933 ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.599000 ], [ -122.599182, 37.649034 ] ], [ [ -122.500305, 37.599000 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.599182, 37.699034 ], [ -122.500305, 37.749001 ], [ -122.398682, 37.699034 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.450877 ], [ -122.500305, 37.450877 ], [ -122.500305, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.450877 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.901306, 37.199706 ], [ -122.901306, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.599182, 37.199706 ], [ -122.599182, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.549744, 37.219393 ], [ -122.450867, 37.219393 ], [ -122.450867, 37.280609 ], [ -122.549744, 37.280609 ], [ -122.549744, 37.219393 ] ] ] ] } }
] }
] }
] }
-9
View File
@@ -1,9 +0,0 @@
{"type":"FeatureCollection","features":[
{"type":"Feature","id":1,"properties":{"name":"point","kind":"point","count":100,"ratio":1.5,"active":true,"nested":{"a":1,"b":"two"}},"geometry":{"type":"Point","coordinates":[-122.4,37.8]}},
{"type":"Feature","id":2,"properties":{"name":"multipoint","kind":"point","count":-200,"ratio":-0.25,"active":false},"geometry":{"type":"MultiPoint","coordinates":[[-122.5,37.9],[-122.45,37.85],[-122.55,37.95]]}},
{"type":"Feature","id":3,"properties":{"name":"line","kind":"line","count":300,"ratio":2},"geometry":{"type":"LineString","coordinates":[[-122.6,37.7],[-122.5,37.75],[-122.4,37.7]]}},
{"type":"Feature","id":4,"properties":{"name":"multiline","kind":"line","count":4000000000,"ratio":0.125},"geometry":{"type":"MultiLineString","coordinates":[[[-122.7,37.6],[-122.6,37.65]],[[-122.5,37.6],[-122.4,37.65]]]}},
{"type":"Feature","id":5,"properties":{"name":"polygon with hole","kind":"polygon","count":500,"ratio":3.25,"active":true},"geometry":{"type":"Polygon","coordinates":[[[-122.8,37.4],[-122.4,37.4],[-122.4,37.55],[-122.8,37.55],[-122.8,37.4]],[[-122.7,37.45],[-122.7,37.5],[-122.5,37.5],[-122.5,37.45],[-122.7,37.45]]]}},
{"type":"Feature","id":6,"properties":{"name":"multipolygon","kind":"polygon","count":600},"geometry":{"type":"MultiPolygon","coordinates":[[[[-122.9,37.2],[-122.7,37.2],[-122.7,37.3],[-122.9,37.3],[-122.9,37.2]]],[[[-122.6,37.2],[-122.4,37.2],[-122.4,37.3],[-122.6,37.3],[-122.6,37.2]],[[-122.55,37.22],[-122.55,37.28],[-122.45,37.28],[-122.45,37.22],[-122.55,37.22]]]]}},
{"type":"Feature","properties":{"name":"no id","kind":"point","unicode":"påíñtß 堤防"},"geometry":{"type":"Point","coordinates":[-122.35,37.75]}}
]}
-104
View File
@@ -1,104 +0,0 @@
{ "type": "FeatureCollection", "properties": {
"antimeridian_adjusted_bounds": "-122.900000,37.200000,-122.350000,37.950000",
"bounds": "-122.900000,37.200000,-122.350000,37.950000",
"center": "-122.350000,37.200000,5",
"description": "tests/mlt/roundtrip.mbtiles",
"format": "mlt",
"json": "{\"vector_layers\":[{\"id\":\"roundtrip\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":5,\"fields\":{\"active\":\"Boolean\",\"count\":\"Number\",\"kind\":\"String\",\"name\":\"String\",\"nested\":\"String\",\"ratio\":\"Number\",\"unicode\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"roundtrip\",\"count\":7,\"geometry\":\"Point\",\"attributeCount\":7,\"attributes\":[{\"attribute\":\"active\",\"count\":2,\"type\":\"boolean\",\"values\":[false,true]},{\"attribute\":\"count\",\"count\":6,\"type\":\"number\",\"values\":[-200,100,300,4000000000,500,600],\"min\":-200,\"max\":4000000000},{\"attribute\":\"kind\",\"count\":3,\"type\":\"string\",\"values\":[\"line\",\"point\",\"polygon\"]},{\"attribute\":\"name\",\"count\":7,\"type\":\"string\",\"values\":[\"line\",\"multiline\",\"multipoint\",\"multipolygon\",\"no id\",\"point\",\"polygon with hole\"]},{\"attribute\":\"nested\",\"count\":1,\"type\":\"string\",\"values\":[\"{\\\"a\\\":1,\\\"b\\\":\\\"two\\\"}\"]},{\"attribute\":\"ratio\",\"count\":5,\"type\":\"number\",\"values\":[-0.25,0.125,1.5,2,3.25],\"min\":-0.25,\"max\":3.25},{\"attribute\":\"unicode\",\"count\":1,\"type\":\"string\",\"values\":[\"påíñtß 堤防\"]}]}]}}",
"maxzoom": "5",
"minzoom": "0",
"name": "tests/mlt/roundtrip.mbtiles",
"strategies": "[{\"dropped_by_rate\":2,\"tiny_polygons\":1},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":2},{\"dropped_by_rate\":1},{}]",
"type": "overlay",
"version": "2"
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.926868 ], [ -122.431641, 37.857507 ], [ -122.519531, 37.926868 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.579413 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.579413 ], [ -122.431641, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.718590 ], [ -122.431641, 37.718590 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.431641, 37.579413 ], [ -122.431641, 37.370157 ], [ -122.783203, 37.370157 ], [ -122.783203, 37.579413 ], [ -122.431641, 37.579413 ] ], [ [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.519531, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.343750, 37.300275 ], [ -122.343750, 37.160317 ], [ -122.519531, 37.160317 ], [ -122.519531, 37.300275 ], [ -122.343750, 37.300275 ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.519531, 37.892196 ], [ -122.431641, 37.857507 ], [ -122.563477, 37.961523 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.614231 ], [ -122.607422, 37.649034 ] ], [ [ -122.519531, 37.614231 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.683820 ], [ -122.519531, 37.753344 ], [ -122.387695, 37.683820 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.783203, 37.405074 ], [ -122.783203, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.439974 ], [ -122.519531, 37.439974 ], [ -122.519531, 37.509726 ], [ -122.695312, 37.509726 ], [ -122.695312, 37.439974 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.915039, 37.195331 ], [ -122.915039, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.563477, 37.230328 ], [ -122.431641, 37.230328 ], [ -122.431641, 37.265310 ], [ -122.563477, 37.265310 ], [ -122.563477, 37.230328 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 0, "y": 1 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.892196 ], [ -122.453613, 37.857507 ], [ -122.541504, 37.944198 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.607422, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.387695, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.607422, 37.701207 ], [ -122.497559, 37.753344 ], [ -122.387695, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.387695, 37.544577 ], [ -122.387695, 37.405074 ], [ -122.805176, 37.405074 ], [ -122.805176, 37.544577 ], [ -122.387695, 37.544577 ] ], [ [ -122.695312, 37.457418 ], [ -122.497559, 37.457418 ], [ -122.497559, 37.492294 ], [ -122.695312, 37.492294 ], [ -122.695312, 37.457418 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.893066, 37.195331 ], [ -122.893066, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.387695, 37.300275 ], [ -122.387695, 37.195331 ], [ -122.607422, 37.195331 ], [ -122.607422, 37.300275 ], [ -122.387695, 37.300275 ] ], [ [ -122.541504, 37.212832 ], [ -122.453613, 37.212832 ], [ -122.453613, 37.282795 ], [ -122.541504, 37.282795 ], [ -122.541504, 37.212832 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 1, "y": 3 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.453613, 37.848833 ], [ -122.552490, 37.952861 ] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.695312, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.701207 ], [ -122.497559, 37.744657 ], [ -122.398682, 37.701207 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.544577 ], [ -122.398682, 37.396346 ], [ -122.794189, 37.396346 ], [ -122.794189, 37.544577 ], [ -122.398682, 37.544577 ] ], [ [ -122.695312, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.695312, 37.501010 ], [ -122.695312, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.695312, 37.300275 ], [ -122.695312, 37.195331 ], [ -122.904053, 37.195331 ], [ -122.904053, 37.300275 ], [ -122.695312, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.195331 ], [ -122.596436, 37.195331 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.552490, 37.221580 ], [ -122.453613, 37.221580 ], [ -122.453613, 37.282795 ], [ -122.552490, 37.282795 ], [ -122.552490, 37.221580 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 2, "y": 6 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.497559, 37.900865 ], [ -122.448120, 37.848833 ], [ -122.546997, 37.948529 ] ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.596824 ], [ -122.596436, 37.649034 ] ], [ [ -122.497559, 37.596824 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.596436, 37.696861 ], [ -122.497559, 37.749001 ], [ -122.398682, 37.696861 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.448697 ], [ -122.497559, 37.448697 ], [ -122.497559, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.448697 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.898560, 37.199706 ], [ -122.898560, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.596436, 37.199706 ], [ -122.596436, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.546997, 37.217206 ], [ -122.448120, 37.217206 ], [ -122.448120, 37.278424 ], [ -122.546997, 37.278424 ], [ -122.546997, 37.217206 ] ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 5, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "roundtrip", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "id": 2, "properties": { "active": false, "count": -200, "kind": "point", "name": "multipoint", "ratio": -0.25 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -122.500305, 37.900865 ], [ -122.450867, 37.851001 ], [ -122.549744, 37.950695 ] ] } }
,
{ "type": "Feature", "id": 1, "properties": { "active": true, "count": 100, "kind": "point", "name": "point", "nested": "{\"a\":1,\"b\":\"two\"}", "ratio": 1.5 }, "geometry": { "type": "Point", "coordinates": [ -122.398682, 37.798933 ] } }
,
{ "type": "Feature", "properties": { "kind": "point", "name": "no id", "unicode": "påíñtß 堤防" }, "geometry": { "type": "Point", "coordinates": [ -122.349243, 37.749001 ] } }
,
{ "type": "Feature", "id": 4, "properties": { "count": 4000000000, "kind": "line", "name": "multiline", "ratio": 0.125 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -122.700806, 37.599000 ], [ -122.599182, 37.649034 ] ], [ [ -122.500305, 37.599000 ], [ -122.398682, 37.649034 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "count": 300, "kind": "line", "name": "line", "ratio": 2 }, "geometry": { "type": "LineString", "coordinates": [ [ -122.599182, 37.699034 ], [ -122.500305, 37.749001 ], [ -122.398682, 37.699034 ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "active": true, "count": 500, "kind": "polygon", "name": "polygon with hole", "ratio": 3.25 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.398682, 37.548933 ], [ -122.398682, 37.400710 ], [ -122.799683, 37.400710 ], [ -122.799683, 37.548933 ], [ -122.398682, 37.548933 ] ], [ [ -122.700806, 37.450877 ], [ -122.500305, 37.450877 ], [ -122.500305, 37.501010 ], [ -122.700806, 37.501010 ], [ -122.700806, 37.450877 ] ] ] } }
,
{ "type": "Feature", "id": 6, "properties": { "count": 600, "kind": "polygon", "name": "multipolygon" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.700806, 37.300275 ], [ -122.700806, 37.199706 ], [ -122.901306, 37.199706 ], [ -122.901306, 37.300275 ], [ -122.700806, 37.300275 ] ] ], [ [ [ -122.398682, 37.300275 ], [ -122.398682, 37.199706 ], [ -122.599182, 37.199706 ], [ -122.599182, 37.300275 ], [ -122.398682, 37.300275 ] ], [ [ -122.549744, 37.219393 ], [ -122.450867, 37.219393 ], [ -122.450867, 37.280609 ], [ -122.549744, 37.280609 ], [ -122.549744, 37.219393 ] ] ] ] } }
] }
] }
] }
+4 -14
View File
@@ -24,7 +24,6 @@
#include <math.h>
#include <pthread.h>
#include "mvt.hpp"
#include "mlt.hpp"
#include "projection.hpp"
#include "mbtiles.hpp"
#include "geometry.hpp"
@@ -337,7 +336,7 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
outfeature.geometry[i].x = outfeature.geometry[i].x * outlayer.extent / layer.extent;
outfeature.geometry[i].y = outfeature.geometry[i].y * outlayer.extent / layer.extent;
}
}
}
for (auto const &g : outfeature.geometry) {
if (g.op == mvt_moveto || g.op == mvt_lineto) {
@@ -873,7 +872,7 @@ void *join_worker(void *v) {
}
if (anything) {
std::string pbf = encode_tile(outtile, output_format);
std::string pbf = outtile.encode();
std::string compressed;
if (!pC) {
@@ -960,7 +959,7 @@ void dispatch_tasks(std::map<zxy, std::vector<std::string>> &tasks, std::vector<
if (outdb != NULL) {
mbtiles_write_tile(outdb, ai->first.z, ai->first.x, ai->first.y, ai->second.data(), ai->second.size());
} else if (outdir != NULL) {
dir_write_tile(outdir, ai->first.z, ai->first.x, ai->first.y, ai->second, tile_format_extension(output_format));
dir_write_tile(outdir, ai->first.z, ai->first.x, ai->first.y, ai->second);
}
}
}
@@ -1299,9 +1298,6 @@ static const struct option long_options[] = {
{"Setting or disabling tile size limits", 0, 0, 0},
{"no-tile-size-limit", no_argument, &pk, 1},
{"no-tile-compression", no_argument, &pC, 1},
{"output-format", required_argument, 0, '~'},
{"pretessellate", no_argument, 0, '~'},
{"no-mlt-feature-sort", no_argument, 0, '~'},
{"no-tile-stats", no_argument, &pg, 1},
{"tile-stats-attributes-limit", required_argument, 0, '~'},
{"tile-stats-sample-values-limit", required_argument, 0, '~'},
@@ -1544,12 +1540,6 @@ int main(int argc, char **argv) {
exclude_all_tile_attributes = true;
} else if (strcmp(opt, "exclude-all-tile-geometries") == 0) {
exclude_all_tile_geometries = true;
} else if (strcmp(opt, "output-format") == 0) {
set_output_format(argv, optarg);
} else if (strcmp(opt, "pretessellate") == 0) {
mlt_pretessellate = true;
} else if (strcmp(opt, "no-mlt-feature-sort") == 0) {
mlt_sort_features = false;
} else {
fprintf(stderr, "%s: Unrecognized option --%s\n", argv[0], opt);
exit(EXIT_ARGS);
@@ -1671,7 +1661,7 @@ int main(int argc, char **argv) {
st.maxlon2 = st.maxlon;
}
metadata m = make_metadata(name.c_str(), st.minzoom, st.maxzoom, st.minlat, st.minlon, st.maxlat, st.maxlon, st.minlat2, st.minlon2, st.maxlat2, st.maxlon2, st.midlat, st.midlon, attribution.size() != 0 ? attribution.c_str() : NULL, layermap, tile_format_name(output_format), description.c_str(), !pg, attribute_descriptions, "tile-join", generator_options, strategies, st.maxzoom, 2.5, 1);
metadata m = make_metadata(name.c_str(), st.minzoom, st.maxzoom, st.minlat, st.minlon, st.maxlat, st.maxlon, st.minlat2, st.minlon2, st.maxlat2, st.maxlon2, st.midlat, st.midlon, attribution.size() != 0 ? attribution.c_str() : NULL, layermap, true, description.c_str(), !pg, attribute_descriptions, "tile-join", generator_options, strategies, st.maxzoom, 2.5, 1);
if (outdb != NULL) {
mbtiles_write_metadata(outdb, m, true);
+11 -12
View File
@@ -39,7 +39,6 @@
#include "serial.hpp"
#include "options.hpp"
#include "main.hpp"
#include "mlt.hpp"
#include "write_json.hpp"
#include "milo/dtoa_milo.h"
#include "evaluator.hpp"
@@ -833,7 +832,7 @@ static double choose_minattribute(std::vector<double> &attribute_values, double
if (descending) {
// For descending: drop features > threshold, keep features <= threshold
// ix points at the last value to keep
size_t ix = (size_t)((attribute_values.size() - 1) * f);
size_t ix = (size_t) ((attribute_values.size() - 1) * f);
while (ix > 0 && attribute_values[ix] >= existing_attribute) {
ix--;
}
@@ -846,7 +845,7 @@ static double choose_minattribute(std::vector<double> &attribute_values, double
} else {
// For ascending: drop features < threshold, keep features >= threshold
// ix points at the first value to keep
size_t ix = (size_t)ceil((double)(attribute_values.size() - 1) * (1 - f));
size_t ix = (size_t) ceil((double) (attribute_values.size() - 1) * (1 - f));
if (ix >= attribute_values.size()) {
ix = attribute_values.size() - 1;
}
@@ -1745,7 +1744,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
key_pool key_pool;
std::vector<std::atomic<bool> > within(child_shards);
std::vector<std::atomic<bool>> within(child_shards);
std::vector<long long> start_geompos(child_shards);
for (size_t i = 0; i < (size_t) child_shards; i++) {
within[i] = false;
@@ -2114,8 +2113,8 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
if (attr_valid) {
add_sample_to(attribute_values, attr_numeric, attribute_values_increment, seq);
bool should_drop = arg->drop_by_attribute_descending
? (minattribute != HUGE_VAL && attr_numeric > minattribute)
: (minattribute != -HUGE_VAL && attr_numeric < minattribute);
? (minattribute != HUGE_VAL && attr_numeric > minattribute)
: (minattribute != -HUGE_VAL && attr_numeric < minattribute);
if (should_drop) {
can_stop_early = false;
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, strategy, drop_rest, arg->attribute_accum, key_pool)) {
@@ -2778,7 +2777,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
}
} else if (additional[A_DROP_BY_ATTRIBUTE_AS_NEEDED]) {
minattribute_fraction = minattribute_fraction *
adjusted_max_tile_features / adjusted_feature_count * 0.75;
adjusted_max_tile_features / adjusted_feature_count * 0.75;
if (minattribute_fraction > 0.80) {
if (!quiet) {
fprintf(stderr,
@@ -2851,7 +2850,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
}
std::string compressed;
std::string pbf = encode_tile(tile, output_format);
std::string pbf = tile.encode();
tile.layers.clear();
@@ -3026,7 +3025,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
if (outdb != NULL) {
mbtiles_write_tile(outdb, z, tx, ty, compressed.data(), compressed.size());
} else if (outdir != NULL) {
dir_write_tile(outdir, z, tx, ty, compressed, tile_format_extension(output_format));
dir_write_tile(outdir, z, tx, ty, compressed);
}
if (pthread_mutex_unlock(&db_lock) != 0) {
@@ -3252,7 +3251,7 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
std::vector<compressor> compressors(TEMP_FILES);
std::vector<compressor *> sub(TEMP_FILES);
std::vector<std::atomic<long long> > subpos(TEMP_FILES);
std::vector<std::atomic<long long>> subpos(TEMP_FILES);
std::vector<int> subfd(TEMP_FILES);
for (size_t j = 0; j < TEMP_FILES; j++) {
std::string geomname = std::string(tmpdir) + "/geom" + std::to_string(j) + ".XXXXXXXX";
@@ -3460,8 +3459,8 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
again = true;
}
bool attr_propagate = drop_by_attribute_descending
? args[thread].minattribute_out < zoom_minattribute
: args[thread].minattribute_out > zoom_minattribute;
? args[thread].minattribute_out < zoom_minattribute
: args[thread].minattribute_out > zoom_minattribute;
if (attr_propagate) {
zoom_minattribute = args[thread].minattribute_out;
again = true;
+2 -2
View File
@@ -145,8 +145,8 @@ TEST_CASE("Polygon cleaning drops a hole that no ring can parent", "[wagyu]") {
// through the "Could not properly place hole to a parent." handler in
// clean_or_clip_poly instead of returning.
static const std::vector<std::vector<std::pair<long long, long long>>> rings = {
{{0, 5}, {5, 4}, {5, 1}, {4, 4}, {4, 2}, {7, 1}, {0, 5}},
{{0, 5}, {7, 1}, {4, 2}, {4, 4}, {5, 1}, {5, 4}, {0, 0}, {0, 5}},
{{0, 5}, {5, 4}, {5, 1}, {4, 4}, {4, 2}, {7, 1}, {0, 5}},
{{0, 5}, {7, 1}, {4, 2}, {4, 4}, {5, 1}, {5, 4}, {0, 0}, {0, 5}},
};
drawvec geom;