2014-11-24 18:35:06 +00:00
|
|
|
PREFIX ?= /usr/local
|
2015-10-29 23:46:57 +00:00
|
|
|
MANDIR ?= $(PREFIX)/share/man/man1/
|
2016-04-26 22:39:42 +00:00
|
|
|
BUILDTYPE ?= Release
|
2016-07-13 20:00:38 +00:00
|
|
|
SHELL = /bin/bash
|
2014-02-22 00:55:36 +00:00
|
|
|
|
2015-12-23 00:26:24 +00:00
|
|
|
# inherit from env if set
|
|
|
|
CC := $(CC)
|
2016-03-24 21:36:36 +00:00
|
|
|
CXX := $(CXX)
|
2015-12-23 00:26:24 +00:00
|
|
|
CFLAGS := $(CFLAGS)
|
2017-01-26 21:25:06 +00:00
|
|
|
CXXFLAGS := $(CXXFLAGS) -std=c++11
|
2015-12-23 00:26:24 +00:00
|
|
|
LDFLAGS := $(LDFLAGS)
|
2017-11-17 19:21:48 +00:00
|
|
|
WARNING_FLAGS := -Wall -Wshadow -Wsign-compare -Wextra -Wunreachable-code -Wuninitialized -Wshadow
|
2016-04-26 22:39:42 +00:00
|
|
|
RELEASE_FLAGS := -O3 -DNDEBUG
|
|
|
|
DEBUG_FLAGS := -O0 -DDEBUG -fno-inline-functions -fno-omit-frame-pointer
|
|
|
|
|
|
|
|
ifeq ($(BUILDTYPE),Release)
|
|
|
|
FINAL_FLAGS := -g $(WARNING_FLAGS) $(RELEASE_FLAGS)
|
|
|
|
else
|
|
|
|
FINAL_FLAGS := -g $(WARNING_FLAGS) $(DEBUG_FLAGS)
|
|
|
|
endif
|
2015-12-23 00:26:24 +00:00
|
|
|
|
2017-10-10 18:37:30 +00:00
|
|
|
all: tippecanoe tippecanoe-enumerate tippecanoe-decode tile-join unit tippecanoe-json-tool
|
2015-07-28 19:48:49 +00:00
|
|
|
|
|
|
|
docs: man/tippecanoe.1
|
2014-02-22 00:55:36 +00:00
|
|
|
|
2017-10-10 18:37:30 +00:00
|
|
|
install: tippecanoe tippecanoe-enumerate tippecanoe-decode tile-join tippecanoe-json-tool
|
2014-12-02 19:38:48 +00:00
|
|
|
mkdir -p $(PREFIX)/bin
|
2015-10-29 23:46:57 +00:00
|
|
|
mkdir -p $(MANDIR)
|
2014-09-26 21:53:10 +00:00
|
|
|
cp tippecanoe $(PREFIX)/bin/tippecanoe
|
2015-11-03 22:04:28 +00:00
|
|
|
cp tippecanoe-enumerate $(PREFIX)/bin/tippecanoe-enumerate
|
|
|
|
cp tippecanoe-decode $(PREFIX)/bin/tippecanoe-decode
|
2017-10-10 18:37:30 +00:00
|
|
|
cp tippecanoe-json-tool $(PREFIX)/bin/tippecanoe-json-tool
|
2015-11-03 22:04:28 +00:00
|
|
|
cp tile-join $(PREFIX)/bin/tile-join
|
2015-10-29 23:46:57 +00:00
|
|
|
cp man/tippecanoe.1 $(MANDIR)/tippecanoe.1
|
2014-02-06 06:04:58 +00:00
|
|
|
|
2016-12-13 22:16:32 +00:00
|
|
|
uninstall:
|
2017-10-10 18:37:30 +00:00
|
|
|
rm $(PREFIX)/bin/tippecanoe $(PREFIX)/bin/tippecanoe-enumerate $(PREFIX)/bin/tippecanoe-decode $(PREFIX)/bin/tile-join $(MANDIR)/tippecanoe.1 $(PREFIX)/bin/tippecanoe-json-tool
|
2016-12-13 22:16:32 +00:00
|
|
|
|
2015-05-29 16:06:41 +00:00
|
|
|
man/tippecanoe.1: README.md
|
|
|
|
md2man-roff README.md > man/tippecanoe.1
|
|
|
|
|
2014-09-18 23:23:36 +00:00
|
|
|
PG=
|
|
|
|
|
2016-04-27 20:55:28 +00:00
|
|
|
H = $(wildcard *.h) $(wildcard *.hpp)
|
|
|
|
C = $(wildcard *.c) $(wildcard *.cpp)
|
2014-10-27 16:52:25 +00:00
|
|
|
|
2016-04-23 00:10:33 +00:00
|
|
|
INCLUDES = -I/usr/local/include -I.
|
2014-11-16 07:46:39 +00:00
|
|
|
LIBS = -L/usr/local/lib
|
|
|
|
|
2018-08-08 19:13:21 +00:00
|
|
|
tippecanoe: geojson.o jsonpull/jsonpull.o tile.o pool.o mbtiles.o geometry.o projection.o memfile.o mvt.o serial.o main.o text.o dirtiles.o plugin.o read_json.o write_json.o geobuf.o evaluator.o geocsv.o csv.o geojson-loop.o
|
2016-04-26 22:39:42 +00:00
|
|
|
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
2014-09-15 22:18:08 +00:00
|
|
|
|
2015-11-03 22:04:28 +00:00
|
|
|
tippecanoe-enumerate: enumerate.o
|
2018-07-12 18:24:30 +00:00
|
|
|
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lsqlite3
|
2014-10-23 21:04:57 +00:00
|
|
|
|
2017-11-30 23:37:46 +00:00
|
|
|
tippecanoe-decode: decode.o projection.o mvt.o write_json.o text.o jsonpull/jsonpull.o dirtiles.o
|
2016-12-05 22:12:39 +00:00
|
|
|
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
|
2014-10-23 22:40:27 +00:00
|
|
|
|
2018-03-16 22:19:23 +00:00
|
|
|
tile-join: tile-join.o projection.o pool.o mbtiles.o mvt.o memfile.o dirtiles.o jsonpull/jsonpull.o text.o evaluator.o csv.o write_json.o
|
2016-09-20 23:00:03 +00:00
|
|
|
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
2015-08-20 20:02:34 +00:00
|
|
|
|
2018-08-08 19:13:21 +00:00
|
|
|
tippecanoe-json-tool: jsontool.o jsonpull/jsonpull.o csv.o text.o geojson-loop.o
|
2017-08-30 22:25:47 +00:00
|
|
|
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
|
|
|
|
2016-10-05 21:54:28 +00:00
|
|
|
unit: unit.o text.o
|
|
|
|
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
|
|
|
|
2016-10-12 20:21:29 +00:00
|
|
|
-include $(wildcard *.d)
|
2014-09-22 17:44:30 +00:00
|
|
|
|
2016-10-12 20:21:29 +00:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) -MMD $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -MMD $(PG) $(INCLUDES) $(FINAL_FLAGS) $(CXXFLAGS) -c -o $@ $<
|
2016-04-27 19:25:03 +00:00
|
|
|
|
2014-09-26 21:53:10 +00:00
|
|
|
clean:
|
2018-08-23 06:16:50 +00:00
|
|
|
rm -f ./tippecanoe ./tippecanoe-* ./tile-join ./unit *.o *.d */*.o */*.d tests/**/*.mbtiles tests/**/*.check
|
2015-06-03 18:21:40 +00:00
|
|
|
|
|
|
|
indent:
|
2016-06-16 19:33:38 +00:00
|
|
|
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}" $(C) $(H)
|
2016-01-28 18:52:43 +00:00
|
|
|
|
|
|
|
TESTS = $(wildcard tests/*/out/*.json)
|
|
|
|
SPACE = $(NULL) $(NULL)
|
|
|
|
|
2018-05-24 19:41:14 +00:00
|
|
|
test: tippecanoe tippecanoe-decode $(addsuffix .check,$(TESTS)) raw-tiles-test parallel-test pbf-test join-test enumerate-test decode-test join-filter-test unit json-tool-test allow-existing-test csv-test layer-json-test
|
2016-10-05 21:54:28 +00:00
|
|
|
./unit
|
2016-01-28 18:52:43 +00:00
|
|
|
|
2018-05-14 17:44:03 +00:00
|
|
|
suffixes = json json.gz
|
|
|
|
|
2016-03-29 22:01:03 +00:00
|
|
|
# Work around Makefile and filename punctuation limits: _ for space, @ for :, % for /
|
2016-01-28 18:52:43 +00:00
|
|
|
%.json.check:
|
2019-04-05 20:15:46 +00:00
|
|
|
./tippecanoe -q -a@ -f -o $@.mbtiles $(subst @,:,$(subst %,/,$(subst _, ,$(patsubst %.json.check,%,$(word 4,$(subst /, ,$@)))))) $(foreach suffix,$(suffixes),$(sort $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.$(suffix)))) < /dev/null
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator $@.mbtiles > $@.out
|
2017-07-21 19:28:14 +00:00
|
|
|
cmp $@.out $(patsubst %.check,%,$@)
|
2016-01-28 18:52:43 +00:00
|
|
|
rm $@.out $@.mbtiles
|
2016-01-28 22:06:51 +00:00
|
|
|
|
2017-11-09 22:10:29 +00:00
|
|
|
# Don't test overflow with geobuf, because it fails (https://github.com/mapbox/geobuf/issues/87)
|
2018-11-02 22:28:51 +00:00
|
|
|
# Don't test stringids with geobuf, because it fails
|
|
|
|
nogeobuf = tests/overflow/out/-z0.json $(wildcard tests/stringid/out/*.json)
|
|
|
|
geobuf-test: tippecanoe-json-tool $(addsuffix .checkbuf,$(filter-out $(nogeobuf),$(TESTS)))
|
2017-08-29 21:44:34 +00:00
|
|
|
|
2017-09-05 21:02:43 +00:00
|
|
|
# For quicker address sanitizer build, hope that regular JSON parsing is tested enough by parallel and join tests
|
|
|
|
fewer-tests: tippecanoe tippecanoe-decode geobuf-test raw-tiles-test parallel-test pbf-test join-test enumerate-test decode-test join-filter-test unit
|
|
|
|
|
2017-08-29 21:44:34 +00:00
|
|
|
# XXX Use proper makefile rules instead of a for loop
|
|
|
|
%.json.checkbuf:
|
2017-10-10 18:37:30 +00:00
|
|
|
for i in $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.json); do ./tippecanoe-json-tool -w $$i | ./node_modules/geobuf/bin/json2geobuf > $$i.geobuf; done
|
2018-05-11 23:34:18 +00:00
|
|
|
for i in $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.json.gz); do gzip -dc $$i | ./tippecanoe-json-tool -w | ./node_modules/geobuf/bin/json2geobuf > $$i.geobuf; done
|
2019-04-05 20:15:46 +00:00
|
|
|
./tippecanoe -q -a@ -f -o $@.mbtiles $(subst @,:,$(subst %,/,$(subst _, ,$(patsubst %.json.checkbuf,%,$(word 4,$(subst /, ,$@)))))) $(foreach suffix,$(suffixes),$(addsuffix .geobuf,$(sort $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.$(suffix))))) < /dev/null
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator $@.mbtiles | sed 's/checkbuf/check/g' | sed 's/\.geobuf//g' > $@.out
|
2017-08-29 21:44:34 +00:00
|
|
|
cmp $@.out $(patsubst %.checkbuf,%,$@)
|
|
|
|
rm $@.out $@.mbtiles
|
|
|
|
|
2016-02-02 20:21:19 +00:00
|
|
|
parallel-test:
|
|
|
|
mkdir -p tests/parallel
|
2016-12-09 18:47:03 +00:00
|
|
|
perl -e 'for ($$i = 0; $$i < 20; $$i++) { $$lon = rand(360) - 180; $$lat = rand(180) - 90; $$k = rand(1); $$v = rand(1); print "{ \"type\": \"Feature\", \"properties\": { \"yes\": \"no\", \"who\": 1, \"$$k\": \"$$v\" }, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ $$lon, $$lat ] } }\n"; }' > tests/parallel/in1.json
|
2016-02-02 23:43:27 +00:00
|
|
|
perl -e 'for ($$i = 0; $$i < 300000; $$i++) { $$lon = rand(360) - 180; $$lat = rand(180) - 90; print "{ \"type\": \"Feature\", \"properties\": { }, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ $$lon, $$lat ] } }\n"; }' > tests/parallel/in2.json
|
|
|
|
perl -e 'for ($$i = 0; $$i < 20; $$i++) { $$lon = rand(360) - 180; $$lat = rand(180) - 90; print "{ \"type\": \"Feature\", \"properties\": { }, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ $$lon, $$lat ] } }\n"; }' > tests/parallel/in3.json
|
2016-12-09 18:47:03 +00:00
|
|
|
perl -e 'for ($$i = 0; $$i < 20; $$i++) { $$lon = rand(360) - 180; $$lat = rand(180) - 90; $$v = rand(1); print "{ \"type\": \"Feature\", \"properties\": { }, \"tippecanoe\": { \"layer\": \"$$v\" }, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ $$lon, $$lat ] } }\n"; }' > tests/parallel/in4.json
|
2016-07-13 20:00:38 +00:00
|
|
|
echo -n "" > tests/parallel/empty1.json
|
|
|
|
echo "" > tests/parallel/empty2.json
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -z5 -f -pi -l test -n test -o tests/parallel/linear-file.mbtiles tests/parallel/in[1234].json tests/parallel/empty[12].json
|
|
|
|
./tippecanoe -q -z5 -f -pi -l test -n test -P -o tests/parallel/parallel-file.mbtiles tests/parallel/in[1234].json tests/parallel/empty[12].json
|
|
|
|
cat tests/parallel/in[1234].json | ./tippecanoe -q -z5 -f -pi -l test -n test -o tests/parallel/linear-pipe.mbtiles
|
|
|
|
cat tests/parallel/in[1234].json | ./tippecanoe -q -z5 -f -pi -l test -n test -P -o tests/parallel/parallel-pipe.mbtiles
|
|
|
|
cat tests/parallel/in[1234].json | sed 's/^/@/' | tr '@' '\036' | ./tippecanoe -q -z5 -f -pi -l test -n test -o tests/parallel/implicit-pipe.mbtiles
|
|
|
|
./tippecanoe -q -z5 -f -pi -l test -n test -P -o tests/parallel/parallel-pipes.mbtiles <(cat tests/parallel/in1.json) <(cat tests/parallel/empty1.json) <(cat tests/parallel/empty2.json) <(cat tests/parallel/in2.json) /dev/null <(cat tests/parallel/in3.json) <(cat tests/parallel/in4.json)
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/parallel/linear-file.mbtiles > tests/parallel/linear-file.json
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/parallel/parallel-file.mbtiles > tests/parallel/parallel-file.json
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/parallel/linear-pipe.mbtiles > tests/parallel/linear-pipe.json
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/parallel/parallel-pipe.mbtiles > tests/parallel/parallel-pipe.json
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/parallel/implicit-pipe.mbtiles > tests/parallel/implicit-pipe.json
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/parallel/parallel-pipes.mbtiles > tests/parallel/parallel-pipes.json
|
2016-02-02 20:21:19 +00:00
|
|
|
cmp tests/parallel/linear-file.json tests/parallel/parallel-file.json
|
|
|
|
cmp tests/parallel/linear-file.json tests/parallel/linear-pipe.json
|
|
|
|
cmp tests/parallel/linear-file.json tests/parallel/parallel-pipe.json
|
2017-04-28 17:41:20 +00:00
|
|
|
cmp tests/parallel/linear-file.json tests/parallel/implicit-pipe.json
|
2016-07-13 20:00:38 +00:00
|
|
|
cmp tests/parallel/linear-file.json tests/parallel/parallel-pipes.json
|
2016-02-02 20:21:19 +00:00
|
|
|
rm tests/parallel/*.mbtiles tests/parallel/*.json
|
|
|
|
|
2018-08-23 06:16:50 +00:00
|
|
|
raw-tiles-test:
|
2018-09-24 18:16:13 +00:00
|
|
|
./tippecanoe -q -f -e tests/raw-tiles/raw-tiles -r1 -pC tests/raw-tiles/hackspots.geojson
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/raw-tiles/raw-tiles > tests/raw-tiles/raw-tiles.json.check
|
2018-06-07 18:19:19 +00:00
|
|
|
cmp tests/raw-tiles/raw-tiles.json.check tests/raw-tiles/raw-tiles.json
|
2019-03-19 01:01:32 +00:00
|
|
|
# Test that -z and -Z work in tippecanoe-decode
|
|
|
|
./tippecanoe-decode -x generator -Z6 -z7 tests/raw-tiles/raw-tiles > tests/raw-tiles/raw-tiles-z67.json.check
|
|
|
|
cmp tests/raw-tiles/raw-tiles-z67.json.check tests/raw-tiles/raw-tiles-z67.json
|
|
|
|
# Test that -z and -Z work in tile-join
|
|
|
|
./tile-join -q -f -Z6 -z7 -e tests/raw-tiles/raw-tiles-z67 tests/raw-tiles/raw-tiles
|
|
|
|
./tippecanoe-decode -x generator tests/raw-tiles/raw-tiles-z67 > tests/raw-tiles/raw-tiles-z67-join.json.check
|
|
|
|
cmp tests/raw-tiles/raw-tiles-z67-join.json.check tests/raw-tiles/raw-tiles-z67-join.json
|
|
|
|
rm -rf tests/raw-tiles/raw-tiles tests/raw-tiles/raw-tiles-z67 tests/raw-tiles/raw-tiles.json.check raw-tiles-z67.json.check tests/raw-tiles/raw-tiles-z67-join.json.check
|
2018-09-24 18:16:13 +00:00
|
|
|
# Test that metadata.json is created even if all features are clipped away
|
|
|
|
./tippecanoe -q -f -e tests/raw-tiles/nothing tests/raw-tiles/nothing.geojson
|
|
|
|
./tippecanoe-decode -x generator tests/raw-tiles/nothing > tests/raw-tiles/nothing.json.check
|
|
|
|
cmp tests/raw-tiles/nothing.json.check tests/raw-tiles/nothing.json
|
|
|
|
rm -r tests/raw-tiles/nothing tests/raw-tiles/nothing.json.check
|
2017-04-05 14:59:37 +00:00
|
|
|
|
2017-03-02 00:01:57 +00:00
|
|
|
decode-test:
|
|
|
|
mkdir -p tests/muni/decode
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -z11 -Z11 -f -o tests/muni/decode/multi.mbtiles tests/muni/*.json
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator -l subway tests/muni/decode/multi.mbtiles > tests/muni/decode/multi.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator -c tests/muni/decode/multi.mbtiles > tests/muni/decode/multi.mbtiles.pipeline.json.check
|
|
|
|
./tippecanoe-decode -x generator tests/muni/decode/multi.mbtiles 11 327 791 > tests/muni/decode/multi.mbtiles.onetile.json.check
|
|
|
|
./tippecanoe-decode -x generator --stats tests/muni/decode/multi.mbtiles > tests/muni/decode/multi.mbtiles.stats.json.check
|
2017-03-02 00:01:57 +00:00
|
|
|
cmp tests/muni/decode/multi.mbtiles.json.check tests/muni/decode/multi.mbtiles.json
|
2018-03-15 19:35:38 +00:00
|
|
|
cmp tests/muni/decode/multi.mbtiles.pipeline.json.check tests/muni/decode/multi.mbtiles.pipeline.json
|
2018-03-14 23:35:59 +00:00
|
|
|
cmp tests/muni/decode/multi.mbtiles.onetile.json.check tests/muni/decode/multi.mbtiles.onetile.json
|
2017-10-10 00:05:29 +00:00
|
|
|
cmp tests/muni/decode/multi.mbtiles.stats.json.check tests/muni/decode/multi.mbtiles.stats.json
|
2018-03-15 19:35:38 +00:00
|
|
|
rm -f tests/muni/decode/multi.mbtiles.json.check tests/muni/decode/multi.mbtiles tests/muni/decode/multi.mbtiles.pipeline.json.check tests/muni/decode/multi.mbtiles.stats.json.check tests/muni/decode/multi.mbtiles.onetile.json.check
|
2017-03-02 00:01:57 +00:00
|
|
|
|
2016-03-23 00:12:09 +00:00
|
|
|
pbf-test:
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/pbf/11-328-791.vector.pbf 11 328 791 > tests/pbf/11-328-791.vector.pbf.out
|
2016-03-23 00:12:09 +00:00
|
|
|
cmp tests/pbf/11-328-791.json tests/pbf/11-328-791.vector.pbf.out
|
|
|
|
rm tests/pbf/11-328-791.vector.pbf.out
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator -s EPSG:3857 tests/pbf/11-328-791.vector.pbf 11 328 791 > tests/pbf/11-328-791.3857.vector.pbf.out
|
2016-06-28 22:18:27 +00:00
|
|
|
cmp tests/pbf/11-328-791.3857.json tests/pbf/11-328-791.3857.vector.pbf.out
|
|
|
|
rm tests/pbf/11-328-791.3857.vector.pbf.out
|
2016-03-23 00:12:09 +00:00
|
|
|
|
2016-10-12 23:26:36 +00:00
|
|
|
enumerate-test:
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -z5 -f -o tests/ne_110m_admin_0_countries/out/enum.mbtiles tests/ne_110m_admin_0_countries/in.json.gz
|
2016-10-12 23:26:36 +00:00
|
|
|
./tippecanoe-enumerate tests/ne_110m_admin_0_countries/out/enum.mbtiles > tests/ne_110m_admin_0_countries/out/enum.check
|
|
|
|
cmp tests/ne_110m_admin_0_countries/out/enum tests/ne_110m_admin_0_countries/out/enum.check
|
|
|
|
rm tests/ne_110m_admin_0_countries/out/enum.mbtiles tests/ne_110m_admin_0_countries/out/enum.check
|
|
|
|
|
2018-03-16 22:19:23 +00:00
|
|
|
join-test: tile-join
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -f -z12 -o tests/join-population/tabblock_06001420.mbtiles -YALAND10:'Land area' -L'{"file": "tests/join-population/tabblock_06001420.json", "description": "population"}'
|
|
|
|
./tippecanoe -q -f -Z5 -z10 -o tests/join-population/macarthur.mbtiles -l macarthur tests/join-population/macarthur.json
|
|
|
|
./tile-join -q -f -Z6 -z9 -o tests/join-population/macarthur-6-9.mbtiles tests/join-population/macarthur.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/join-population/macarthur-6-9.mbtiles > tests/join-population/macarthur-6-9.mbtiles.json.check
|
2017-08-16 20:46:07 +00:00
|
|
|
cmp tests/join-population/macarthur-6-9.mbtiles.json.check tests/join-population/macarthur-6-9.mbtiles.json
|
2018-08-07 17:27:38 +00:00
|
|
|
./tile-join -q -f -Z6 -z9 -X -o tests/join-population/macarthur-6-9-exclude.mbtiles tests/join-population/macarthur.mbtiles
|
|
|
|
./tippecanoe-decode -x generator tests/join-population/macarthur-6-9-exclude.mbtiles > tests/join-population/macarthur-6-9-exclude.mbtiles.json.check
|
|
|
|
cmp tests/join-population/macarthur-6-9-exclude.mbtiles.json.check tests/join-population/macarthur-6-9-exclude.mbtiles.json
|
|
|
|
rm -f tests/join-population/macarthur-6-9.mbtiles.json.check tests/join-population/macarthur-6-9.mbtiles tests/join-population/macarthur-6-9-exclude.mbtiles.json.check tests/join-population/macarthur-6-9-exclude.mbtiles
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -f -d10 -D10 -Z9 -z11 -o tests/join-population/macarthur2.mbtiles -l macarthur tests/join-population/macarthur2.json
|
2017-07-07 19:37:08 +00:00
|
|
|
./tile-join --quiet --force -o tests/join-population/joined.mbtiles -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
|
2018-07-19 21:18:57 +00:00
|
|
|
./tile-join --quiet --force -o tests/join-population/joined-null.mbtiles --empty-csv-columns-are-null -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
|
2017-08-15 17:41:00 +00:00
|
|
|
./tile-join --quiet --force --no-tile-stats -o tests/join-population/joined-no-tile-stats.mbtiles -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
|
2018-06-07 20:27:49 +00:00
|
|
|
./tile-join -q -f -i -o tests/join-population/joined-i.mbtiles -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
|
|
|
|
./tile-join -q -f -o tests/join-population/merged.mbtiles tests/join-population/tabblock_06001420.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur2.mbtiles
|
|
|
|
./tile-join -q -f -c tests/join-population/windows.csv -o tests/join-population/windows.mbtiles tests/join-population/macarthur.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator --maximum-zoom=11 --minimum-zoom=4 tests/join-population/joined.mbtiles > tests/join-population/joined.mbtiles.json.check
|
2018-07-19 21:18:57 +00:00
|
|
|
./tippecanoe-decode -x generator --maximum-zoom=11 --minimum-zoom=4 tests/join-population/joined-null.mbtiles > tests/join-population/joined-null.mbtiles.json.check
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator --maximum-zoom=11 --minimum-zoom=4 tests/join-population/joined-no-tile-stats.mbtiles > tests/join-population/joined-no-tile-stats.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator tests/join-population/joined-i.mbtiles > tests/join-population/joined-i.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator tests/join-population/merged.mbtiles > tests/join-population/merged.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator tests/join-population/windows.mbtiles > tests/join-population/windows.mbtiles.json.check
|
2016-05-03 18:30:53 +00:00
|
|
|
cmp tests/join-population/joined.mbtiles.json.check tests/join-population/joined.mbtiles.json
|
2018-07-19 21:18:57 +00:00
|
|
|
cmp tests/join-population/joined-null.mbtiles.json.check tests/join-population/joined-null.mbtiles.json
|
2017-08-15 17:41:00 +00:00
|
|
|
cmp tests/join-population/joined-no-tile-stats.mbtiles.json.check tests/join-population/joined-no-tile-stats.mbtiles.json
|
2016-05-03 18:30:53 +00:00
|
|
|
cmp tests/join-population/joined-i.mbtiles.json.check tests/join-population/joined-i.mbtiles.json
|
2016-09-20 22:53:10 +00:00
|
|
|
cmp tests/join-population/merged.mbtiles.json.check tests/join-population/merged.mbtiles.json
|
2016-12-13 22:16:32 +00:00
|
|
|
cmp tests/join-population/windows.mbtiles.json.check tests/join-population/windows.mbtiles.json
|
2018-07-19 21:18:57 +00:00
|
|
|
rm -f tests/join-population/joined-null.mbtiles tests/join-population/joined-null.mbtiles.json.check
|
2019-04-05 18:30:57 +00:00
|
|
|
./tile-join -q -f -l macarthur -n "macarthur name" -N "macarthur description" -A "macarthur's attribution" -o tests/join-population/just-macarthur.mbtiles tests/join-population/merged.mbtiles
|
2018-06-07 20:27:49 +00:00
|
|
|
./tile-join -q -f -L macarthur -o tests/join-population/no-macarthur.mbtiles tests/join-population/merged.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/join-population/just-macarthur.mbtiles > tests/join-population/just-macarthur.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator tests/join-population/no-macarthur.mbtiles > tests/join-population/no-macarthur.mbtiles.json.check
|
2017-04-10 22:22:30 +00:00
|
|
|
cmp tests/join-population/just-macarthur.mbtiles.json.check tests/join-population/just-macarthur.mbtiles.json
|
2018-08-23 06:16:50 +00:00
|
|
|
cmp tests/join-population/no-macarthur.mbtiles.json.check tests/join-population/no-macarthur.mbtiles.json
|
2018-06-07 20:27:49 +00:00
|
|
|
./tile-join -q --no-tile-compression -f -e tests/join-population/raw-merged-folder tests/join-population/tabblock_06001420.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur2.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/join-population/raw-merged-folder > tests/join-population/raw-merged-folder.json.check
|
2018-06-07 18:19:19 +00:00
|
|
|
cmp tests/join-population/raw-merged-folder.json.check tests/join-population/raw-merged-folder.json
|
|
|
|
rm -f tests/join-population/raw-merged-folder.json.check
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -z12 -f -e tests/join-population/tabblock_06001420-folder -YALAND10:'Land area' -L'{"file": "tests/join-population/tabblock_06001420.json", "description": "population"}'
|
|
|
|
./tippecanoe -q -Z5 -z10 -f -e tests/join-population/macarthur-folder -l macarthur tests/join-population/macarthur.json
|
|
|
|
./tippecanoe -q -d10 -D10 -Z9 -z11 -f -e tests/join-population/macarthur2-folder -l macarthur tests/join-population/macarthur2.json
|
|
|
|
./tile-join -q -f -o tests/join-population/merged-folder.mbtiles tests/join-population/tabblock_06001420-folder tests/join-population/macarthur-folder tests/join-population/macarthur2-folder
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/join-population/merged-folder.mbtiles > tests/join-population/merged-folder.mbtiles.json.check
|
2017-05-26 12:49:45 +00:00
|
|
|
cmp tests/join-population/merged-folder.mbtiles.json.check tests/join-population/merged-folder.mbtiles.json
|
2018-06-07 20:27:49 +00:00
|
|
|
./tile-join -q -n "merged name" -N "merged description" -f -e tests/join-population/merged-mbtiles-to-folder tests/join-population/tabblock_06001420.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur2.mbtiles
|
|
|
|
./tile-join -q -n "merged name" -N "merged description" -f -e tests/join-population/merged-folders-to-folder tests/join-population/tabblock_06001420-folder tests/join-population/macarthur-folder tests/join-population/macarthur2-folder
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/join-population/merged-mbtiles-to-folder > tests/join-population/merged-mbtiles-to-folder.json.check
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/join-population/merged-folders-to-folder > tests/join-population/merged-folders-to-folder.json.check
|
2018-06-07 18:19:19 +00:00
|
|
|
cmp tests/join-population/merged-mbtiles-to-folder.json.check tests/join-population/merged-folders-to-folder.json.check
|
|
|
|
rm -f tests/join-population/merged-mbtiles-to-folder.json.check tests/join-population/merged-folders-to-folder.json.check
|
2018-06-07 20:27:49 +00:00
|
|
|
./tile-join -q -f -c tests/join-population/windows.csv -o tests/join-population/windows-merged.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur2-folder
|
|
|
|
./tile-join -q -c tests/join-population/windows.csv -f -e tests/join-population/windows-merged-folder tests/join-population/macarthur.mbtiles tests/join-population/macarthur2-folder
|
|
|
|
./tile-join -q -f -o tests/join-population/windows-merged2.mbtiles tests/join-population/windows-merged-folder
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/join-population/windows-merged.mbtiles > tests/join-population/windows-merged.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/join-population/windows-merged2.mbtiles > tests/join-population/windows-merged2.mbtiles.json.check
|
2017-05-26 12:49:45 +00:00
|
|
|
cmp tests/join-population/windows-merged.mbtiles.json.check tests/join-population/windows-merged2.mbtiles.json.check
|
2018-06-07 20:27:49 +00:00
|
|
|
./tile-join -q -f -o tests/join-population/macarthur-and-macarthur2-merged.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur2-folder
|
|
|
|
./tile-join -q -f -e tests/join-population/macarthur-and-macarthur2-folder tests/join-population/macarthur.mbtiles tests/join-population/macarthur2-folder
|
|
|
|
./tile-join -q -f -o tests/join-population/macarthur-and-macarthur2-merged2.mbtiles tests/join-population/macarthur-and-macarthur2-folder
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/join-population/macarthur-and-macarthur2-merged.mbtiles > tests/join-population/macarthur-and-macarthur2-merged.mbtiles.json.check
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/join-population/macarthur-and-macarthur2-merged2.mbtiles > tests/join-population/macarthur-and-macarthur2-merged2.mbtiles.json.check
|
2017-05-26 12:49:45 +00:00
|
|
|
cmp tests/join-population/macarthur-and-macarthur2-merged.mbtiles.json.check tests/join-population/macarthur-and-macarthur2-merged2.mbtiles.json.check
|
|
|
|
rm tests/join-population/tabblock_06001420.mbtiles tests/join-population/joined.mbtiles tests/join-population/joined-i.mbtiles tests/join-population/joined.mbtiles.json.check tests/join-population/joined-i.mbtiles.json.check tests/join-population/macarthur.mbtiles tests/join-population/merged.mbtiles tests/join-population/merged.mbtiles.json.check tests/join-population/merged-folder.mbtiles tests/join-population/macarthur2.mbtiles tests/join-population/windows.mbtiles tests/join-population/windows-merged.mbtiles tests/join-population/windows-merged2.mbtiles tests/join-population/windows.mbtiles.json.check tests/join-population/just-macarthur.mbtiles tests/join-population/no-macarthur.mbtiles tests/join-population/just-macarthur.mbtiles.json.check tests/join-population/no-macarthur.mbtiles.json.check tests/join-population/merged-folder.mbtiles.json.check tests/join-population/windows-merged.mbtiles.json.check tests/join-population/windows-merged2.mbtiles.json.check tests/join-population/macarthur-and-macarthur2-merged.mbtiles tests/join-population/macarthur-and-macarthur2-merged2.mbtiles tests/join-population/macarthur-and-macarthur2-merged.mbtiles.json.check tests/join-population/macarthur-and-macarthur2-merged2.mbtiles.json.check
|
|
|
|
rm -rf tests/join-population/raw-merged-folder tests/join-population/tabblock_06001420-folder tests/join-population/macarthur-folder tests/join-population/macarthur2-folder tests/join-population/merged-mbtiles-to-folder tests/join-population/merged-folders-to-folder tests/join-population/windows-merged-folder tests/join-population/macarthur-and-macarthur2-folder
|
2017-10-27 18:00:47 +00:00
|
|
|
# Test renaming of layers
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -f -Z5 -z10 -o tests/join-population/macarthur.mbtiles -l macarthur1 tests/join-population/macarthur.json
|
|
|
|
./tippecanoe -q -f -Z5 -z10 -o tests/join-population/macarthur2.mbtiles -l macarthur2 tests/join-population/macarthur2.json
|
|
|
|
./tile-join -q -R macarthur1:one --rename-layer=macarthur2:two -f -o tests/join-population/renamed.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur2.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/join-population/renamed.mbtiles > tests/join-population/renamed.mbtiles.json.check
|
2017-10-27 18:00:47 +00:00
|
|
|
cmp tests/join-population/renamed.mbtiles.json.check tests/join-population/renamed.mbtiles.json
|
|
|
|
rm -f tests/join-population/renamed.mbtiles.json.check tests/join-population/renamed.mbtiles.json.check tests/join-population/macarthur.mbtiles tests/join-population/macarthur2.mbtiles
|
2018-08-21 00:45:18 +00:00
|
|
|
# Make sure the concatenated name isn't too long
|
|
|
|
./tippecanoe -q -f -z0 -n 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json
|
2019-04-05 00:01:02 +00:00
|
|
|
./tile-join -f -o tests/join-population/concat.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles
|
2018-08-21 00:45:18 +00:00
|
|
|
./tippecanoe-decode -x generator tests/join-population/concat.mbtiles > tests/join-population/concat.mbtiles.json.check
|
|
|
|
cmp tests/join-population/concat.mbtiles.json.check tests/join-population/concat.mbtiles.json
|
|
|
|
rm tests/join-population/concat.mbtiles.json.check tests/join-population/concat.mbtiles tests/join-population/macarthur.mbtiles
|
2016-05-03 18:30:53 +00:00
|
|
|
|
2017-09-05 20:29:57 +00:00
|
|
|
join-filter-test:
|
|
|
|
# Comes out different from the direct tippecanoe run because null attributes are lost
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -z0 -f -o tests/feature-filter/out/all.mbtiles tests/feature-filter/in.json
|
|
|
|
./tile-join -q -J tests/feature-filter/filter -f -o tests/feature-filter/out/filtered.mbtiles tests/feature-filter/out/all.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/feature-filter/out/filtered.mbtiles > tests/feature-filter/out/filtered.json.check
|
2017-09-05 21:02:43 +00:00
|
|
|
cmp tests/feature-filter/out/filtered.json.check tests/feature-filter/out/filtered.json.standard
|
2017-09-05 20:29:57 +00:00
|
|
|
rm -f tests/feature-filter/out/filtered.json.check tests/feature-filter/out/filtered.mbtiles tests/feature-filter/out/all.mbtiles
|
2018-04-05 20:42:54 +00:00
|
|
|
# Test zoom level filtering
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -r1 -z8 -f -o tests/feature-filter/out/places.mbtiles tests/ne_110m_populated_places/in.json
|
|
|
|
./tile-join -q -J tests/feature-filter/places-filter -f -o tests/feature-filter/out/places-filter.mbtiles tests/feature-filter/out/places.mbtiles
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator tests/feature-filter/out/places-filter.mbtiles > tests/feature-filter/out/places-filter.mbtiles.json.check
|
2018-04-05 20:42:54 +00:00
|
|
|
cmp tests/feature-filter/out/places-filter.mbtiles.json.check tests/feature-filter/out/places-filter.mbtiles.json.standard
|
|
|
|
rm -f tests/feature-filter/out/places.mbtiles tests/feature-filter/out/places-filter.mbtiles tests/feature-filter/out/places-filter.mbtiles.json.check
|
2017-09-05 20:29:57 +00:00
|
|
|
|
2017-11-17 22:05:37 +00:00
|
|
|
json-tool-test: tippecanoe-json-tool
|
|
|
|
./tippecanoe-json-tool -e GEOID10 tests/join-population/tabblock_06001420.json | sort > tests/join-population/tabblock_06001420.json.sort
|
|
|
|
./tippecanoe-json-tool -c tests/join-population/population.csv tests/join-population/tabblock_06001420.json.sort > tests/join-population/tabblock_06001420.json.sort.joined
|
2018-07-19 21:18:57 +00:00
|
|
|
./tippecanoe-json-tool --empty-csv-columns-are-null -c tests/join-population/population.csv tests/join-population/tabblock_06001420.json.sort > tests/join-population/tabblock_06001420-null.json.sort.joined
|
2017-11-17 22:05:37 +00:00
|
|
|
cmp tests/join-population/tabblock_06001420.json.sort.joined tests/join-population/tabblock_06001420.json.sort.joined.standard
|
2018-07-19 21:18:57 +00:00
|
|
|
cmp tests/join-population/tabblock_06001420-null.json.sort.joined tests/join-population/tabblock_06001420-null.json.sort.joined.standard
|
2017-11-17 22:05:37 +00:00
|
|
|
rm -f tests/join-population/tabblock_06001420.json.sort tests/join-population/tabblock_06001420.json.sort.joined
|
2018-07-19 21:18:57 +00:00
|
|
|
rm -f tests/join-population/tabblock_06001420-null.json.sort.joined
|
2017-11-17 22:05:37 +00:00
|
|
|
|
2017-11-30 00:24:48 +00:00
|
|
|
allow-existing-test:
|
2017-11-30 23:56:35 +00:00
|
|
|
# Make a tileset
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -Z0 -z0 -f -o tests/allow-existing/both.mbtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
2017-11-30 23:56:35 +00:00
|
|
|
# Writing to existing should fail
|
2018-06-07 20:27:49 +00:00
|
|
|
if ./tippecanoe -q -Z1 -z1 -o tests/allow-existing/both.mbtiles tests/coalesce-tract/tl_2010_06001_tract10.json; then exit 1; else exit 0; fi
|
2017-11-30 23:56:35 +00:00
|
|
|
# Replace existing
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -Z8 -z9 -f -o tests/allow-existing/both.mbtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe -q -Z10 -z11 -F -o tests/allow-existing/both.mbtiles tests/coalesce-tract/tl_2010_06001_tract10.json
|
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/allow-existing/both.mbtiles > tests/allow-existing/both.mbtiles.json.check
|
2017-11-30 00:24:48 +00:00
|
|
|
cmp tests/allow-existing/both.mbtiles.json.check tests/allow-existing/both.mbtiles.json
|
2017-11-30 23:56:35 +00:00
|
|
|
# Make a tileset
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -Z0 -z0 -f -e tests/allow-existing/both.dir tests/coalesce-tract/tl_2010_06001_tract10.json
|
2017-11-30 23:56:35 +00:00
|
|
|
# Writing to existing should fail
|
2018-06-07 20:27:49 +00:00
|
|
|
if ./tippecanoe -q -Z1 -z1 -e tests/allow-existing/both.dir tests/coalesce-tract/tl_2010_06001_tract10.json; then exit 1; else exit 0; fi
|
2017-11-30 23:56:35 +00:00
|
|
|
# Replace existing
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -Z8 -z9 -f -e tests/allow-existing/both.dir tests/coalesce-tract/tl_2010_06001_tract10.json
|
|
|
|
./tippecanoe -q -Z10 -z11 -F -e tests/allow-existing/both.dir tests/coalesce-tract/tl_2010_06001_tract10.json
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/allow-existing/both.dir | sed 's/both\.dir/both.mbtiles/g' > tests/allow-existing/both.dir.json.check
|
2017-11-30 00:24:48 +00:00
|
|
|
cmp tests/allow-existing/both.dir.json.check tests/allow-existing/both.mbtiles.json
|
|
|
|
rm -r tests/allow-existing/both.dir.json.check tests/allow-existing/both.dir tests/allow-existing/both.mbtiles.json.check tests/allow-existing/both.mbtiles
|
|
|
|
|
2017-12-13 19:32:19 +00:00
|
|
|
csv-test:
|
2018-07-17 21:57:56 +00:00
|
|
|
# Reading from named CSV
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -zg -f -o tests/csv/out.mbtiles tests/csv/ne_110m_populated_places_simple.csv
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/csv/out.mbtiles > tests/csv/out.mbtiles.json.check
|
2017-12-13 19:32:19 +00:00
|
|
|
cmp tests/csv/out.mbtiles.json.check tests/csv/out.mbtiles.json
|
|
|
|
rm -f tests/csv/out.mbtiles.json.check tests/csv/out.mbtiles
|
2018-07-19 21:18:57 +00:00
|
|
|
# Reading from named CSV, with nulls
|
|
|
|
./tippecanoe -q --empty-csv-columns-are-null -zg -f -o tests/csv/out-null.mbtiles tests/csv/ne_110m_populated_places_simple.csv
|
|
|
|
./tippecanoe-decode -x generator tests/csv/out-null.mbtiles > tests/csv/out-null.mbtiles.json.check
|
|
|
|
cmp tests/csv/out-null.mbtiles.json.check tests/csv/out-null.mbtiles.json
|
|
|
|
rm -f tests/csv/out-null.mbtiles.json.check tests/csv/out-null.mbtiles
|
2018-07-17 21:57:56 +00:00
|
|
|
# Same, but specifying csv with -L format
|
2018-08-01 23:16:50 +00:00
|
|
|
./tippecanoe -q -zg -f -o tests/csv/out.mbtiles -L'{"file":"", "format":"csv", "layer":"ne_110m_populated_places_simple"}' < tests/csv/ne_110m_populated_places_simple.csv
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/csv/out.mbtiles > tests/csv/out.mbtiles.json.check
|
2018-07-17 21:57:56 +00:00
|
|
|
cmp tests/csv/out.mbtiles.json.check tests/csv/out.mbtiles.json
|
|
|
|
rm -f tests/csv/out.mbtiles.json.check tests/csv/out.mbtiles
|
2017-12-13 19:32:19 +00:00
|
|
|
|
2018-05-24 19:41:14 +00:00
|
|
|
layer-json-test:
|
2018-07-17 21:57:56 +00:00
|
|
|
# GeoJSON with description and named layer
|
2018-06-07 20:27:49 +00:00
|
|
|
./tippecanoe -q -z0 -r1 -yNAME -f -o tests/layer-json/out.mbtiles -L'{"file":"tests/ne_110m_populated_places/in.json", "description":"World cities", "layer":"places"}'
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/layer-json/out.mbtiles > tests/layer-json/out.mbtiles.json.check
|
2018-05-24 19:41:14 +00:00
|
|
|
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
|
2018-07-17 21:57:56 +00:00
|
|
|
# Same, but reading from the standard input
|
|
|
|
./tippecanoe -q -z0 -r1 -yNAME -f -o tests/layer-json/out.mbtiles -L'{"file":"", "description":"World cities", "layer":"places"}' < tests/ne_110m_populated_places/in.json
|
2019-04-05 00:01:02 +00:00
|
|
|
./tippecanoe-decode -x generator -x generator_options tests/layer-json/out.mbtiles > tests/layer-json/out.mbtiles.json.check
|
2018-07-17 21:57:56 +00:00
|
|
|
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
|
2018-05-24 19:41:14 +00:00
|
|
|
|
2016-01-28 22:06:51 +00:00
|
|
|
# Use this target to regenerate the standards that the tests are compared against
|
|
|
|
# after making a change that legitimately changes their output
|
|
|
|
|
|
|
|
prep-test: $(TESTS)
|
|
|
|
|
|
|
|
tests/%.json: Makefile tippecanoe tippecanoe-decode
|
2019-04-05 20:15:46 +00:00
|
|
|
./tippecanoe -q -a@ -f -o $@.check.mbtiles $(subst @,:,$(subst %,/,$(subst _, ,$(patsubst %.json,%,$(word 4,$(subst /, ,$@)))))) $(foreach suffix,$(suffixes),$(sort $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.$(suffix))))
|
2018-06-07 22:06:42 +00:00
|
|
|
./tippecanoe-decode -x generator $@.check.mbtiles > $@
|
2016-01-28 22:06:51 +00:00
|
|
|
cmp $(patsubst %.check,%,$@) $@
|
2016-01-28 22:38:10 +00:00
|
|
|
rm $@.check.mbtiles
|