Compare commits

..
Author SHA1 Message Date
Claude 5f1eb94fcc Merge main into the MLT branch
main moved each tool's option table to file scope so that usage.cpp can
generate the usage message from it (#409), which conflicted with the
tables the MLT options had been added to. The three MLT options move to
the file-scope tables, under the same headings they were listed with
before: "Setting or disabling tile size limits" in tippecanoe and
tile-join, and "Output tile" in tippecanoe-overzoom.

Also combine the new radix-sort-test with the MLT tests in the test
target, add usage.o to the tools that gained MLT objects, keep both the
MLT=0 and the new docs CI jobs, and regenerate the man page for the
README changes, which the docs job now checks.
2026-08-07 17:04:02 +00:00
Claude 70a355204f Update maplibre-tile-spec to a version that builds on ARM
The MLT build fails on aarch64: FastPFOR's cmake passes -msse4.2 to the
compiler in every SIMD mode, including the portable one that MLT selects,
so the build dies with "unrecognized command-line option '-msse4.2'" on
ubuntu-24.04-arm, and on Apple Silicon for the same reason. Nothing about
the MLT integration is architecture-specific, so this is as true of the
output format as of the decoder; it went unnoticed because CI never ran
on the branch that added it.

Upstream fixed it in maplibre/maplibre-tile-spec#1492, by vendoring a
FastPFOR snapshot with the SIMD codecs removed -- which is no loss, since
the SIMD encoder's output isn't compatible with the non-SIMD decoder and
was never used. Move the submodule forward four commits to pick that up
along with the platform fixes in #1497.

FastPFOR is no longer a cmake option there, so drop the two -D flags for
it from the configure step and follow the library's rename from FastPFOR
to fastpfor-lib. FastPFOR decoding is still compiled in, so no tile
becomes unreadable, and the checked-in standards are unchanged. The
submodule also no longer needs its own fastpfor and simde submodules, so
the recursive checkout gets a little smaller.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxhELiLtpUFwrPSWwTYdHG
2026-08-06 18:49:34 +00:00
Claude c70d98afe8 Add a MLT=0 build for a tippecanoe without MapLibre Tile support
MapLibre Tile support pulls in the maplibre-tile-spec submodule and needs
cmake to build it, which is a lot to ask of anyone who only wants to work
with Mapbox Vector Tiles.

`make MLT=0` compiles with -DNO_MLT, skips the submodule and its cmake
build entirely, and drops the MLT tests from `make test`. The result needs
no dependencies beyond the ones MVT already needed, and can be built from
a checkout with no submodules at all.

Everything that touches the MLT library is behind the #ifdef, which is
just the two files that were written for it. The option parsing and the
tile format helpers stay compiled either way, so nothing else needs to
know: --output-format=mlt reports that the build has no MLT support rather
than being an unrecognized value, and a tile that is recognized as MLT
reports the same instead of being misparsed as a protobuf, since the
format sniffing itself doesn't need the library.

CI builds and tests this configuration from a checkout without submodules,
so it can't quietly stop working.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxhELiLtpUFwrPSWwTYdHG
2026-08-06 18:05:42 +00:00
Claude 13f1c3b6e4 Let tile-join and tippecanoe-overzoom write MLT tiles too
Both tools could read MapLibre Tiles but only ever wrote Mapbox Vector
Tiles, so there was no way to convert a tileset into MLT, or to keep a
tileset in MLT once it had been through either of them.

Give them the same --output-format, --pretessellate, and
--no-mlt-feature-sort options that tippecanoe has. tile-join writes the
chosen format to mbtiles files, PMTiles archives, and tile directories,
naming directory tiles and the tileset metadata format accordingly, and
tippecanoe-overzoom writes it to its output tile. Either tool will read
whichever format its sources are in regardless of what it is writing.

The output format selection and the MLT encoder options now live in
mlt.cpp, shared by all three tools rather than defined in main.cpp for
tippecanoe alone, along with encode_tile() for encoding a tile in the
selected format. overzoom() takes the format as a parameter, since
tile-join uses it internally to rescale tiles that will be re-encoded
afterward, and those intermediate tiles should stay MVT.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxhELiLtpUFwrPSWwTYdHG
2026-08-06 17:34:02 +00:00
Claude 2410727242 Read MapLibre Tiles in tippecanoe-decode, tile-join, and tippecanoe-overzoom
Tilesets written with --output-format=mlt could not be read back by any of
tippecanoe's own tools, which made MLT a dead end rather than a tile format.

Build the mlt-cpp decoder from the vendored maplibre-tile-spec submodule
alongside the encoder, and convert a decoded MapLibre Tile back into the
equivalent mvt_tile: geometry, feature ids, and property columns. MLT rings
come back explicitly closed, so the repeated final point becomes an MVT
closepath, and the property columns, which are held in an unordered map,
are sorted by name so that the attributes of a decoded tile come out in a
stable order.

Rather than adding an option to each tool, mvt_tile::decode() detects the
encoding and dispatches, so everywhere tippecanoe already reads a vector
tile can read MLT. An MLT tile begins with a varint layer length followed
by a varint layer tag whose only defined value is 1, while an MVT tile is
a protobuf whose only field is the repeated layer field 3, so it begins
with 0x1a followed by a layer length that can never be as short as the one
byte that would be needed to look like an MLT layer tag.

Tile directories also needed a fix: enumerate_dirtiles() recognized .mlt
file names but still recorded .pbf as the extension to read them back
with, so decoding an MLT directory failed to find any of its tiles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxhELiLtpUFwrPSWwTYdHG
2026-08-06 17:12:28 +00:00
Claude 0d75e7350f Give each MLT property column a single type that fits all of its values
An MLT property column has one type for the whole layer, while MVT values
are individually typed. Converting each value on its own left the encoder
to reconcile the mismatch, and its fallback for a column holding both
integers and doubles is to encode the whole column as strings, so an
attribute like gdp_md_est in tests/ne_110m_admin_0_countries turned into
values like "904.200000".

Summarize each attribute across the layer first and pick one type that can
hold all of its values, so mixed integer and floating point columns become
doubles. Only columns that mix numbers with strings, or booleans with
numbers, still fall back to strings, which is as close as MLT's typed
columns can get.

Also stop encoding JSON-object-valued attributes as MLT struct columns.
Struct children can only be strings, and a struct column is flattened into
"column name + child name" when it is read back, so an attribute `meta`
holding {"en": "one", "de": "eins"} decoded as separate `metaen` and
`metade` attributes. Nested JSON now stays JSON text, the way MVT
carries it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxhELiLtpUFwrPSWwTYdHG
2026-08-06 17:12:09 +00:00
Claude c0ae01fcaa Merge PR #393 (MLT output format) into main 2026-08-06 16:44:49 +00:00
Danila Poyarkov 776a7b3b84 Tighten MLT wording 2026-07-04 19:56:35 +03:00
Danila Poyarkov 0e536bcec4 Update MLT encoder dependency 2026-07-03 15:11:19 +03:00
Danila Poyarkov 116e40cbdf Support nested JSON properties as MLT STRUCT columns
Detect JSON object strings at MLT output time and convert to STRUCT columns.
Nested objects/arrays within are re-stringified. MVT output unchanged.
2026-07-02 17:29:24 +03:00
Danila Poyarkov 53b98d76c4 Add MLT (MapLibre Tile) output format
Integrate the C++ MLT encoder from maplibre-tile-spec as a submodule.
Tiles are encoded by converting the existing mvt_tile to
mlt::Encoder::Layer and calling the encoder library directly.

New CLI flags:
  --output-format=mlt     Encode tiles as MLT instead of MVT
  --pretessellate         Pre-triangulate polygons (MLT only)
  --no-mlt-feature-sort   Disable within-tile Hilbert sorting (MLT only)

MLT tiles use .mlt extension in directory output and format=mlt in
mbtiles metadata. Compression and all existing flags work unchanged.
2026-07-02 17:29:24 +03:00
95 changed files with 4021 additions and 11225 deletions
+11
View File
@@ -11,6 +11,8 @@ 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
@@ -20,6 +22,15 @@ 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:
+8 -1
View File
@@ -37,7 +37,6 @@ tippecanoe-enumerate
tippecanoe-json-tool
tippecanoe-overzoom
unit
fpfmt-bench
# Left behind if man page generation fails
man/tippecanoe.1.tmp
@@ -46,6 +45,14 @@ 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
@@ -0,0 +1,3 @@
[submodule "maplibre-tile-spec"]
path = maplibre-tile-spec
url = https://github.com/maplibre/maplibre-tile-spec.git
-49
View File
@@ -1,52 +1,3 @@
# 2.83.0
* Replace the Grisu2 (`dtoa_milo`) float formatter with a C++ port of Russ
Cox's `fpfmt` (https://github.com/rsc/fpfmt), in `fpfmt/`. Grisu2 is fast but
neither always shortest nor always correctly rounded; `fpfmt` is both, and is
1.2x to 2.3x faster end to end (4.3x for digit generation alone) on this
hardware. Some numbers in tile output and tilestats therefore now print with
fewer digits (`-26.170044999999999` becomes `-26.170045`) or with a corrected
final digit (`9.823748927348929e+55` becomes `9.823748927348928e+55`). Every
such value still parses back to exactly the same double, so this changes only
the spelling, never the number. `make fpfmt-bench` rebuilds the head-to-head
comparison against the old implementation. `jsonpull`, now that it is C++,
calls `fpfmt::dtoa()` directly rather than through the `strdup`ing C shim
that `milo/milo.h` used to declare.
# 2.82.0
* Fix corruption of a JSON array when a non-final element was removed from it.
The old `json_free` / `json_disconnect` passed an element count to `memmove`
where a byte count was required, so pruning element 0 of an 8-element array
left the first two slots pointing at the same node -- a double free at
teardown -- and silently dropped the last element. Only reachable through a
whole-document tree, because removing the most recently added element made
the bad `memmove` a zero-length no-op. (#388)
* Rewrite `jsonpull` in C++ with `unique_ptr` ownership, `std::vector` for
arrays and hash entries, and `std::string` for string values, replacing the
hand-rolled `malloc`/`realloc`/`free` memory management. Value payloads now
live in type-tagged subclasses reached through asserting accessors, so
reading a hash as a string fails immediately instead of silently returning
garbage. (#388)
* Fix `tippecanoe-json-tool --extract` crashing on a numeric attribute, which
read the number's storage as a string pointer. (#388)
* Fix decoding of a `\u` escape sequence in which a high surrogate is followed
by a non-surrogate BMP code point, which combined the two into a single
wrong code point. (#388)
* Fix a `\uFFFF` escape being decoded to the overlong, invalid four-byte
UTF-8 sequence `F0 8F BF BF` instead of `EF BF BF`. (#388)
* Fix tile-join reading a non-string field type out of a tileset's tilejson.
(#388)
* Fix `tippecanoe-decode` and tile-join crashing on a directory tileset whose
`metadata.json` holds a non-string value, such as a numeric `minzoom` or a
nested object. Those entries are now reported and skipped. (#388)
* Fix an uninitialized read when a prefilter or postfilter emitted a feature
with `"properties": null`. Both filter readers accepted a null `properties`
and then read its length as though it were a hash, which was never
initialized for a non-container node. (#388)
* Fix the include guard in `evaluator.hpp`, which defined `EVALUATOR HPP`
instead of `EVALUATOR_HPP` and so never guarded anything. (#388)
# 2.81.0
* Add `--drop-by-attribute-as-needed=`*attribute* to drop the features with
+118 -28
View File
@@ -4,12 +4,36 @@ 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)
CXXFLAGS := $(CXXFLAGS) -std=c++17 -fPIE -DBUILD_INFO=$(BUILD_INFO) $(MLT_FLAGS)
LDFLAGS := $(LDFLAGS)
WARNING_FLAGS := -Wall -Wshadow -Wsign-compare -Wextra -Wunreachable-code -Wuninitialized -Wshadow -Wvla
RELEASE_FLAGS := -O3 -DNDEBUG
@@ -95,48 +119,63 @@ C = $(wildcard *.c) $(wildcard *.cpp)
INCLUDES = -I/usr/local/include -I. -Iclipper2/include
LIBS = -L/usr/local/lib
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 fpfmt/fpfmt.o
$(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)
$(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 write_json.o text.o jsonpull/jsonpull.o dirtiles.o pmtiles_file.o usage.o fpfmt/fpfmt.o
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)
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
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 fpfmt/fpfmt.o
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)
$(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 fpfmt/fpfmt.o
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 projection.o clip.o attribute.o jsonpull/jsonpull.o evaluator.o read_json.o clipper2/src/clipper.engine.o fpfmt/fpfmt.o
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)
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
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 fpfmt/fpfmt.o
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)
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
fpfmt-bench: fpfmt/bench.o fpfmt/fpfmt.o
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm
-include $(wildcard *.d)
%.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 -f ./tippecanoe ./tippecanoe-* ./tile-join ./unit ./fpfmt-bench *.o *.d */*.o */*.d tests/**/*.mbtiles tests/**/*.check
rm -rf ./tippecanoe ./tippecanoe-* ./tile-join ./unit *.o *.d */*.o */*.d tests/**/*.mbtiles tests/**/*.check mlt-build
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/jsonpull.h jsonpull/jsonpull.cpp
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]
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
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)
./unit
suffixes = json json.gz
@@ -147,7 +186,6 @@ suffixes = json json.gz
# %22 for quoted quote
# %2f for /
# %3a for :
# %3d for =
# %5f for _
# %7b for {
@@ -155,11 +193,10 @@ testargs = \
$(subst %20,' ',\
$(subst %22,'"',\
$(subst %3a,:,\
$(subst %3d,=,\
$(subst %2f,/,\
$(subst %7b,'{',\
$(subst %5f,'_',\
$(subst _, ,$(1)))))))))
$(subst %2f,/,\
$(subst %7b,'{',\
$(subst %5f,'_',\
$(subst _, ,$(1))))))))
%.json.check:
./tippecanoe -q -a@ -f -o $@.mbtiles $(call testargs,$(patsubst %.json.check,%,$(word 4,$(subst /, ,$@)))) $(foreach suffix,$(suffixes),$(sort $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.$(suffix)))) < /dev/null
@@ -264,14 +301,6 @@ raw-tiles-test: tippecanoe tippecanoe-decode tile-join
./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
# Test that a non-string value in metadata.json is reported and skipped
# instead of being read as a string (which used to crash)
./tippecanoe -q -f -e tests/raw-tiles/nonstring tests/raw-tiles/hackspots.geojson
sed -i.bak 's/"minzoom": "0"/"minzoom": 0/' tests/raw-tiles/nonstring/metadata.json
rm tests/raw-tiles/nonstring/metadata.json.bak
grep -q '"minzoom": 0' tests/raw-tiles/nonstring/metadata.json
./tippecanoe-decode -x generator tests/raw-tiles/nonstring > /dev/null
rm -r tests/raw-tiles/nonstring
pmtiles-test: tippecanoe tippecanoe-decode tile-join
./tippecanoe -q -f -o tests/pmtiles/hackspots.pmtiles -r1 -pC tests/raw-tiles/hackspots.geojson
@@ -451,7 +480,7 @@ overzoom-test: tippecanoe-overzoom
./tippecanoe-overzoom -b0 --deduplicate-by-id -o tests/pbf/merged-dedup.pbf -t 1/1/0 tests/pbf/1.json.dir/0/0/0.pbf 0/0/0 tests/pbf/2.json.dir/0/0/0.pbf 0/0/0
./tippecanoe-decode tests/pbf/merged-dedup.pbf 1 1 0 > tests/pbf/merged-dedup.pbf.json.check
cmp tests/pbf/merged-dedup.pbf.json.check tests/pbf/merged-dedup.pbf.json
rm -r tests/pbf/1.json.dir tests/pbf/2.json.dir tests/pbf/merged-nodedup.pbf tests/pbf/merged-nodedup.pbf.json.check tests/pbf/merged-dedup.pbf tests/pbf/merged-dedup.pbf.json.check
rm -r tests/pbf/1.json.dir tests/pbf/2.json.dir tests/pbf/merged-nodedup.pbf tests/pbf/merged-nodedup.pbf.json.check tests/pbf/merged-dedup.pbf.json.check
join-test: tippecanoe tippecanoe-decode tile-join
./tippecanoe -q -f -z12 -o tests/join-population/tabblock_06001420.mbtiles -YALAND10:'Land area' -L'{"file": "tests/join-population/tabblock_06001420.json", "description": "population"}'
@@ -675,6 +704,67 @@ 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
+32 -5
View File
@@ -44,12 +44,18 @@ $ brew install tippecanoe
On Ubuntu it will usually be easiest to build from the source repository:
```sh
$ git clone https://github.com/felt/tippecanoe.git
$ git clone --recurse-submodules 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.
@@ -357,7 +363,7 @@ Parallel processing will also be automatic if the input file is in FlatGeobuf fo
specified maximum zoom and to any levels added beyond that.
* `--extend-zooms-if-still-dropping-maximum=`_count_: Increase the maxzoom if features are still being dropped at that zoom level
by up to _count_ zoom levels.
* `-at` or `--generate-variable-depth-tile-pyramid`: Don't produce child tiles for any tile that should be sufficient to be overzoomed to any higher zoom level. Such tiles will be produced with maximum detail, retaining every vertex that is not collinear with its neighbors, but their polygons are still cleaned so that overlapping areas are merged rather than left stacked. Tiles with point features below the basezoom, or which contain too many features or bytes with full detail, will be written out with normal detail and split into child tiles. If any features have to be dropped dynamically at a zoom level, no tile in that zoom level is truncated, so that the whole zoom level is reduced consistently; any tile that was already being skipped because an ancestor had been truncated is written out after all. Tilesets generated with this option are suitable for use only with tile servers that will find the appropriate tile to overzoom from and will simplify the geometries appropriately before serving the tile.
* `-at` or `--generate-variable-depth-tile-pyramid`: Don't produce child tiles for any tile that should be sufficient to be overzoomed to any higher zoom level. Such tiles will be produced with maximum detail and no simplification or polygon cleaning. Tiles with point features below the basezoom or where any features have to be dropped dynamically, or which contain too many features or bytes with full detail, will be written out with normal detail and split into child tiles. Tilesets generated with this option are suitable for use only with tile servers that will find the appropriate tile to overzoom from and will simplify and clean the geometries appropriately before serving the tile.
* `-R` _zoom_`/`_x_`/`_y_ or `--one-tile=`_zoom_`/`_x_`/`_y_: Set the minzoom and maxzoom to _zoom_ and produce only
the single specified tile at that zoom level.
@@ -560,7 +566,10 @@ 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 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.
* `-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.
* `-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.
@@ -794,6 +803,10 @@ 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
@@ -847,7 +860,10 @@ 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 PBF vector tile data.
* `-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.
* `-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.
@@ -933,6 +949,10 @@ 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
@@ -1035,6 +1055,10 @@ 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*.
@@ -1052,4 +1076,7 @@ and produces tile `outz/outx/outy` of `out.mvt.gz` from them.
* `--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 PBF vector tile data in the output tile.
* `--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.
+12 -9
View File
@@ -4,7 +4,7 @@
#include "errors.hpp"
#include "serial.hpp"
#include "jsonpull/jsonpull.h"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
std::map<std::string, attribute_op> numeric_operations = {
{"sum", op_sum},
@@ -42,10 +42,10 @@ void set_attribute_accum(std::unordered_map<std::string, attribute_op> &attribut
void set_attribute_accum(std::unordered_map<std::string, attribute_op> &attribute_accum, const char *arg, char **argv) {
if (*arg == '{') {
json_pull_ptr jp = json_begin_string(arg);
json_object_ptr o = json_read_tree(jp);
json_pull *jp = json_begin_string(arg);
json_object *o = json_read_tree(jp);
if (o == nullptr) {
if (o == NULL) {
fprintf(stderr, "%s: -E%s: %s\n", *argv, arg, jp->error);
exit(EXIT_JSON);
}
@@ -55,21 +55,24 @@ void set_attribute_accum(std::unordered_map<std::string, attribute_op> &attribut
exit(EXIT_JSON);
}
for (size_t i = 0; i < o->entries().size(); i++) {
const auto &e = o->entries()[i];
for (size_t i = 0; i < o->value.object.length; i++) {
json_object *k = o->value.object.keys[i];
json_object *v = o->value.object.values[i];
if (e.key->type != JSON_STRING) {
if (k->type != JSON_STRING) {
fprintf(stderr, "%s: -E%s: key %zu not a string\n", *argv, arg, i);
exit(EXIT_JSON);
}
if (e.value->type != JSON_STRING) {
if (v->type != JSON_STRING) {
fprintf(stderr, "%s: -E%s: value %zu not a string\n", *argv, arg, i);
exit(EXIT_JSON);
}
set_attribute_accum(attribute_accum, e.key->string(), e.value->string());
set_attribute_accum(attribute_accum, k->value.string.string, v->value.string.string);
}
json_free(o);
json_end(jp);
return;
}
+1 -1
View File
@@ -6,7 +6,7 @@
#include <map>
#include <memory>
#include "mvt.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
enum attribute_op {
op_sum,
+7 -4
View File
@@ -10,6 +10,7 @@
#include "errors.hpp"
#include "compression.hpp"
#include "mvt.hpp"
#include "mlt.hpp"
#include "evaluator.hpp"
#include "serial.hpp"
#include "attribute.hpp"
@@ -1228,7 +1229,8 @@ 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) {
bool deduplicate_by_id,
int tile_format) {
std::vector<source_tile> decoded;
for (auto const &t : tiles) {
@@ -1254,7 +1256,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);
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);
}
// like a minimal serial_feature, but with mvt_feature-style attributes
@@ -1464,7 +1466,8 @@ 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) {
bool deduplicate_by_id,
int tile_format) {
mvt_tile outtile;
key_pool key_pool;
@@ -1737,7 +1740,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
}
if (outtile.layers.size() > 0) {
std::string pbf = outtile.encode();
std::string pbf = encode_tile(outtile, tile_format);
std::string compressed;
if (do_compress) {
+22 -20
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) {
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf, const char *ext) {
// 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) + ".pbf";
newdir = newdir + "/" + std::to_string(ty) + ext;
struct stat st;
if (stat(newdir.c_str(), &st) == 0) {
@@ -76,12 +76,18 @@ static bool numeric(const char *s) {
return true;
}
static bool pbfname(const char *s) {
// 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) {
while (*s >= '0' && *s <= '9') {
s++;
}
return strcmp(s, ".pbf") == 0 || strcmp(s, ".mvt") == 0;
if (strcmp(s, ".pbf") == 0 || strcmp(s, ".mvt") == 0 || strcmp(s, ".mlt") == 0) {
return s;
}
return NULL;
}
void check_dir(const char *dir, char **argv, bool force, bool forcetable) {
@@ -154,12 +160,11 @@ std::vector<zxy> enumerate_dirtiles(const char *fname, int minzoom, int maxzoom)
struct dirent *dp3;
while ((dp3 = readdir(d3)) != NULL) {
if (pbfname(dp3->d_name)) {
const char *ext = tile_extension(dp3->d_name);
if (ext != NULL) {
int ty = atoi(dp3->d_name);
zxy tile(tz, tx, ty);
if (strstr(dp3->d_name, ".mvt") != NULL) {
tile.extension = ".mvt";
}
tile.extension = ext;
tiles.push_back(tile);
}
@@ -207,7 +212,7 @@ void dir_erase_zoom(const char *fname, int zoom) {
struct dirent *dp3;
while ((dp3 = readdir(d3)) != NULL) {
if (pbfname(dp3->d_name)) {
if (tile_extension(dp3->d_name) != NULL) {
std::string y = x + "/" + dp3->d_name;
if (unlink(y.c_str()) != 0) {
perror(y.c_str());
@@ -248,9 +253,9 @@ sqlite3 *dirmeta2tmp(const char *fname) {
if (f == NULL) {
perror(name.c_str());
} else {
json_pull_ptr jp = json_begin_file(f);
json_object_ptr o = json_read_tree(jp);
if (o == nullptr) {
json_pull *jp = json_begin_file(f);
json_object *o = json_read_tree(jp);
if (o == NULL) {
fprintf(stderr, "%s: metadata parsing error: %s\n", name.c_str(), jp->error);
exit(EXIT_JSON);
}
@@ -260,22 +265,19 @@ sqlite3 *dirmeta2tmp(const char *fname) {
exit(EXIT_JSON);
}
for (const auto &e : o->entries()) {
// Skip, not just warn: a metadata.json from another tool may
// have a numeric minzoom or a nested object, and string()
// asserts on the type.
if (e.key->type != JSON_STRING || e.value->type != JSON_STRING) {
for (size_t i = 0; i < o->value.object.length; i++) {
if (o->value.object.keys[i]->type != JSON_STRING || o->value.object.values[i]->type != JSON_STRING) {
fprintf(stderr, "%s: non-string in metadata\n", name.c_str());
continue;
}
char *sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES (%Q, %Q);", e.key->string().c_str(), e.value->string().c_str());
char *sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES (%Q, %Q);", o->value.object.keys[i]->value.string.string, o->value.object.values[i]->value.string.string);
if (sqlite3_exec(db, sql, NULL, NULL, &err) != SQLITE_OK) {
fprintf(stderr, "set %s in metadata: %s\n", e.key->string().c_str(), err);
fprintf(stderr, "set %s in metadata: %s\n", o->value.object.keys[i]->value.string.string, err);
}
sqlite3_free(sql);
}
json_end(jp);
fclose(f);
}
+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);
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf, const char *ext = ".pbf");
void dir_erase_zoom(const char *outdir, int z);
void dir_write_metadata(const char *outdir, const metadata &m);
+102 -92
View File
@@ -6,7 +6,7 @@
#include "mvt.hpp"
#include "evaluator.hpp"
#include "errors.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "text.hpp"
int compare(mvt_value const &one, json_object *two, bool &fail) {
@@ -17,7 +17,7 @@ int compare(mvt_value const &one, json_object *two, bool &fail) {
return false; // string vs non-string
}
return strcmp(one.c_str(), two->string().c_str());
return strcmp(one.c_str(), two->value.string.string);
case mvt_double:
case mvt_float:
@@ -52,9 +52,9 @@ int compare(mvt_value const &one, json_object *two, bool &fail) {
exit(EXIT_IMPOSSIBLE);
}
if (v < two->number()) {
if (v < two->value.number.number) {
return -1;
} else if (v > two->number()) {
} else if (v > two->value.number.number) {
return 1;
} else {
return 0;
@@ -92,7 +92,7 @@ int compare(mvt_value const &one, json_object *two, bool &fail) {
// 1: true
// -1: incomparable (sql null), treated as false in final output
static int eval(std::function<mvt_value(std::string const &)> feature, json_object *f, std::set<std::string> &exclude_attributes, std::vector<std::string> const &unidecode_data) {
if (f != nullptr) {
if (f != NULL) {
if (f->type == JSON_TRUE) {
return 1;
} else if (f->type == JSON_FALSE) {
@@ -102,7 +102,7 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
}
if (f->type == JSON_NUMBER) {
if (f->number() == 0) {
if (f->value.number.number == 0) {
return 0;
} else {
return 1;
@@ -110,7 +110,7 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
}
if (f->type == JSON_STRING) {
if (f->string().empty()) {
if (f->value.string.string[0] == '\0') {
return 0;
} else {
return 1;
@@ -118,129 +118,131 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
}
}
if (f == nullptr || f->type != JSON_ARRAY) {
fprintf(stderr, "Filter is not an array: %s\n", json_stringify(f).c_str());
if (f == NULL || f->type != JSON_ARRAY) {
fprintf(stderr, "Filter is not an array: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
if (f->array().size() < 1) {
fprintf(stderr, "Array too small in filter: %s\n", json_stringify(f).c_str());
if (f->value.array.length < 1) {
fprintf(stderr, "Array too small in filter: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
if (f->array()[0]->type != JSON_STRING) {
fprintf(stderr, "Filter operation is not a string: %s\n", json_stringify(f).c_str());
if (f->value.array.array[0]->type != JSON_STRING) {
fprintf(stderr, "Filter operation is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
const std::string &op = f->array()[0]->string();
if (op == "has" ||
op == "!has") {
if (f->array().size() != 2) {
fprintf(stderr, "Wrong number of array elements in filter: %s\n", json_stringify(f).c_str());
if (strcmp(f->value.array.array[0]->value.string.string, "has") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "!has") == 0) {
if (f->value.array.length != 2) {
fprintf(stderr, "Wrong number of array elements in filter: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
if (op == "has") {
if (f->array()[1]->type != JSON_STRING) {
fprintf(stderr, "\"has\" key is not a string: %s\n", json_stringify(f).c_str());
if (strcmp(f->value.array.array[0]->value.string.string, "has") == 0) {
if (f->value.array.array[1]->type != JSON_STRING) {
fprintf(stderr, "\"has\" key is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
return feature(f->array()[1]->string()).type != mvt_no_such_key;
return feature(std::string(f->value.array.array[1]->value.string.string)).type != mvt_no_such_key;
}
if (op == "!has") {
if (f->array()[1]->type != JSON_STRING) {
fprintf(stderr, "\"!has\" key is not a string: %s\n", json_stringify(f).c_str());
if (strcmp(f->value.array.array[0]->value.string.string, "!has") == 0) {
if (f->value.array.array[1]->type != JSON_STRING) {
fprintf(stderr, "\"!has\" key is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
return feature(f->array()[1]->string()).type == mvt_no_such_key;
return feature(std::string(f->value.array.array[1]->value.string.string)).type == mvt_no_such_key;
}
}
if (op == "==" ||
op == "!=" ||
op == ">" ||
op == ">=" ||
op == "<" ||
op == "<=") {
if (f->array().size() != 3) {
fprintf(stderr, "Wrong number of array elements in filter: %s\n", json_stringify(f).c_str());
if (strcmp(f->value.array.array[0]->value.string.string, "==") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "!=") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, ">") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, ">=") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "<") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "<=") == 0) {
if (f->value.array.length != 3) {
fprintf(stderr, "Wrong number of array elements in filter: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
if (f->array()[1]->type != JSON_STRING) {
fprintf(stderr, "comparison key is not a string: %s\n", json_stringify(f).c_str());
if (f->value.array.array[1]->type != JSON_STRING) {
fprintf(stderr, "comparison key is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
mvt_value ff = feature(f->array()[1]->string());
mvt_value ff = feature(std::string(f->value.array.array[1]->value.string.string));
if (ff.type == mvt_no_such_key) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: attribute not found for comparison: %s\n", json_stringify(f).c_str());
const char *s = json_stringify(f);
fprintf(stderr, "Warning: attribute not found for comparison: %s\n", s);
free((void *) s);
warned = true;
}
if (op == "!=") {
if (strcmp(f->value.array.array[0]->value.string.string, "!=") == 0) {
return true; // attributes that aren't found are not equal
}
return false; // not found: comparison is false
}
bool fail = false;
int cmp = compare(ff, f->array()[2].get(), fail);
int cmp = compare(ff, f->value.array.array[2], fail);
if (fail) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: mismatched type in comparison: %s\n", json_stringify(f).c_str());
const char *s = json_stringify(f);
fprintf(stderr, "Warning: mismatched type in comparison: %s\n", s);
free((void *) s);
warned = true;
}
if (op == "!=") {
if (strcmp(f->value.array.array[0]->value.string.string, "!=") == 0) {
return true; // mismatched types are not equal
}
return false;
}
if (op == "==") {
if (strcmp(f->value.array.array[0]->value.string.string, "==") == 0) {
return cmp == 0;
}
if (op == "!=") {
if (strcmp(f->value.array.array[0]->value.string.string, "!=") == 0) {
return cmp != 0;
}
if (op == ">") {
if (strcmp(f->value.array.array[0]->value.string.string, ">") == 0) {
return cmp > 0;
}
if (op == ">=") {
if (strcmp(f->value.array.array[0]->value.string.string, ">=") == 0) {
return cmp >= 0;
}
if (op == "<") {
if (strcmp(f->value.array.array[0]->value.string.string, "<") == 0) {
return cmp < 0;
}
if (op == "<=") {
if (strcmp(f->value.array.array[0]->value.string.string, "<=") == 0) {
return cmp <= 0;
}
fprintf(stderr, "Internal error: can't happen: %s\n", json_stringify(f).c_str());
fprintf(stderr, "Internal error: can't happen: %s\n", json_stringify(f));
exit(EXIT_IMPOSSIBLE);
}
if (op == "all" ||
op == "any" ||
op == "none") {
if (strcmp(f->value.array.array[0]->value.string.string, "all") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "any") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "none") == 0) {
bool v;
if (op == "all") {
if (strcmp(f->value.array.array[0]->value.string.string, "all") == 0) {
v = true;
} else {
v = false;
}
for (size_t i = 1; i < f->array().size(); i++) {
int out = eval(feature, f->array()[i].get(), exclude_attributes, unidecode_data);
for (size_t i = 1; i < f->value.array.length; i++) {
int out = eval(feature, f->value.array.array[i], exclude_attributes, unidecode_data);
if (out >= 0) { // nulls are ignored in boolean and/or expressions
if (op == "all") {
if (strcmp(f->value.array.array[0]->value.string.string, "all") == 0) {
v = v && out;
if (!v) {
break;
@@ -254,47 +256,51 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
}
}
if (op == "none") {
if (strcmp(f->value.array.array[0]->value.string.string, "none") == 0) {
return !v;
} else {
return v;
}
}
if (op == "in" ||
op == "!in") {
if (f->array().size() < 2) {
fprintf(stderr, "Array too small in filter: %s\n", json_stringify(f).c_str());
if (strcmp(f->value.array.array[0]->value.string.string, "in") == 0 ||
strcmp(f->value.array.array[0]->value.string.string, "!in") == 0) {
if (f->value.array.length < 2) {
fprintf(stderr, "Array too small in filter: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
if (f->array()[1]->type != JSON_STRING) {
fprintf(stderr, "\"!in\" key is not a string: %s\n", json_stringify(f).c_str());
if (f->value.array.array[1]->type != JSON_STRING) {
fprintf(stderr, "\"!in\" key is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
mvt_value ff = feature(f->array()[1]->string());
mvt_value ff = feature(std::string(f->value.array.array[1]->value.string.string));
if (ff.type == mvt_no_such_key) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: attribute not found for comparison: %s\n", json_stringify(f).c_str());
const char *s = json_stringify(f);
fprintf(stderr, "Warning: attribute not found for comparison: %s\n", s);
free((void *) s);
warned = true;
}
if (op == "!in") {
if (strcmp(f->value.array.array[0]->value.string.string, "!in") == 0) {
return true; // attributes that aren't found are not in
}
return false; // not found: comparison is false
}
bool found = false;
for (size_t i = 2; i < f->array().size(); i++) {
for (size_t i = 2; i < f->value.array.length; i++) {
bool fail = false;
int cmp = compare(ff, f->array()[i].get(), fail);
int cmp = compare(ff, f->value.array.array[i], fail);
if (fail) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: mismatched type in comparison: %s\n", json_stringify(f).c_str());
const char *s = json_stringify(f);
fprintf(stderr, "Warning: mismatched type in comparison: %s\n", s);
free((void *) s);
warned = true;
}
cmp = 1;
@@ -306,39 +312,39 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
}
}
if (op == "in") {
if (strcmp(f->value.array.array[0]->value.string.string, "in") == 0) {
return found;
} else {
return !found;
}
}
if (op == "attribute-filter") {
if (f->array().size() != 3) {
fprintf(stderr, "Wrong number of array elements in filter: %s\n", json_stringify(f).c_str());
if (strcmp(f->value.array.array[0]->value.string.string, "attribute-filter") == 0) {
if (f->value.array.length != 3) {
fprintf(stderr, "Wrong number of array elements in filter: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
if (f->array()[1]->type != JSON_STRING) {
fprintf(stderr, "\"attribute-filter\" key is not a string: %s\n", json_stringify(f).c_str());
if (f->value.array.array[1]->type != JSON_STRING) {
fprintf(stderr, "\"attribute-filter\" key is not a string: %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
bool ok = eval(feature, f->array()[2].get(), exclude_attributes, unidecode_data) > 0;
bool ok = eval(feature, f->value.array.array[2], exclude_attributes, unidecode_data) > 0;
if (!ok) {
exclude_attributes.insert(f->array()[1]->string());
exclude_attributes.insert(f->value.array.array[1]->value.string.string);
}
return true;
}
fprintf(stderr, "Unknown filter %s\n", json_stringify(f).c_str());
fprintf(stderr, "Unknown filter %s\n", json_stringify(f));
exit(EXIT_FILTER);
}
static bool evaluate(std::function<mvt_value(std::string const &)> feature, std::string const &layer, json_object *filter, std::set<std::string> &exclude_attributes, std::vector<std::string> const &unidecode_data) {
if (filter == nullptr || filter->type != JSON_HASH) {
fprintf(stderr, "Error: filter is not a hash: %s\n", json_stringify(filter).c_str());
bool evaluate(std::function<mvt_value(std::string const &)> feature, std::string const &layer, json_object *filter, std::set<std::string> &exclude_attributes, std::vector<std::string> const &unidecode_data) {
if (filter == NULL || filter->type != JSON_HASH) {
fprintf(stderr, "Error: filter is not a hash: %s\n", json_stringify(filter));
exit(EXIT_JSON);
}
@@ -346,43 +352,47 @@ static bool evaluate(std::function<mvt_value(std::string const &)> feature, std:
json_object *f;
f = json_hash_get(filter, layer.c_str());
if (ok && f != nullptr) {
if (ok && f != NULL) {
ok = eval(feature, f, exclude_attributes, unidecode_data) > 0;
}
f = json_hash_get(filter, "*");
if (ok && f != nullptr) {
if (ok && f != NULL) {
ok = eval(feature, f, exclude_attributes, unidecode_data) > 0;
}
return ok;
}
json_object_ptr read_filter(const char *fname) {
json_object *read_filter(const char *fname) {
FILE *fp = fopen(fname, "r");
if (fp == NULL) {
perror(fname);
exit(EXIT_OPEN);
}
json_pull_ptr jp = json_begin_file(fp);
json_object_ptr filter = json_read_tree(jp);
if (filter == nullptr) {
json_pull *jp = json_begin_file(fp);
json_object *filter = json_read_tree(jp);
if (filter == NULL) {
fprintf(stderr, "%s: %s\n", fname, jp->error);
exit(EXIT_JSON);
}
json_disconnect(filter);
json_end(jp);
fclose(fp);
return filter;
}
json_object_ptr parse_filter(const char *s) {
json_pull_ptr jp = json_begin_string(s);
json_object_ptr filter = json_read_tree(jp);
if (filter == nullptr) {
json_object *parse_filter(const char *s) {
json_pull *jp = json_begin_string(s);
json_object *filter = json_read_tree(jp);
if (filter == NULL) {
fprintf(stderr, "Could not parse filter %s\n", s);
fprintf(stderr, "%s\n", jp->error);
exit(EXIT_JSON);
}
json_disconnect(filter);
json_end(jp);
return filter;
}
+3 -7
View File
@@ -1,5 +1,5 @@
#ifndef EVALUATOR_HPP
#define EVALUATOR_HPP
#define EVALUATOR HPP
#include <unordered_map>
#include <string>
@@ -7,13 +7,9 @@
#include "jsonpull/jsonpull.h"
#include "mvt.hpp"
// The `filter` parameters take a borrowed pointer; the caller (in
// main.cpp, tile-join, overzoom) keeps the json_object_ptr alive
// across every per-feature evaluate() call. A raw pointer avoids
// touching unique_ptr at all on this hot path.
bool evaluate(std::unordered_map<std::string, mvt_value> const &feature, std::string const &layer, json_object *filter, std::set<std::string> &exclude_attributes, std::vector<std::string> const &unidecode_data);
json_object_ptr parse_filter(const char *s);
json_object_ptr read_filter(const char *fname);
json_object *parse_filter(const char *s);
json_object *read_filter(const char *fname);
bool evaluate(mvt_feature const &feat, mvt_layer const &layer, json_object *filter, std::set<std::string> &exclude_attributes, int z, std::vector<std::string> const &unidecode_data);
+3 -3
View File
@@ -4,7 +4,7 @@
#include "projection.hpp"
#include "flatgeobuf/feature_generated.h"
#include "flatgeobuf/header_generated.h"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "main.hpp"
#include "errors.hpp"
#include "thread.hpp"
@@ -224,13 +224,13 @@ void readFeature(const FlatGeobuf::Feature *feature, long long feature_sequence_
sv.type = mvt_double;
float float_val;
memcpy(&float_val, feature->properties()->data() + p_pos + sizeof(uint16_t), sizeof(float_val));
sv.s = fpfmt::dtoa(float_val);
sv.s = milo::dtoa_milo(float_val);
p_pos += sizeof(uint16_t) + sizeof(float_val);
} else if (col_type == FlatGeobuf::ColumnType_Double) {
sv.type = mvt_double;
double double_val;
memcpy(&double_val, feature->properties()->data() + p_pos + sizeof(uint16_t), sizeof(double_val));
sv.s = fpfmt::dtoa(double_val);
sv.s = milo::dtoa_milo(double_val);
p_pos += sizeof(uint16_t) + sizeof(double_val);
} else if (col_type == FlatGeobuf::ColumnType_String || col_type == FlatGeobuf::ColumnType_Json || col_type == FlatGeobuf::ColumnType_DateTime) {
sv.type = mvt_string;
-27
View File
@@ -1,27 +0,0 @@
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-278
View File
@@ -1,278 +0,0 @@
// Head-to-head comparison of fpfmt::dtoa() against the Grisu2 implementation
// (milo::dtoa_milo) that it replaced.
//
// make fpfmt-bench && ./fpfmt-bench # timings
// ./fpfmt-bench -check [n] # correctness sweep
//
// -check verifies, over structured edge cases plus n random doubles, that
// every fpfmt::dtoa() result parses back to the value it came from, and
// reports how its digit strings compare with Grisu2's.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <random>
#include <string>
#include <vector>
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
using clk = std::chrono::steady_clock;
static double from_bits(uint64_t b) {
double d;
memcpy(&d, &b, sizeof(d));
return d;
}
static uint64_t bits_of(double d) {
uint64_t b;
memcpy(&b, &d, sizeof(b));
return b;
}
// significant_digits counts the significant decimal digits in a formatted
// number: leading zeros and zeros trailing the last nonzero digit don't count.
static int significant_digits(const std::string &str) {
std::string s = str;
size_t e = s.find('e');
if (e != std::string::npos) {
s = s.substr(0, e);
}
int n = 0, trailing = 0;
bool seen = false;
for (char c : s) {
if (c >= '1' && c <= '9') {
n += trailing + 1;
trailing = 0;
seen = true;
} else if (c == '0' && seen) {
trailing++;
}
}
return n == 0 ? 1 : n;
}
struct dataset {
const char *name;
std::vector<double> v;
};
static std::vector<dataset> make_datasets(size_t n, std::mt19937_64 &rng) {
std::vector<dataset> sets;
{
// Uniform random bit patterns: the worst case, nearly all 17 digits.
dataset s{"random bit patterns", {}};
while (s.v.size() < n) {
double d = from_bits(rng());
if (std::isfinite(d) && d != 0) {
s.v.push_back(d);
}
}
sets.push_back(std::move(s));
}
{
// What tippecanoe mostly formats: longitudes and latitudes.
dataset s{"geo coordinates", {}};
std::uniform_real_distribution<double> u(-180, 180);
while (s.v.size() < n) {
s.v.push_back(u(rng));
}
sets.push_back(std::move(s));
}
{
// Attribute values with only a few significant digits.
dataset s{"short decimals", {}};
std::uniform_int_distribution<int> m(1, 999999);
std::uniform_int_distribution<int> e(-4, 4);
while (s.v.size() < n) {
s.v.push_back(m(rng) * pow(10.0, e(rng)));
}
sets.push_back(std::move(s));
}
{
// IDs, counts, zoom levels.
dataset s{"small integers", {}};
std::uniform_int_distribution<int> u(0, 1000000);
while (s.v.size() < n) {
s.v.push_back((double) u(rng));
}
sets.push_back(std::move(s));
}
return sets;
}
static volatile size_t sink;
template <typename F>
static double best_ns(const std::vector<double> &v, int reps, F f) {
double best = 1e300;
for (int r = 0; r < reps; r++) {
auto t0 = clk::now();
size_t acc = 0;
for (double d : v) {
acc += f(d);
}
auto t1 = clk::now();
sink += acc;
double ns = std::chrono::duration<double, std::nano>(t1 - t0).count() / (double) v.size();
best = std::min(best, ns);
}
return best;
}
static int check(long n) {
uint64_t tested = 0, roundtrip_fail = 0, differ = 0, fpfmt_shorter = 0, milo_shorter = 0, same_length = 0;
std::string first_fail;
auto one = [&](double d) {
tested++;
std::string a = fpfmt::dtoa(d);
std::string b = milo::dtoa_milo(d);
if (strtod(a.c_str(), NULL) != d) {
roundtrip_fail++;
if (first_fail.empty()) {
char buf[128];
snprintf(buf, sizeof(buf), "bits=%016llx -> %s", (unsigned long long) bits_of(d), a.c_str());
first_fail = buf;
}
}
if (a != b) {
differ++;
int na = significant_digits(a), nb = significant_digits(b);
if (na < nb) {
fpfmt_shorter++;
} else if (na > nb) {
milo_shorter++;
} else {
same_length++;
}
}
};
// Non-finite and zero cases have to agree exactly.
static const double special[] = {0.0, -0.0, INFINITY, -INFINITY, NAN};
for (double d : special) {
std::string a = fpfmt::dtoa(d), b = milo::dtoa_milo(d);
if (a != b) {
printf("MISMATCH on special value: fpfmt=%s milo=%s\n", a.c_str(), b.c_str());
return 1;
}
}
static const double edge[] = {
1.0, -1.0, 0.1, 0.2, 0.3, 0.5, 1.5, 2.0, 3.0,
1e-7, 1e-6, 1e-5, 1e-1, 1e20, 1e21, 1e22, 1e23,
5e-324, 1e-323, 2.2250738585072014e-308, 2.2250738585072011e-308,
1.7976931348623157e308, 123456789.0, 3.14159265358979,
9007199254740992.0, 9007199254740993.0, 1e100, 1e-100};
for (double d : edge) {
one(d);
}
for (int i = -320; i <= 308; i++) {
double d = pow(10.0, i);
if (std::isfinite(d) && d != 0) {
one(d);
}
}
for (int i = 1; i < 100000; i++) {
one((double) i);
one(1.0 / i);
one(-(double) i);
}
// Every float32 bit pattern, subsampled, promoted to double.
for (uint64_t u = 0; u < (1ull << 32); u += 521) {
float f;
uint32_t b = (uint32_t) u;
memcpy(&f, &b, sizeof(f));
if (std::isfinite(f) && f != 0) {
one((double) f);
}
}
std::mt19937_64 rng(12345);
for (long i = 0; i < n; i++) {
double d = from_bits(rng());
if (std::isfinite(d) && d != 0) {
one(d);
}
}
std::uniform_real_distribution<double> lat(-90, 90), lon(-180, 180);
for (long i = 0; i < n / 4; i++) {
one(lat(rng));
one(lon(rng));
}
printf("values tested %llu\n", (unsigned long long) tested);
printf("fpfmt failed to round trip %llu\n", (unsigned long long) roundtrip_fail);
printf("output differs from Grisu2 %llu\n", (unsigned long long) differ);
printf(" fpfmt used fewer digits %llu\n", (unsigned long long) fpfmt_shorter);
printf(" Grisu2 used fewer digits %llu\n", (unsigned long long) milo_shorter);
printf(" same digit count, last differs %llu\n", (unsigned long long) same_length);
if (!first_fail.empty()) {
printf("first round trip failure: %s\n", first_fail.c_str());
}
return (roundtrip_fail != 0 || milo_shorter != 0) ? 1 : 0;
}
int main(int argc, char **argv) {
if (argc > 1 && strcmp(argv[1], "-check") == 0) {
return check(argc > 2 ? atol(argv[2]) : 20000000L);
}
size_t n = (argc > 1) ? (size_t) atol(argv[1]) : 2000000;
int reps = (argc > 2) ? atoi(argv[2]) : 5;
std::mt19937_64 rng(2024);
std::vector<dataset> sets = make_datasets(n, rng);
printf("%zu values per dataset, best of %d runs\n\n", n, reps * 2);
printf("full std::string formatting\n");
printf("%-22s %14s %14s %9s\n", "dataset", "Grisu2 ns", "fpfmt ns", "speedup");
for (auto &s : sets) {
// Interleave the two so they share cache and clock conditions.
double tm = best_ns(s.v, reps, [](double d) { return milo::dtoa_milo(d).size(); });
double tf = best_ns(s.v, reps, [](double d) { return fpfmt::dtoa(d).size(); });
tm = std::min(tm, best_ns(s.v, reps, [](double d) { return milo::dtoa_milo(d).size(); }));
tf = std::min(tf, best_ns(s.v, reps, [](double d) { return fpfmt::dtoa(d).size(); }));
printf("%-22s %14.2f %14.2f %8.2fx\n", s.name, tm, tf, tm / tf);
}
printf("\ndigit generation only, without the std::string\n");
printf("%-22s %14s %14s %9s\n", "dataset", "Grisu2 ns", "fpfmt ns", "speedup");
for (auto &s : sets) {
double tm = best_ns(s.v, reps, [](double d) {
static std::string b;
b.clear();
if (d == 0) {
return (size_t) 1;
}
if (d < 0) {
d = -d;
}
int length, K;
milo::Grisu2(d, b, &length, &K);
return (size_t) (length + K);
});
double tf = best_ns(s.v, reps, [](double d) {
if (d == 0) {
return (size_t) 1;
}
uint64_t dd;
int p;
fpfmt::shortest(d, &dd, &p);
return (size_t) (fpfmt::digits(dd) + p);
});
printf("%-22s %14.2f %14.2f %8.2fx\n", s.name, tm, tf, tm / tf);
}
return 0;
}
-430
View File
@@ -1,430 +0,0 @@
// C++ port of Russ Cox's fpfmt shortest-float formatting algorithm,
// from https://github.com/rsc/fpfmt (fpfmt.go).
//
// The original Go code is Copyright 2025 The Go Authors and is covered by
// the BSD-style license in fpfmt/LICENSE.txt.
//
// The port is deliberately literal: the functions, their names, and the
// comments follow fpfmt.go closely, so the two can be diffed. The only
// substantive additions are the Go-compatible shift helpers (Go defines a
// shift of 64 or more as 0, where C++ leaves it undefined) and format(),
// which renders the (d, p) pair the way milo::Prettify() does.
#include "fpfmt.hpp"
#include <string.h>
#include <cmath>
#include "pow10tab.hpp"
namespace fpfmt {
static_assert((-1 >> 1) == -1, "fpfmt needs an arithmetic right shift on signed ints");
// go_shl and go_shr shift the way Go does: a shift count of 64 or more
// yields 0 rather than undefined behavior. The Short() code below relies on
// this for subnormals, where the neighbor offset shifts entirely away.
static inline uint64_t go_shl(uint64_t x, int s) {
return s >= 64 ? 0 : x << s;
}
static inline uint64_t go_shr(uint64_t x, int s) {
return s >= 64 ? 0 : x >> s;
}
// len64 returns the minimum number of bits required to represent x;
// it is 0 for x == 0. (Go's bits.Len64.)
static inline int len64(uint64_t x) {
return x == 0 ? 0 : 64 - __builtin_clzll(x);
}
// mul64 returns the 128-bit product of x and y as hi, lo. (Go's bits.Mul64.)
static inline void mul64(uint64_t x, uint64_t y, uint64_t *hi, uint64_t *lo) {
unsigned __int128 p = (unsigned __int128) x * (unsigned __int128) y;
*hi = (uint64_t) (p >> 64);
*lo = (uint64_t) p;
}
// mul64hi returns just the high half of the 128-bit product of x and y.
static inline uint64_t mul64hi(uint64_t x, uint64_t y) {
return (uint64_t) (((unsigned __int128) x * (unsigned __int128) y) >> 64);
}
// ror64 rotates x right by k bits. (Go's bits.RotateLeft64(x, -k).)
static inline uint64_t ror64(uint64_t x, int k) {
return (x >> k) | (x << (64 - k));
}
// unpack64 returns m, e such that f = m * 2**e.
// The caller is expected to have handled 0, NaN, and ±Inf already.
// The sign of f is ignored.
static inline void unpack64(double f, uint64_t *mp, int *ep) {
const int shift = 64 - 53;
const int minExp = -(1074 + shift);
uint64_t b;
memcpy(&b, &f, sizeof(b));
uint64_t m = (1ULL << 63) | ((b & ((1ULL << 52) - 1)) << shift);
int e = (int) ((b >> 52) & ((1ULL << shift) - 1));
if (e == 0) {
m &= ~(1ULL << 63);
e = minExp;
int s = 64 - len64(m);
*mp = m << s;
*ep = e - s;
return;
}
*mp = m;
*ep = (e - 1) + minExp;
}
// An unrounded represents an unrounded value: the top 62 bits are the value
// scaled by 4, the low bit is a sticky bit recording a nonzero remainder.
typedef uint64_t unrounded;
static inline uint64_t un_floor(unrounded u) {
return (u + 0) >> 2;
}
static inline uint64_t un_round(unrounded u) {
return (u + 1 + ((u >> 2) & 1)) >> 2;
}
static inline uint64_t un_ceil(unrounded u) {
return (u + 3) >> 2;
}
static inline unrounded un_nudge(unrounded u, int delta) {
return u + (unrounded) (int64_t) delta;
}
static inline unrounded un_div(unrounded u, uint64_t d) {
uint64_t x = u;
return (x / d) | (u & 1) | (uint64_t) (x % d != 0);
}
// log10_pow2(x) returns ⌊log₁₀ 2**x⌋ = ⌊x * log₁₀ 2⌋.
static inline int log10_pow2(int x) {
// log₁₀ 2 ≈ 0.30102999566 ≈ 78913 / 2^18
return (int) (((int64_t) x * 78913) >> 18);
}
// log2_pow10(x) returns ⌊log₂ 10**x⌋ = ⌊x * log₂ 10⌋.
static inline int log2_pow10(int x) {
// log₂ 10 ≈ 3.32192809489 ≈ 108853 / 2^15
return (int) (((int64_t) x * 108853) >> 15);
}
// skewed computes the skewed footprint of m * 2**e,
// which is ⌊log₁₀ 3/4 * 2**e⌋ = ⌊e*(log₁₀ 2)-(log₁₀ 4/3)⌋.
static inline int skewed(int e) {
return (int) (((int64_t) e * 631305 - 261663) >> 21);
}
// uint64pow10[x] is 10**x.
static const uint64_t uint64pow10[20] = {
1ULL, 10ULL, 100ULL, 1000ULL, 10000ULL,
100000ULL, 1000000ULL, 10000000ULL, 100000000ULL, 1000000000ULL,
10000000000ULL, 100000000000ULL, 1000000000000ULL, 10000000000000ULL, 100000000000000ULL,
1000000000000000ULL, 10000000000000000ULL, 100000000000000000ULL, 1000000000000000000ULL,
10000000000000000000ULL};
// A scaler holds derived scaling constants for a given e, p pair.
struct scaler {
pm_hi_lo pm;
int s;
};
// prescale returns the scaling constants for e, p.
// lp must be log2_pow10(p).
static inline scaler prescale(int e, int p, int lp) {
scaler c;
c.pm = pow10_tab[p - pow10Min];
c.s = -(e + lp + 3);
return c;
}
// uscale returns unround(x * 2**e * 10**p).
// The caller should pass c = prescale(e, p, log2_pow10(p))
// and should have left-justified x so its high bit is set.
static inline unrounded uscale(uint64_t x, scaler c) {
uint64_t hi, mid;
mul64(x, c.pm.hi, &hi, &mid);
uint64_t sticky = 1;
if ((hi & ((1ULL << (c.s & 63)) - 1)) == 0) {
uint64_t mid2 = mul64hi(x, c.pm.lo);
sticky = (uint64_t) (mid - mid2 > 1);
hi -= (uint64_t) (mid < mid2);
}
return go_shr(hi, c.s) | sticky;
}
// trim_zeros removes trailing zeros from x * 10**p.
// If x ends in k zeros, trim_zeros returns x/10**k, p+k.
// It assumes that x ends in at most 16 zeros.
static inline void trim_zeros(uint64_t *xp, int *pp) {
const uint64_t maxUint64 = ~(uint64_t) 0;
const uint64_t inv5p8 = 0xc767074b22e90e21ULL; // inverse of 5**8
const uint64_t inv5p4 = 0xd288ce703afb7e91ULL; // inverse of 5**4
const uint64_t inv5p2 = 0x8f5c28f5c28f5c29ULL; // inverse of 5**2
const uint64_t inv5 = 0xcccccccccccccccdULL; // inverse of 5
uint64_t x = *xp;
int p = *pp;
// Cut 1 zero, or else return.
uint64_t d = ror64(x * inv5, 1);
if (d <= maxUint64 / 10) {
x = d;
p += 1;
} else {
*xp = x;
*pp = p;
return;
}
// Cut 8 zeros, then 4, then 2, then 1.
d = ror64(x * inv5p8, 8);
if (d <= maxUint64 / 100000000) {
x = d;
p += 8;
}
d = ror64(x * inv5p4, 4);
if (d <= maxUint64 / 10000) {
x = d;
p += 4;
}
d = ror64(x * inv5p2, 2);
if (d <= maxUint64 / 100) {
x = d;
p += 2;
}
d = ror64(x * inv5, 1);
if (d <= maxUint64 / 10) {
x = d;
p += 1;
}
*xp = x;
*pp = p;
}
// shortest computes the shortest formatting of f,
// using as few digits as possible that will still round trip
// back to the original float64.
void shortest(double f, uint64_t *dp, int *pp) {
const int minExp = -1085;
uint64_t m;
int e;
unpack64(f, &m, &e);
uint64_t mn;
int p;
int z = 11; // extra zero bits at bottom of m; 11 for 53-bit m
if (m == (1ULL << 63) && e > minExp) {
p = -skewed(e + z);
mn = m - go_shl(1, z - 2); // mn = m - 1/4 * 2**(e+z)
} else {
if (e < minExp) {
z = 11 + (minExp - e);
}
p = -log10_pow2(e + z);
mn = m - go_shl(1, z - 1); // mn = m - 1/2 * 2**(e+z)
}
uint64_t mx = m + go_shl(1, z - 1); // mx = m + 1/2 * 2**(e+z)
int odd = (int) (go_shr(m, z) & 1);
scaler pre = prescale(e, p, log2_pow10(p));
uint64_t dmin = un_ceil(un_nudge(uscale(mn, pre), +odd));
uint64_t dmax = un_floor(un_nudge(uscale(mx, pre), -odd));
uint64_t d = dmax / 10;
if (d * 10 >= dmin) {
int q = -(p - 1);
trim_zeros(&d, &q);
*dp = d;
*pp = q;
return;
}
d = dmin;
if (d < dmax) {
d = un_round(uscale(m, pre));
}
*dp = d;
*pp = -p;
}
// digits returns the number of decimal digits in d.
int digits(uint64_t d) {
int nd = log10_pow2(len64(d));
return nd + (int) (d >= uint64pow10[nd]);
}
// i2a is the formatting of 00..99 concatenated,
// a lookup table for formatting [0, 99].
static const char i2a[201] =
"00010203040506070809"
"10111213141516171819"
"20212223242526272829"
"30313233343536373839"
"40414243444546474849"
"50515253545556575859"
"60616263646566676869"
"70717273747576777879"
"80818283848586878889"
"90919293949596979899";
// format_base10 formats the decimal representation of u into the nd bytes
// at a. The caller is responsible for ensuring that nd is big enough to hold
// u. If nd is too big, leading zeros will be filled in as needed.
static inline void format_base10(char *a, int nd, uint64_t u) {
while (nd >= 8) {
// Format last 8 digits (4 pairs).
uint32_t x3210 = (uint32_t) (u % 100000000);
u /= 100000000;
uint32_t x32 = x3210 / 10000, x10 = x3210 % 10000;
uint32_t x1 = (x10 / 100) * 2, x0 = (x10 % 100) * 2;
uint32_t x3 = (x32 / 100) * 2, x2 = (x32 % 100) * 2;
a[nd - 1] = i2a[x0 + 1];
a[nd - 2] = i2a[x0];
a[nd - 3] = i2a[x1 + 1];
a[nd - 4] = i2a[x1];
a[nd - 5] = i2a[x2 + 1];
a[nd - 6] = i2a[x2];
a[nd - 7] = i2a[x3 + 1];
a[nd - 8] = i2a[x3];
nd -= 8;
}
uint32_t x = (uint32_t) u;
if (nd >= 4) {
// Format last 4 digits (2 pairs).
uint32_t x10 = x % 10000;
x /= 10000;
uint32_t x1 = (x10 / 100) * 2, x0 = (x10 % 100) * 2;
a[nd - 1] = i2a[x0 + 1];
a[nd - 2] = i2a[x0];
a[nd - 3] = i2a[x1 + 1];
a[nd - 4] = i2a[x1];
nd -= 4;
}
if (nd >= 2) {
// Format last 2 digits.
uint32_t x0 = (x % 100) * 2;
x /= 100;
a[nd - 1] = i2a[x0 + 1];
a[nd - 2] = i2a[x0];
nd -= 2;
}
if (nd > 0) {
// Format final digit.
a[0] = (char) ('0' + x);
}
}
// write_exponent appends the exponent k the way milo::WriteExponent() does:
// a sign, then one, two, or three digits with no leading zero padding.
static inline int write_exponent(char *s, int k) {
int n = 0;
if (k < 0) {
s[n++] = '-';
k = -k;
} else {
s[n++] = '+';
}
if (k >= 100) {
s[n++] = (char) ('0' + k / 100);
k %= 100;
s[n++] = i2a[k * 2];
s[n++] = i2a[k * 2 + 1];
} else if (k >= 10) {
s[n++] = i2a[k * 2];
s[n++] = i2a[k * 2 + 1];
} else {
s[n++] = (char) ('0' + k);
}
return n;
}
// format renders d * 10**p, negated if negative, choosing between plain and
// exponential notation exactly as milo::Prettify() does.
int format(char *buf, uint64_t d, int p, int nd, bool negative) {
char *s = buf;
if (negative) {
*s++ = '-';
}
const int kk = nd + p; // 10^(kk-1) <= v < 10^kk
if (nd <= kk && kk <= 21) {
// 1234e7 -> 12340000000
format_base10(s, nd, d);
memset(s + nd, '0', (size_t) (kk - nd));
return (int) (s - buf) + kk;
}
if (0 < kk && kk <= 21) {
// 1234e-2 -> 12.34
// Lay the digits down one byte high, then slide the integer part
// back down over the gap, which leaves room for the point.
format_base10(s + 1, nd, d);
memmove(s, s + 1, (size_t) kk);
s[kk] = '.';
return (int) (s - buf) + nd + 1;
}
if (-6 < kk && kk <= 0) {
// 1234e-6 -> 0.001234
s[0] = '0';
s[1] = '.';
memset(s + 2, '0', (size_t) -kk);
format_base10(s + 2 - kk, nd, d);
return (int) (s - buf) + 2 - kk + nd;
}
int n;
if (nd == 1) {
// 1e30
s[0] = (char) ('0' + d);
n = 1;
} else {
// 1234e30 -> 1.234e33
format_base10(s + 1, nd, d);
s[0] = s[1];
s[1] = '.';
n = nd + 1;
}
s[n++] = 'e';
n += write_exponent(s + n, kk - 1);
return (int) (s - buf) + n;
}
std::string dtoa(double value) {
if (std::isnan(value)) {
return "nan";
}
if (std::isinf(value)) {
if (value < 0) {
return "-inf";
} else {
return "inf";
}
}
if (value == 0) {
return "0";
}
uint64_t d;
int p;
shortest(value, &d, &p);
char buf[32];
int n = format(buf, d, p, digits(d), value < 0);
return std::string(buf, (size_t) n);
}
} // namespace fpfmt
-38
View File
@@ -1,38 +0,0 @@
// C++ port of Russ Cox's fpfmt shortest-float formatting algorithm,
// from https://github.com/rsc/fpfmt (fpfmt.go).
//
// The original Go code is Copyright 2025 The Go Authors and is covered by
// the BSD-style license in fpfmt/LICENSE.txt.
//
// fpfmt::dtoa() is a drop-in replacement for milo::dtoa_milo(): it produces
// the same output format (JSON-ish shortest round-trippable decimal, with
// "nan", "inf", "-inf" for the non-finite cases), but always chooses the
// genuinely shortest digit string, where Grisu2 sometimes emits one digit
// more than necessary.
#pragma once
#include <stdint.h>
#include <string>
namespace fpfmt {
// shortest computes the shortest decimal d * 10**p that round-trips back to f.
// The caller must have already excluded 0, NaN, and ±Inf. The sign of f is
// ignored; the magnitude is what is formatted.
void shortest(double f, uint64_t *d, int *p);
// digits returns the number of decimal digits in d (d must be nonzero).
int digits(uint64_t d);
// format writes the milo-compatible rendering of (negative ? -1 : 1) * d * 10**p
// into buf, which must have room for at least 32 bytes, and returns the number
// of bytes written. nd must be digits(d).
int format(char *buf, uint64_t d, int p, int nd, bool negative);
// dtoa formats value the way milo::dtoa_milo() did, but using the shortest
// possible digit string.
std::string dtoa(double value);
} // namespace fpfmt
-720
View File
@@ -1,720 +0,0 @@
// Generated from https://github.com/rsc/fpfmt pow10tab.go (BSD-style license; see LICENSE.txt).
// Code generated by: go run pow10gen.go. DO NOT EDIT.
#pragma once
#include <stdint.h>
namespace fpfmt {
constexpr int pow10Min = -348;
constexpr int pow10Max = 347;
// A pm_hi_lo represents hi<<64 - lo.
struct pm_hi_lo {
uint64_t hi;
uint64_t lo;
};
// pow10_tab holds 128-bit mantissas of powers of 10.
// The values are scaled so the high bit is always set.
static const pm_hi_lo pow10_tab[pow10Max - pow10Min + 1] = {
{0xfa8fd5a0081c0289ULL, 0xe8cd3796329f1bacULL}, // 1e-348 * 2**1284
{0x9c99e58405118196ULL, 0xf18042bddfa3714bULL}, // 1e-347 * 2**1280
{0xc3c05ee50655e1fbULL, 0xade0536d578c4d9eULL}, // 1e-346 * 2**1277
{0xf4b0769e47eb5a79ULL, 0x19586848ad6f6106ULL}, // 1e-345 * 2**1274
{0x98ee4a22ecf3188cULL, 0x6fd7412d6c659ca3ULL}, // 1e-344 * 2**1270
{0xbf29dcaba82fdeafULL, 0x8bcd1178c77f03ccULL}, // 1e-343 * 2**1267
{0xeef453d6923bd65bULL, 0xeec055d6f95ec4c0ULL}, // 1e-342 * 2**1264
{0x9558b4661b6565f9ULL, 0xb53835a65bdb3af8ULL}, // 1e-341 * 2**1260
{0xbaaee17fa23ebf77ULL, 0xa286430ff2d209b6ULL}, // 1e-340 * 2**1257
{0xe95a99df8ace6f54ULL, 0x0b27d3d3ef868c23ULL}, // 1e-339 * 2**1254
{0x91d8a02bb6c10595ULL, 0x86f8e46475b41796ULL}, // 1e-338 * 2**1250
{0xb64ec836a47146faULL, 0x68b71d7d93211d7bULL}, // 1e-337 * 2**1247
{0xe3e27a444d8d98b8ULL, 0x02e4e4dcf7e964daULL}, // 1e-336 * 2**1244
{0x8e6d8c6ab0787f73ULL, 0x01cf0f0a1af1df08ULL}, // 1e-335 * 2**1240
{0xb208ef855c969f50ULL, 0x4242d2cca1ae56caULL}, // 1e-334 * 2**1237
{0xde8b2b66b3bc4724ULL, 0x52d3877fca19ec7dULL}, // 1e-333 * 2**1234
{0x8b16fb203055ac77ULL, 0xb3c434afde5033ceULL}, // 1e-332 * 2**1230
{0xaddcb9e83c6b1794ULL, 0x20b541dbd5e440c2ULL}, // 1e-331 * 2**1227
{0xd953e8624b85dd79ULL, 0x28e29252cb5d50f2ULL}, // 1e-330 * 2**1224
{0x87d4713d6f33aa6cULL, 0x798d9b73bf1a5297ULL}, // 1e-329 * 2**1220
{0xa9c98d8ccb009507ULL, 0x97f10250aee0e73dULL}, // 1e-328 * 2**1217
{0xd43bf0effdc0ba49ULL, 0xfded42e4da99210dULL}, // 1e-327 * 2**1214
{0x84a57695fe98746eULL, 0xfeb449cf089fb4a8ULL}, // 1e-326 * 2**1210
{0xa5ced43b7e3e9189ULL, 0xbe615c42cac7a1d2ULL}, // 1e-325 * 2**1207
{0xcf42894a5dce35ebULL, 0xadf9b3537d798a46ULL}, // 1e-324 * 2**1204
{0x818995ce7aa0e1b3ULL, 0x8cbc10142e6bf66cULL}, // 1e-323 * 2**1200
{0xa1ebfb4219491a20ULL, 0xefeb14193a06f407ULL}, // 1e-322 * 2**1197
{0xca66fa129f9b60a7ULL, 0x2be5d91f8888b109ULL}, // 1e-321 * 2**1194
{0xfd00b897478238d1ULL, 0x76df4f676aaadd4bULL}, // 1e-320 * 2**1191
{0x9e20735e8cb16383ULL, 0xaa4b91a0a2aaca4fULL}, // 1e-319 * 2**1187
{0xc5a890362fddbc63ULL, 0x14de7608cb557ce2ULL}, // 1e-318 * 2**1184
{0xf712b443bbd52b7cULL, 0x5a16138afe2adc1bULL}, // 1e-317 * 2**1181
{0x9a6bb0aa55653b2eULL, 0xb84dcc36dedac991ULL}, // 1e-316 * 2**1177
{0xc1069cd4eabe89f9ULL, 0x66613f4496917bf5ULL}, // 1e-315 * 2**1174
{0xf148440a256e2c77ULL, 0x3ff98f15bc35daf2ULL}, // 1e-314 * 2**1171
{0x96cd2a865764dbcbULL, 0xc7fbf96d95a1a8d7ULL}, // 1e-313 * 2**1167
{0xbc807527ed3e12bdULL, 0x39faf7c8fb0a130dULL}, // 1e-312 * 2**1164
{0xeba09271e88d976cULL, 0x0879b5bb39cc97d1ULL}, // 1e-311 * 2**1161
{0x93445b8731587ea4ULL, 0x854c1195041fdee2ULL}, // 1e-310 * 2**1157
{0xb8157268fdae9e4dULL, 0xa69f15fa4527d69bULL}, // 1e-309 * 2**1154
{0xe61acf033d1a45e0ULL, 0x9046db78d671cc42ULL}, // 1e-308 * 2**1151
{0x8fd0c16206306bacULL, 0x5a2c492b86071fa9ULL}, // 1e-307 * 2**1147
{0xb3c4f1ba87bc8697ULL, 0x70b75b766788e793ULL}, // 1e-306 * 2**1144
{0xe0b62e2929aba83dULL, 0xcce53254016b2178ULL}, // 1e-305 * 2**1141
{0x8c71dcd9ba0b4926ULL, 0x600f3f7480e2f4ebULL}, // 1e-304 * 2**1137
{0xaf8e5410288e1b70ULL, 0xf8130f51a11bb226ULL}, // 1e-303 * 2**1134
{0xdb71e91432b1a24bULL, 0x3617d32609629eafULL}, // 1e-302 * 2**1131
{0x892731ac9faf056fULL, 0x41cee3f7c5dda32dULL}, // 1e-301 * 2**1127
{0xab70fe17c79ac6cbULL, 0x92429cf5b7550bf9ULL}, // 1e-300 * 2**1124
{0xd64d3d9db981787eULL, 0xf6d34433252a4ef7ULL}, // 1e-299 * 2**1121
{0x85f0468293f0eb4fULL, 0xda440a9ff73a715aULL}, // 1e-298 * 2**1117
{0xa76c582338ed2622ULL, 0x50d50d47f5090db1ULL}, // 1e-297 * 2**1114
{0xd1476e2c07286fabULL, 0xe50a5099f24b511eULL}, // 1e-296 * 2**1111
{0x82cca4db847945cbULL, 0xaf267260376f12b2ULL}, // 1e-295 * 2**1107
{0xa37fce126597973dULL, 0x1af00ef8454ad75fULL}, // 1e-294 * 2**1104
{0xcc5fc196fefd7d0dULL, 0xe1ac12b6569d8d37ULL}, // 1e-293 * 2**1101
{0xff77b1fcbebcdc50ULL, 0xda171763ec44f085ULL}, // 1e-292 * 2**1098
{0x9faacf3df73609b2ULL, 0x884e6e9e73ab1653ULL}, // 1e-291 * 2**1094
{0xc795830d75038c1eULL, 0x2a620a461095dbe8ULL}, // 1e-290 * 2**1091
{0xf97ae3d0d2446f26ULL, 0xb4fa8cd794bb52e2ULL}, // 1e-289 * 2**1088
{0x9becce62836ac578ULL, 0xb11c9806bcf513cdULL}, // 1e-288 * 2**1084
{0xc2e801fb244576d6ULL, 0xdd63be086c3258c0ULL}, // 1e-287 * 2**1081
{0xf3a20279ed56d48bULL, 0x94bcad8a873eeef0ULL}, // 1e-286 * 2**1078
{0x9845418c345644d7ULL, 0x7cf5ec7694875556ULL}, // 1e-285 * 2**1074
{0xbe5691ef416bd60dULL, 0xdc33679439a92aacULL}, // 1e-284 * 2**1071
{0xedec366b11c6cb90ULL, 0xd340417948137557ULL}, // 1e-283 * 2**1068
{0x94b3a202eb1c3f3aULL, 0x840828ebcd0c2956ULL}, // 1e-282 * 2**1064
{0xb9e08a83a5e34f08ULL, 0x250a3326c04f33acULL}, // 1e-281 * 2**1061
{0xe858ad248f5c22caULL, 0x2e4cbff070630097ULL}, // 1e-280 * 2**1058
{0x91376c36d99995bfULL, 0xdceff7f6463de05eULL}, // 1e-279 * 2**1054
{0xb58547448ffffb2eULL, 0x542bf5f3d7cd5875ULL}, // 1e-278 * 2**1051
{0xe2e69915b3fff9faULL, 0xe936f370cdc0ae93ULL}, // 1e-277 * 2**1048
{0x8dd01fad907ffc3cULL, 0x51c2582680986d1cULL}, // 1e-276 * 2**1044
{0xb1442798f49ffb4bULL, 0x6632ee3020be8863ULL}, // 1e-275 * 2**1041
{0xdd95317f31c7fa1eULL, 0xbfbfa9bc28ee2a7cULL}, // 1e-274 * 2**1038
{0x8a7d3eef7f1cfc53ULL, 0xb7d7ca159994da8dULL}, // 1e-273 * 2**1034
{0xad1c8eab5ee43b67ULL, 0x25cdbc9afffa1130ULL}, // 1e-272 * 2**1031
{0xd863b256369d4a41ULL, 0x6f412bc1bff8957dULL}, // 1e-271 * 2**1028
{0x873e4f75e2224e69ULL, 0xa588bb5917fb5d6eULL}, // 1e-270 * 2**1024
{0xa90de3535aaae203ULL, 0x8eeaea2f5dfa34c9ULL}, // 1e-269 * 2**1021
{0xd3515c2831559a84ULL, 0xf2a5a4bb3578c1fcULL}, // 1e-268 * 2**1018
{0x8412d9991ed58092ULL, 0x17a786f5016b793dULL}, // 1e-267 * 2**1014
{0xa5178fff668ae0b7ULL, 0x9d9168b241c6578dULL}, // 1e-266 * 2**1011
{0xce5d73ff402d98e4ULL, 0x04f5c2ded237ed70ULL}, // 1e-265 * 2**1008
{0x80fa687f881c7f8fULL, 0x831999cb4362f466ULL}, // 1e-264 * 2**1004
{0xa139029f6a239f73ULL, 0xe3e0003e143bb17fULL}, // 1e-263 * 2**1001
{0xc987434744ac874fULL, 0x5cd8004d994a9ddfULL}, // 1e-262 * 2**998
{0xfbe9141915d7a923ULL, 0xb40e0060ff9d4557ULL}, // 1e-261 * 2**995
{0x9d71ac8fada6c9b6ULL, 0x9088c03c9fc24b56ULL}, // 1e-260 * 2**991
{0xc4ce17b399107c23ULL, 0x34aaf04bc7b2de2cULL}, // 1e-259 * 2**988
{0xf6019da07f549b2cULL, 0x81d5ac5eb99f95b7ULL}, // 1e-258 * 2**985
{0x99c102844f94e0fcULL, 0xd1258bbb3403bd92ULL}, // 1e-257 * 2**981
{0xc0314325637a193aULL, 0x056eeeaa0104acf7ULL}, // 1e-256 * 2**978
{0xf03d93eebc589f89ULL, 0x86caaa548145d835ULL}, // 1e-255 * 2**975
{0x96267c7535b763b6ULL, 0xb43eaa74d0cba721ULL}, // 1e-254 * 2**971
{0xbbb01b9283253ca3ULL, 0x614e551204fe90e9ULL}, // 1e-253 * 2**968
{0xea9c227723ee8bccULL, 0xb9a1ea56863e3523ULL}, // 1e-252 * 2**965
{0x92a1958a76751760ULL, 0xf405327613e6e136ULL}, // 1e-251 * 2**961
{0xb749faed14125d37ULL, 0x31067f1398e09984ULL}, // 1e-250 * 2**958
{0xe51c79a85916f485ULL, 0x7d481ed87f18bfe5ULL}, // 1e-249 * 2**955
{0x8f31cc0937ae58d3ULL, 0x2e4d13474f6f77efULL}, // 1e-248 * 2**951
{0xb2fe3f0b8599ef08ULL, 0x79e05819234b55eaULL}, // 1e-247 * 2**948
{0xdfbdcece67006acaULL, 0x98586e1f6c1e2b65ULL}, // 1e-246 * 2**945
{0x8bd6a141006042beULL, 0x1f3744d3a392db1fULL}, // 1e-245 * 2**941
{0xaecc49914078536eULL, 0xa70516088c7791e7ULL}, // 1e-244 * 2**938
{0xda7f5bf590966849ULL, 0x50c65b8aaf957661ULL}, // 1e-243 * 2**935
{0x888f99797a5e012eULL, 0x927bf936adbd69fcULL}, // 1e-242 * 2**931
{0xaab37fd7d8f58179ULL, 0x371af784592cc47cULL}, // 1e-241 * 2**928
{0xd5605fcdcf32e1d7ULL, 0x04e1b5656f77f59bULL}, // 1e-240 * 2**925
{0x855c3be0a17fcd27ULL, 0xa30d115f65aaf980ULL}, // 1e-239 * 2**921
{0xa6b34ad8c9dfc070ULL, 0x0bd055b73f15b7e1ULL}, // 1e-238 * 2**918
{0xd0601d8efc57b08cULL, 0x0ec46b250edb25d9ULL}, // 1e-237 * 2**915
{0x823c12795db6ce58ULL, 0x893ac2f72948f7a7ULL}, // 1e-236 * 2**911
{0xa2cb1717b52481eeULL, 0xab8973b4f39b3591ULL}, // 1e-235 * 2**908
{0xcb7ddcdda26da269ULL, 0x566bd0a2308202f6ULL}, // 1e-234 * 2**905
{0xfe5d54150b090b03ULL, 0x2c06c4cabca283b3ULL}, // 1e-233 * 2**902
{0x9efa548d26e5a6e2ULL, 0x3b843afeb5e59250ULL}, // 1e-232 * 2**898
{0xc6b8e9b0709f109bULL, 0xca6549be635ef6e4ULL}, // 1e-231 * 2**895
{0xf867241c8cc6d4c1ULL, 0x3cfe9c2dfc36b49dULL}, // 1e-230 * 2**892
{0x9b407691d7fc44f9ULL, 0x861f219cbda230e2ULL}, // 1e-229 * 2**888
{0xc21094364dfb5637ULL, 0x67a6ea03ed0abd1bULL}, // 1e-228 * 2**885
{0xf294b943e17a2bc5ULL, 0xc190a484e84d6c62ULL}, // 1e-227 * 2**882
{0x979cf3ca6cec5b5bULL, 0x58fa66d3113063bdULL}, // 1e-226 * 2**878
{0xbd8430bd08277232ULL, 0xaf390087d57c7cacULL}, // 1e-225 * 2**875
{0xece53cec4a314ebeULL, 0x5b0740a9cadb9bd7ULL}, // 1e-224 * 2**872
{0x940f4613ae5ed137ULL, 0x78e4886a1ec94166ULL}, // 1e-223 * 2**868
{0xb913179899f68585ULL, 0xd71daa84a67b91c0ULL}, // 1e-222 * 2**865
{0xe757dd7ec07426e6ULL, 0xcce51525d01a7630ULL}, // 1e-221 * 2**862
{0x9096ea6f38489850ULL, 0xc00f2d37a21089deULL}, // 1e-220 * 2**858
{0xb4bca50b065abe64ULL, 0xf012f8858a94ac56ULL}, // 1e-219 * 2**855
{0xe1ebce4dc7f16dfcULL, 0x2c17b6a6ed39d76bULL}, // 1e-218 * 2**852
{0x8d3360f09cf6e4beULL, 0x9b8ed228544426a3ULL}, // 1e-217 * 2**848
{0xb080392cc4349dedULL, 0x427286b26955304cULL}, // 1e-216 * 2**845
{0xdca04777f541c568ULL, 0x130f285f03aa7c5fULL}, // 1e-215 * 2**842
{0x89e42caaf9491b61ULL, 0x0be9793b624a8dbbULL}, // 1e-214 * 2**838
{0xac5d37d5b79b623aULL, 0xcee3d78a3add312aULL}, // 1e-213 * 2**835
{0xd77485cb25823ac8ULL, 0x829ccd6cc9947d74ULL}, // 1e-212 * 2**832
{0x86a8d39ef77164bdULL, 0x51a20063fdfcce68ULL}, // 1e-211 * 2**828
{0xa8530886b54dbdecULL, 0x260a807cfd7c0203ULL}, // 1e-210 * 2**825
{0xd267caa862a12d67ULL, 0x2f8d209c3cdb0284ULL}, // 1e-209 * 2**822
{0x8380dea93da4bc61ULL, 0xbdb83461a608e192ULL}, // 1e-208 * 2**818
{0xa46116538d0deb79ULL, 0xad26417a0f8b19f7ULL}, // 1e-207 * 2**815
{0xcd795be870516657ULL, 0x986fd1d8936de074ULL}, // 1e-206 * 2**812
{0x806bd9714632dff7ULL, 0xff45e3275c24ac49ULL}, // 1e-205 * 2**808
{0xa086cfcd97bf97f4ULL, 0x7f175bf1332dd75bULL}, // 1e-204 * 2**805
{0xc8a883c0fdaf7df1ULL, 0x9edd32ed7ff94d32ULL}, // 1e-203 * 2**802
{0xfad2a4b13d1b5d6dULL, 0x86947fa8dff7a07eULL}, // 1e-202 * 2**799
{0x9cc3a6eec6311a64ULL, 0x341ccfc98bfac44fULL}, // 1e-201 * 2**795
{0xc3f490aa77bd60fdULL, 0x412403bbeef97563ULL}, // 1e-200 * 2**792
{0xf4f1b4d515acb93cULL, 0x116d04aaeab7d2bbULL}, // 1e-199 * 2**789
{0x991711052d8bf3c6ULL, 0x8ae422ead2b2e3b5ULL}, // 1e-198 * 2**785
{0xbf5cd54678eef0b7ULL, 0x2d9d2ba5875f9ca2ULL}, // 1e-197 * 2**782
{0xef340a98172aace5ULL, 0x7904768ee93783cbULL}, // 1e-196 * 2**779
{0x9580869f0e7aac0fULL, 0x2ba2ca1951c2b25fULL}, // 1e-195 * 2**775
{0xbae0a846d2195713ULL, 0x768b7c9fa6335ef6ULL}, // 1e-194 * 2**772
{0xe998d258869facd8ULL, 0xd42e5bc78fc036b4ULL}, // 1e-193 * 2**769
{0x91ff83775423cc07ULL, 0x849cf95cb9d82230ULL}, // 1e-192 * 2**765
{0xb67f6455292cbf09ULL, 0xe5c437b3e84e2abdULL}, // 1e-191 * 2**762
{0xe41f3d6a7377eecbULL, 0xdf3545a0e261b56cULL}, // 1e-190 * 2**759
{0x8e938662882af53fULL, 0xab814b848d7d1163ULL}, // 1e-189 * 2**755
{0xb23867fb2a35b28eULL, 0x16619e65b0dc55bcULL}, // 1e-188 * 2**752
{0xdec681f9f4c31f32ULL, 0x9bfa05ff1d136b2bULL}, // 1e-187 * 2**749
{0x8b3c113c38f9f37fULL, 0x217c43bf722c22fbULL}, // 1e-186 * 2**745
{0xae0b158b4738705fULL, 0x69db54af4eb72bbaULL}, // 1e-185 * 2**742
{0xd98ddaee19068c77ULL, 0xc45229db2264f6a8ULL}, // 1e-184 * 2**739
{0x87f8a8d4cfa417caULL, 0x1ab35a28f57f1a29ULL}, // 1e-183 * 2**735
{0xa9f6d30a038d1dbdULL, 0xa16030b332dee0b3ULL}, // 1e-182 * 2**732
{0xd47487cc8470652cULL, 0x89b83cdfff9698e0ULL}, // 1e-181 * 2**729
{0x84c8d4dfd2c63f3cULL, 0xd613260bffbe1f8cULL}, // 1e-180 * 2**725
{0xa5fb0a17c777cf0aULL, 0x0b97ef8effada76fULL}, // 1e-179 * 2**722
{0xcf79cc9db955c2cdULL, 0x8e7deb72bf99114bULL}, // 1e-178 * 2**719
{0x81ac1fe293d599c0ULL, 0x390eb327b7bfaacfULL}, // 1e-177 * 2**715
{0xa21727db38cb0030ULL, 0x47525ff1a5af9583ULL}, // 1e-176 * 2**712
{0xca9cf1d206fdc03cULL, 0x5926f7ee0f1b7ae3ULL}, // 1e-175 * 2**709
{0xfd442e4688bd304bULL, 0x6f70b5e992e2599cULL}, // 1e-174 * 2**706
{0x9e4a9cec15763e2fULL, 0x65a671b1fbcd7801ULL}, // 1e-173 * 2**702
{0xc5dd44271ad3cdbbULL, 0xbf100e1e7ac0d602ULL}, // 1e-172 * 2**699
{0xf7549530e188c129ULL, 0x2ed411a619710b83ULL}, // 1e-171 * 2**696
{0x9a94dd3e8cf578baULL, 0x7d448b07cfe6a731ULL}, // 1e-170 * 2**692
{0xc13a148e3032d6e8ULL, 0x1c95adc9c3e050feULL}, // 1e-169 * 2**689
{0xf18899b1bc3f8ca2ULL, 0x23bb193c34d8653eULL}, // 1e-168 * 2**686
{0x96f5600f15a7b7e6ULL, 0xd654efc5a1073f46ULL}, // 1e-167 * 2**682
{0xbcb2b812db11a5dfULL, 0x8bea2bb709490f18ULL}, // 1e-166 * 2**679
{0xebdf661791d60f57ULL, 0xeee4b6a4cb9b52deULL}, // 1e-165 * 2**676
{0x936b9fcebb25c996ULL, 0x354ef226ff4113cbULL}, // 1e-164 * 2**672
{0xb84687c269ef3bfcULL, 0xc2a2aeb0bf1158bdULL}, // 1e-163 * 2**669
{0xe65829b3046b0afbULL, 0xf34b5a5ceed5aeedULL}, // 1e-162 * 2**666
{0x8ff71a0fe2c2e6ddULL, 0xb80f187a15458d54ULL}, // 1e-161 * 2**662
{0xb3f4e093db73a094ULL, 0xa612de989a96f0a9ULL}, // 1e-160 * 2**659
{0xe0f218b8d25088b9ULL, 0xcf97963ec13cacd3ULL}, // 1e-159 * 2**656
{0x8c974f7383725574ULL, 0xe1bebde738c5ec04ULL}, // 1e-158 * 2**652
{0xafbd2350644eead0ULL, 0x1a2e6d6106f76705ULL}, // 1e-157 * 2**649
{0xdbac6c247d62a584ULL, 0x20ba08b948b540c6ULL}, // 1e-156 * 2**646
{0x894bc396ce5da773ULL, 0x94744573cd71487cULL}, // 1e-155 * 2**642
{0xab9eb47c81f51150ULL, 0xf99156d0c0cd9a9bULL}, // 1e-154 * 2**639
{0xd686619ba27255a3ULL, 0x37f5ac84f1010142ULL}, // 1e-153 * 2**636
{0x8613fd0145877586ULL, 0x42f98bd316a0a0c9ULL}, // 1e-152 * 2**632
{0xa798fc4196e952e8ULL, 0xd3b7eec7dc48c8fbULL}, // 1e-151 * 2**629
{0xd17f3b51fca3a7a1ULL, 0x08a5ea79d35afb3aULL}, // 1e-150 * 2**626
{0x82ef85133de648c5ULL, 0x6567b28c2418dd04ULL}, // 1e-149 * 2**622
{0xa3ab66580d5fdaf6ULL, 0x3ec19f2f2d1f1445ULL}, // 1e-148 * 2**619
{0xcc963fee10b7d1b4ULL, 0xce7206faf866d957ULL}, // 1e-147 * 2**616
{0xffbbcfe994e5c620ULL, 0x020e88b9b6808fadULL}, // 1e-146 * 2**613
{0x9fd561f1fd0f9bd4ULL, 0x01491574121059ccULL}, // 1e-145 * 2**609
{0xc7caba6e7c5382c9ULL, 0x019b5ad11694703fULL}, // 1e-144 * 2**606
{0xf9bd690a1b68637cULL, 0xc20231855c398c4fULL}, // 1e-143 * 2**603
{0x9c1661a651213e2eULL, 0xf9415ef359a3f7b1ULL}, // 1e-142 * 2**599
{0xc31bfa0fe5698db9ULL, 0xb791b6b0300cf59dULL}, // 1e-141 * 2**596
{0xf3e2f893dec3f127ULL, 0xa576245c3c103305ULL}, // 1e-140 * 2**593
{0x986ddb5c6b3a76b8ULL, 0x0769d6b9a58a1fe3ULL}, // 1e-139 * 2**589
{0xbe89523386091466ULL, 0x09444c680eeca7dcULL}, // 1e-138 * 2**586
{0xee2ba6c0678b5980ULL, 0x8b955f8212a7d1d3ULL}, // 1e-137 * 2**583
{0x94db483840b717f0ULL, 0x573d5bb14ba8e323ULL}, // 1e-136 * 2**579
{0xba121a4650e4ddecULL, 0x6d0cb29d9e931becULL}, // 1e-135 * 2**576
{0xe896a0d7e51e1567ULL, 0x884fdf450637e2e8ULL}, // 1e-134 * 2**573
{0x915e2486ef32cd61ULL, 0xf531eb8b23e2edd1ULL}, // 1e-133 * 2**569
{0xb5b5ada8aaff80b9ULL, 0xf27e666decdba945ULL}, // 1e-132 * 2**566
{0xe3231912d5bf60e7ULL, 0xef1e000968129396ULL}, // 1e-131 * 2**563
{0x8df5efabc5979c90ULL, 0x3572c005e10b9c3eULL}, // 1e-130 * 2**559
{0xb1736b96b6fd83b4ULL, 0x42cf7007594e834dULL}, // 1e-129 * 2**556
{0xddd0467c64bce4a1ULL, 0x53834c092fa22421ULL}, // 1e-128 * 2**553
{0x8aa22c0dbef60ee5ULL, 0x94320f85bdc55694ULL}, // 1e-127 * 2**549
{0xad4ab7112eb3929eULL, 0x793e93672d36ac39ULL}, // 1e-126 * 2**546
{0xd89d64d57a607745ULL, 0x178e3840f8845748ULL}, // 1e-125 * 2**543
{0x87625f056c7c4a8cULL, 0xeeb8e3289b52b68dULL}, // 1e-124 * 2**539
{0xa93af6c6c79b5d2eULL, 0x2a671bf2c2276430ULL}, // 1e-123 * 2**536
{0xd389b4787982347aULL, 0xb500e2ef72b13d3cULL}, // 1e-122 * 2**533
{0x843610cb4bf160ccULL, 0x31208dd5a7aec645ULL}, // 1e-121 * 2**529
{0xa54394fe1eedb8ffULL, 0x3d68b14b119a77d7ULL}, // 1e-120 * 2**526
{0xce947a3da6a9273fULL, 0x8cc2dd9dd60115cdULL}, // 1e-119 * 2**523
{0x811ccc668829b888ULL, 0xf7f9ca82a5c0ada0ULL}, // 1e-118 * 2**519
{0xa163ff802a3426a9ULL, 0x35f83d234f30d908ULL}, // 1e-117 * 2**516
{0xc9bcff6034c13053ULL, 0x03764c6c22fd0f4aULL}, // 1e-116 * 2**513
{0xfc2c3f3841f17c68ULL, 0x4453df872bbc531dULL}, // 1e-115 * 2**510
{0x9d9ba7832936edc1ULL, 0x2ab46bb47b55b3f2ULL}, // 1e-114 * 2**506
{0xc5029163f384a932ULL, 0xf56186a19a2b20eeULL}, // 1e-113 * 2**503
{0xf64335bcf065d37eULL, 0xb2b9e84a00b5e92aULL}, // 1e-112 * 2**500
{0x99ea0196163fa42fULL, 0xafb4312e4071b1baULL}, // 1e-111 * 2**496
{0xc06481fb9bcf8d3aULL, 0x1ba13d79d08e1e29ULL}, // 1e-110 * 2**493
{0xf07da27a82c37089ULL, 0xa2898cd844b1a5b3ULL}, // 1e-109 * 2**490
{0x964e858c91ba2656ULL, 0xc595f8072aef0790ULL}, // 1e-108 * 2**486
{0xbbe226efb628afebULL, 0x76fb7608f5aac974ULL}, // 1e-107 * 2**483
{0xeadab0aba3b2dbe6ULL, 0xd4ba538b33157bd1ULL}, // 1e-106 * 2**480
{0x92c8ae6b464fc970ULL, 0xc4f47436ffed6d62ULL}, // 1e-105 * 2**476
{0xb77ada0617e3bbccULL, 0xf6319144bfe8c8bbULL}, // 1e-104 * 2**473
{0xe55990879ddcaabeULL, 0x33bdf595efe2faeaULL}, // 1e-103 * 2**470
{0x8f57fa54c2a9eab7ULL, 0x6056b97db5eddcd2ULL}, // 1e-102 * 2**466
{0xb32df8e9f3546565ULL, 0xb86c67dd23695406ULL}, // 1e-101 * 2**463
{0xdff9772470297ebeULL, 0xa68781d46c43a908ULL}, // 1e-100 * 2**460
{0x8bfbea76c619ef37ULL, 0xa814b124c3aa49a5ULL}, // 1e-99 * 2**456
{0xaefae51477a06b04ULL, 0x1219dd6df494dc0eULL}, // 1e-98 * 2**453
{0xdab99e59958885c5ULL, 0x16a054c971ba1312ULL}, // 1e-97 * 2**450
{0x88b402f7fd75539cULL, 0xee2434fde7144bebULL}, // 1e-96 * 2**446
{0xaae103b5fcd2a882ULL, 0x29ad423d60d95ee6ULL}, // 1e-95 * 2**443
{0xd59944a37c0752a3ULL, 0xb41892ccb90fb6a0ULL}, // 1e-94 * 2**440
{0x857fcae62d8493a6ULL, 0x908f5bbff3a9d224ULL}, // 1e-93 * 2**436
{0xa6dfbd9fb8e5b88fULL, 0x34b332aff09446adULL}, // 1e-92 * 2**433
{0xd097ad07a71f26b3ULL, 0x81dfff5becb95858ULL}, // 1e-91 * 2**430
{0x825ecc24c8737830ULL, 0x712bff9973f3d737ULL}, // 1e-90 * 2**426
{0xa2f67f2dfa90563cULL, 0x8d76ff7fd0f0cd05ULL}, // 1e-89 * 2**423
{0xcbb41ef979346bcbULL, 0xb0d4bf5fc52d0046ULL}, // 1e-88 * 2**420
{0xfea126b7d78186bdULL, 0x1d09ef37b6784057ULL}, // 1e-87 * 2**417
{0x9f24b832e6b0f437ULL, 0xf2263582d20b2836ULL}, // 1e-86 * 2**413
{0xc6ede63fa05d3144ULL, 0x6eafc2e3868df244ULL}, // 1e-85 * 2**410
{0xf8a95fcf88747d95ULL, 0x8a5bb39c68316ed5ULL}, // 1e-84 * 2**407
{0x9b69dbe1b548ce7dULL, 0x36795041c11ee545ULL}, // 1e-83 * 2**403
{0xc24452da229b021cULL, 0x0417a45231669e97ULL}, // 1e-82 * 2**400
{0xf2d56790ab41c2a3ULL, 0x051d8d66bdc0463cULL}, // 1e-81 * 2**397
{0x97c560ba6b0919a6ULL, 0x2332786036982be5ULL}, // 1e-80 * 2**393
{0xbdb6b8e905cb6010ULL, 0xabff1678443e36dfULL}, // 1e-79 * 2**390
{0xed246723473e3814ULL, 0xd6fedc16554dc497ULL}, // 1e-78 * 2**387
{0x9436c0760c86e30cULL, 0x065f498df5509adeULL}, // 1e-77 * 2**383
{0xb94470938fa89bcfULL, 0x07f71bf172a4c196ULL}, // 1e-76 * 2**380
{0xe7958cb87392c2c3ULL, 0x49f4e2edcf4df1fbULL}, // 1e-75 * 2**377
{0x90bd77f3483bb9baULL, 0x4e390dd4a190b73dULL}, // 1e-74 * 2**373
{0xb4ecd5f01a4aa829ULL, 0xe1c75149c9f4e50cULL}, // 1e-73 * 2**370
{0xe2280b6c20dd5233ULL, 0xda39259c3c721e4fULL}, // 1e-72 * 2**367
{0x8d590723948a5360ULL, 0xa863b781a5c752f1ULL}, // 1e-71 * 2**363
{0xb0af48ec79ace838ULL, 0xd27ca5620f3927aeULL}, // 1e-70 * 2**360
{0xdcdb1b2798182245ULL, 0x071bceba9307719aULL}, // 1e-69 * 2**357
{0x8a08f0f8bf0f156cULL, 0xe47161349be4a700ULL}, // 1e-68 * 2**353
{0xac8b2d36eed2dac6ULL, 0x1d8db981c2ddd0c0ULL}, // 1e-67 * 2**350
{0xd7adf884aa879178ULL, 0xa4f127e2339544f0ULL}, // 1e-66 * 2**347
{0x86ccbb52ea94baebULL, 0x6716b8ed603d4b16ULL}, // 1e-65 * 2**343
{0xa87fea27a539e9a6ULL, 0xc0dc6728b84c9ddbULL}, // 1e-64 * 2**340
{0xd29fe4b18e88640fULL, 0x711380f2e65fc552ULL}, // 1e-63 * 2**337
{0x83a3eeeef9153e8aULL, 0xe6ac3097cffbdb53ULL}, // 1e-62 * 2**333
{0xa48ceaaab75a8e2cULL, 0xa0573cbdc3fad228ULL}, // 1e-61 * 2**330
{0xcdb02555653131b7ULL, 0xc86d0bed34f986b2ULL}, // 1e-60 * 2**327
{0x808e17555f3ebf12ULL, 0x1d442774411bf42fULL}, // 1e-59 * 2**323
{0xa0b19d2ab70e6ed7ULL, 0xa49531515162f13bULL}, // 1e-58 * 2**320
{0xc8de047564d20a8cULL, 0x0dba7da5a5bbad8aULL}, // 1e-57 * 2**317
{0xfb158592be068d2fULL, 0x11291d0f0f2a98edULL}, // 1e-56 * 2**314
{0x9ced737bb6c4183eULL, 0xaab9b229697a9f94ULL}, // 1e-55 * 2**310
{0xc428d05aa4751e4dULL, 0x55681eb3c3d94779ULL}, // 1e-54 * 2**307
{0xf53304714d9265e0ULL, 0x2ac22660b4cf9957ULL}, // 1e-53 * 2**304
{0x993fe2c6d07b7facULL, 0x1ab957fc7101bfd6ULL}, // 1e-52 * 2**300
{0xbf8fdb78849a5f97ULL, 0x2167adfb8d422fccULL}, // 1e-51 * 2**297
{0xef73d256a5c0f77dULL, 0x69c1997a7092bbbfULL}, // 1e-50 * 2**294
{0x95a8637627989aaeULL, 0x2218ffec865bb557ULL}, // 1e-49 * 2**290
{0xbb127c53b17ec15aULL, 0xaa9f3fe7a7f2a2adULL}, // 1e-48 * 2**287
{0xe9d71b689dde71b0ULL, 0x55470fe191ef4b59ULL}, // 1e-47 * 2**284
{0x9226712162ab070eULL, 0x354c69ecfb358f17ULL}, // 1e-46 * 2**280
{0xb6b00d69bb55c8d2ULL, 0xc29f84683a02f2ddULL}, // 1e-45 * 2**277
{0xe45c10c42a2b3b06ULL, 0x734765824883af95ULL}, // 1e-44 * 2**274
{0x8eb98a7a9a5b04e4ULL, 0x880c9f716d524dbdULL}, // 1e-43 * 2**270
{0xb267ed1940f1c61dULL, 0xaa0fc74dc8a6e12cULL}, // 1e-42 * 2**267
{0xdf01e85f912e37a4ULL, 0x9493b9213ad09977ULL}, // 1e-41 * 2**264
{0x8b61313bbabce2c7ULL, 0xdcdc53b4c4c25feaULL}, // 1e-40 * 2**260
{0xae397d8aa96c1b78ULL, 0x541368a1f5f2f7e5ULL}, // 1e-39 * 2**257
{0xd9c7dced53c72256ULL, 0x691842ca736fb5deULL}, // 1e-38 * 2**254
{0x881cea14545c7576ULL, 0x81af29be8825d1abULL}, // 1e-37 * 2**250
{0xaa242499697392d3ULL, 0x221af42e2a2f4616ULL}, // 1e-36 * 2**247
{0xd4ad2dbfc3d07788ULL, 0x6aa1b139b4bb179bULL}, // 1e-35 * 2**244
{0x84ec3c97da624ab5ULL, 0x42a50ec410f4eec1ULL}, // 1e-34 * 2**240
{0xa6274bbdd0fadd62ULL, 0x134e527515322a71ULL}, // 1e-33 * 2**237
{0xcfb11ead453994bbULL, 0x9821e7125a7eb50dULL}, // 1e-32 * 2**234
{0x81ceb32c4b43fcf5ULL, 0x7f15306b788f3128ULL}, // 1e-31 * 2**230
{0xa2425ff75e14fc32ULL, 0x5eda7c8656b2fd72ULL}, // 1e-30 * 2**227
{0xcad2f7f5359a3b3fULL, 0xf6911ba7ec5fbccfULL}, // 1e-29 * 2**224
{0xfd87b5f28300ca0eULL, 0x74356291e777ac03ULL}, // 1e-28 * 2**221
{0x9e74d1b791e07e49ULL, 0x88a15d9b30aacb82ULL}, // 1e-27 * 2**217
{0xc612062576589ddbULL, 0x6ac9b501fcd57e62ULL}, // 1e-26 * 2**214
{0xf79687aed3eec552ULL, 0xc57c22427c0addfbULL}, // 1e-25 * 2**211
{0x9abe14cd44753b53ULL, 0x3b6d95698d86cabdULL}, // 1e-24 * 2**207
{0xc16d9a0095928a28ULL, 0x8a48fac3f0e87d6cULL}, // 1e-23 * 2**204
{0xf1c90080baf72cb2ULL, 0xacdb3974ed229cc7ULL}, // 1e-22 * 2**201
{0x971da05074da7befULL, 0x2c0903e91435a1fcULL}, // 1e-21 * 2**197
{0xbce5086492111aebULL, 0x770b44e359430a7bULL}, // 1e-20 * 2**194
{0xec1e4a7db69561a6ULL, 0xd4ce161c2f93cd1aULL}, // 1e-19 * 2**191
{0x9392ee8e921d5d08ULL, 0xc500cdd19dbc6030ULL}, // 1e-18 * 2**187
{0xb877aa3236a4b44aULL, 0xf6410146052b783dULL}, // 1e-17 * 2**184
{0xe69594bec44de15cULL, 0xb3d141978676564cULL}, // 1e-16 * 2**181
{0x901d7cf73ab0acdaULL, 0xf062c8feb409f5efULL}, // 1e-15 * 2**177
{0xb424dc35095cd810ULL, 0xac7b7b3e610c736bULL}, // 1e-14 * 2**174
{0xe12e13424bb40e14ULL, 0xd79a5a0df94f9046ULL}, // 1e-13 * 2**171
{0x8cbccc096f5088ccULL, 0x06c07848bbd1ba2cULL}, // 1e-12 * 2**167
{0xafebff0bcb24aaffULL, 0x0870965aeac628b7ULL}, // 1e-11 * 2**164
{0xdbe6fecebdedd5bfULL, 0x4a8cbbf1a577b2e4ULL}, // 1e-10 * 2**161
{0x89705f4136b4a598ULL, 0xce97f577076acfcfULL}, // 1e-9 * 2**157
{0xabcc77118461cefdULL, 0x023df2d4c94583c2ULL}, // 1e-8 * 2**154
{0xd6bf94d5e57a42bdULL, 0xc2cd6f89fb96e4b3ULL}, // 1e-7 * 2**151
{0x8637bd05af6c69b6ULL, 0x59c065b63d3e4ef0ULL}, // 1e-6 * 2**147
{0xa7c5ac471b478424ULL, 0xf0307f23cc8de2acULL}, // 1e-5 * 2**144
{0xd1b71758e219652cULL, 0x2c3c9eecbfb15b57ULL}, // 1e-4 * 2**141
{0x83126e978d4fdf3cULL, 0x9ba5e353f7ced916ULL}, // 1e-3 * 2**137
{0xa3d70a3d70a3d70bULL, 0xc28f5c28f5c28f5cULL}, // 1e-2 * 2**134
{0xcccccccccccccccdULL, 0x3333333333333333ULL}, // 1e-1 * 2**131
{0x8000000000000000ULL, 0x0000000000000000ULL}, // 1e0 * 2**127
{0xa000000000000000ULL, 0x0000000000000000ULL}, // 1e1 * 2**124
{0xc800000000000000ULL, 0x0000000000000000ULL}, // 1e2 * 2**121
{0xfa00000000000000ULL, 0x0000000000000000ULL}, // 1e3 * 2**118
{0x9c40000000000000ULL, 0x0000000000000000ULL}, // 1e4 * 2**114
{0xc350000000000000ULL, 0x0000000000000000ULL}, // 1e5 * 2**111
{0xf424000000000000ULL, 0x0000000000000000ULL}, // 1e6 * 2**108
{0x9896800000000000ULL, 0x0000000000000000ULL}, // 1e7 * 2**104
{0xbebc200000000000ULL, 0x0000000000000000ULL}, // 1e8 * 2**101
{0xee6b280000000000ULL, 0x0000000000000000ULL}, // 1e9 * 2**98
{0x9502f90000000000ULL, 0x0000000000000000ULL}, // 1e10 * 2**94
{0xba43b74000000000ULL, 0x0000000000000000ULL}, // 1e11 * 2**91
{0xe8d4a51000000000ULL, 0x0000000000000000ULL}, // 1e12 * 2**88
{0x9184e72a00000000ULL, 0x0000000000000000ULL}, // 1e13 * 2**84
{0xb5e620f480000000ULL, 0x0000000000000000ULL}, // 1e14 * 2**81
{0xe35fa931a0000000ULL, 0x0000000000000000ULL}, // 1e15 * 2**78
{0x8e1bc9bf04000000ULL, 0x0000000000000000ULL}, // 1e16 * 2**74
{0xb1a2bc2ec5000000ULL, 0x0000000000000000ULL}, // 1e17 * 2**71
{0xde0b6b3a76400000ULL, 0x0000000000000000ULL}, // 1e18 * 2**68
{0x8ac7230489e80000ULL, 0x0000000000000000ULL}, // 1e19 * 2**64
{0xad78ebc5ac620000ULL, 0x0000000000000000ULL}, // 1e20 * 2**61
{0xd8d726b7177a8000ULL, 0x0000000000000000ULL}, // 1e21 * 2**58
{0x878678326eac9000ULL, 0x0000000000000000ULL}, // 1e22 * 2**54
{0xa968163f0a57b400ULL, 0x0000000000000000ULL}, // 1e23 * 2**51
{0xd3c21bcecceda100ULL, 0x0000000000000000ULL}, // 1e24 * 2**48
{0x84595161401484a0ULL, 0x0000000000000000ULL}, // 1e25 * 2**44
{0xa56fa5b99019a5c8ULL, 0x0000000000000000ULL}, // 1e26 * 2**41
{0xcecb8f27f4200f3aULL, 0x0000000000000000ULL}, // 1e27 * 2**38
{0x813f3978f8940985ULL, 0xc000000000000000ULL}, // 1e28 * 2**34
{0xa18f07d736b90be6ULL, 0xb000000000000000ULL}, // 1e29 * 2**31
{0xc9f2c9cd04674edfULL, 0x5c00000000000000ULL}, // 1e30 * 2**28
{0xfc6f7c4045812297ULL, 0xb300000000000000ULL}, // 1e31 * 2**25
{0x9dc5ada82b70b59eULL, 0x0fe0000000000000ULL}, // 1e32 * 2**21
{0xc5371912364ce306ULL, 0x93d8000000000000ULL}, // 1e33 * 2**18
{0xf684df56c3e01bc7ULL, 0x38ce000000000000ULL}, // 1e34 * 2**15
{0x9a130b963a6c115dULL, 0xc380c00000000000ULL}, // 1e35 * 2**11
{0xc097ce7bc90715b4ULL, 0xb460f00000000000ULL}, // 1e36 * 2**8
{0xf0bdc21abb48db21ULL, 0xe1792c0000000000ULL}, // 1e37 * 2**5
{0x96769950b50d88f5ULL, 0xecebbb8000000000ULL}, // 1e38 * 2**1
{0xbc143fa4e250eb32ULL, 0xe826aa6000000000ULL}, // 1e39 * 2**-2
{0xeb194f8e1ae525feULL, 0xa23054f800000000ULL}, // 1e40 * 2**-5
{0x92efd1b8d0cf37bfULL, 0xa55e351b00000000ULL}, // 1e41 * 2**-9
{0xb7abc627050305aeULL, 0x0eb5c261c0000000ULL}, // 1e42 * 2**-12
{0xe596b7b0c643c71aULL, 0x926332fa30000000ULL}, // 1e43 * 2**-15
{0x8f7e32ce7bea5c70ULL, 0x1b7dffdc5e000000ULL}, // 1e44 * 2**-19
{0xb35dbf821ae4f38cULL, 0x225d7fd375800000ULL}, // 1e45 * 2**-22
{0xe0352f62a19e306fULL, 0x2af4dfc852e00000ULL}, // 1e46 * 2**-25
{0x8c213d9da502de46ULL, 0xbad90bdd33cc0000ULL}, // 1e47 * 2**-29
{0xaf298d050e4395d7ULL, 0x698f4ed480bf0000ULL}, // 1e48 * 2**-32
{0xdaf3f04651d47b4dULL, 0xc3f32289a0eec000ULL}, // 1e49 * 2**-35
{0x88d8762bf324cd10ULL, 0x5a77f59604953800ULL}, // 1e50 * 2**-39
{0xab0e93b6efee0054ULL, 0x7115f2fb85ba8600ULL}, // 1e51 * 2**-42
{0xd5d238a4abe98069ULL, 0x8d5b6fba67292780ULL}, // 1e52 * 2**-45
{0x85a36366eb71f042ULL, 0xb85925d48079b8b0ULL}, // 1e53 * 2**-49
{0xa70c3c40a64e6c52ULL, 0x666f6f49a09826dcULL}, // 1e54 * 2**-52
{0xd0cf4b50cfe20766ULL, 0x000b4b1c08be3093ULL}, // 1e55 * 2**-55
{0x82818f1281ed44a0ULL, 0x40070ef18576de5bULL}, // 1e56 * 2**-59
{0xa321f2d7226895c8ULL, 0x5008d2ade6d495f2ULL}, // 1e57 * 2**-62
{0xcbea6f8ceb02bb3aULL, 0x640b07596089bb6fULL}, // 1e58 * 2**-65
{0xfee50b7025c36a09ULL, 0xfd0dc92fb8ac2a4bULL}, // 1e59 * 2**-68
{0x9f4f2726179a2246ULL, 0xfe289dbdd36b9a6fULL}, // 1e60 * 2**-72
{0xc722f0ef9d80aad7ULL, 0xbdb2c52d4846810aULL}, // 1e61 * 2**-75
{0xf8ebad2b84e0d58cULL, 0x2d1f76789a58214dULL}, // 1e62 * 2**-78
{0x9b934c3b330c8578ULL, 0x9c33aa0b607714d0ULL}, // 1e63 * 2**-82
{0xc2781f49ffcfa6d6ULL, 0xc340948e3894da04ULL}, // 1e64 * 2**-85
{0xf316271c7fc3908bULL, 0x7410b9b1c6ba1085ULL}, // 1e65 * 2**-88
{0x97edd871cfda3a57ULL, 0x688a740f1c344a53ULL}, // 1e66 * 2**-92
{0xbde94e8e43d0c8edULL, 0xc2ad1112e3415ce8ULL}, // 1e67 * 2**-95
{0xed63a231d4c4fb28ULL, 0xb35855579c11b422ULL}, // 1e68 * 2**-98
{0x945e455f24fb1cf9ULL, 0x70173556c18b1095ULL}, // 1e69 * 2**-102
{0xb975d6b6ee39e437ULL, 0x4c1d02ac71edd4bbULL}, // 1e70 * 2**-105
{0xe7d34c64a9c85d45ULL, 0x9f2443578e6949e9ULL}, // 1e71 * 2**-108
{0x90e40fbeea1d3a4bULL, 0x4376aa16b901ce32ULL}, // 1e72 * 2**-112
{0xb51d13aea4a488deULL, 0x9454549c674241beULL}, // 1e73 * 2**-115
{0xe264589a4dcdab15ULL, 0x396969c38112d22eULL}, // 1e74 * 2**-118
{0x8d7eb76070a08aedULL, 0x03e1e21a30abc35dULL}, // 1e75 * 2**-122
{0xb0de65388cc8ada9ULL, 0xc4da5aa0bcd6b434ULL}, // 1e76 * 2**-125
{0xdd15fe86affad913ULL, 0xb610f148ec0c6141ULL}, // 1e77 * 2**-128
{0x8a2dbf142dfcc7acULL, 0x91ca96cd9387bcc8ULL}, // 1e78 * 2**-132
{0xacb92ed9397bf997ULL, 0xb63d3c80f869abfbULL}, // 1e79 * 2**-135
{0xd7e77a8f87daf7fcULL, 0x23cc8ba1368416f9ULL}, // 1e80 * 2**-138
{0x86f0ac99b4e8dafeULL, 0x965fd744c2128e5cULL}, // 1e81 * 2**-142
{0xa8acd7c0222311bdULL, 0x3bf7cd15f29731f3ULL}, // 1e82 * 2**-145
{0xd2d80db02aabd62cULL, 0x0af5c05b6f3cfe6fULL}, // 1e83 * 2**-148
{0x83c7088e1aab65dcULL, 0x86d9983925861f05ULL}, // 1e84 * 2**-152
{0xa4b8cab1a1563f53ULL, 0xa88ffe476ee7a6c7ULL}, // 1e85 * 2**-155
{0xcde6fd5e09abcf27ULL, 0x12b3fdd94aa19079ULL}, // 1e86 * 2**-158
{0x80b05e5ac60b6179ULL, 0xabb07ea7cea4fa4bULL}, // 1e87 * 2**-162
{0xa0dc75f1778e39d7ULL, 0x969c9e51c24e38deULL}, // 1e88 * 2**-165
{0xc913936dd571c84dULL, 0xfc43c5e632e1c716ULL}, // 1e89 * 2**-168
{0xfb5878494ace3a60ULL, 0xfb54b75fbf9a38dcULL}, // 1e90 * 2**-171
{0x9d174b2dcec0e47cULL, 0x9d14f29bd7c06389ULL}, // 1e91 * 2**-175
{0xc45d1df942711d9bULL, 0xc45a2f42cdb07c6bULL}, // 1e92 * 2**-178
{0xf5746577930d6501ULL, 0x3570bb13811c9b86ULL}, // 1e93 * 2**-181
{0x9968bf6abbe85f21ULL, 0x816674ec30b1e134ULL}, // 1e94 * 2**-185
{0xbfc2ef456ae276e9ULL, 0x61c012273cde5981ULL}, // 1e95 * 2**-188
{0xefb3ab16c59b14a3ULL, 0x3a3016b10c15efe1ULL}, // 1e96 * 2**-191
{0x95d04aee3b80ece6ULL, 0x445e0e2ea78db5edULL}, // 1e97 * 2**-195
{0xbb445da9ca612820ULL, 0xd57591ba51712368ULL}, // 1e98 * 2**-198
{0xea1575143cf97227ULL, 0x0ad2f628e5cd6c42ULL}, // 1e99 * 2**-201
{0x924d692ca61be759ULL, 0xa6c3d9d98fa063a9ULL}, // 1e100 * 2**-205
{0xb6e0c377cfa2e12fULL, 0x9074d04ff3887c93ULL}, // 1e101 * 2**-208
{0xe498f455c38b997bULL, 0xf4920463f06a9bb8ULL}, // 1e102 * 2**-211
{0x8edf98b59a373fedULL, 0xb8db42be7642a153ULL}, // 1e103 * 2**-215
{0xb2977ee300c50fe8ULL, 0xa712136e13d349a8ULL}, // 1e104 * 2**-218
{0xdf3d5e9bc0f653e2ULL, 0xd0d6984998c81c12ULL}, // 1e105 * 2**-221
{0x8b865b215899f46dULL, 0x42861f2dff7d118bULL}, // 1e106 * 2**-225
{0xae67f1e9aec07188ULL, 0x1327a6f97f5c55eeULL}, // 1e107 * 2**-228
{0xda01ee641a708deaULL, 0x17f190b7df336b6aULL}, // 1e108 * 2**-231
{0x884134fe908658b3ULL, 0xcef6fa72eb802322ULL}, // 1e109 * 2**-235
{0xaa51823e34a7eedfULL, 0x42b4b90fa6602beaULL}, // 1e110 * 2**-238
{0xd4e5e2cdc1d1ea97ULL, 0x9361e7538ff836e5ULL}, // 1e111 * 2**-241
{0x850fadc09923329fULL, 0xfc1d309439fb224fULL}, // 1e112 * 2**-245
{0xa6539930bf6bff46ULL, 0x7b247cb94879eae3ULL}, // 1e113 * 2**-248
{0xcfe87f7cef46ff17ULL, 0x19ed9be79a98659cULL}, // 1e114 * 2**-251
{0x81f14fae158c5f6fULL, 0xb0348170c09f3f81ULL}, // 1e115 * 2**-255
{0xa26da3999aef774aULL, 0x1c41a1ccf0c70f62ULL}, // 1e116 * 2**-258
{0xcb090c8001ab551dULL, 0xa3520a402cf8d33aULL}, // 1e117 * 2**-261
{0xfdcb4fa002162a64ULL, 0x8c268cd038370809ULL}, // 1e118 * 2**-264
{0x9e9f11c4014dda7fULL, 0xd798180223226505ULL}, // 1e119 * 2**-268
{0xc646d63501a1511eULL, 0x4d7e1e02abeafe47ULL}, // 1e120 * 2**-271
{0xf7d88bc24209a566ULL, 0xe0dda58356e5bdd9ULL}, // 1e121 * 2**-274
{0x9ae7575969460760ULL, 0xcc8a8772164f96a7ULL}, // 1e122 * 2**-278
{0xc1a12d2fc3978938ULL, 0xffad294e9be37c51ULL}, // 1e123 * 2**-281
{0xf209787bb47d6b85ULL, 0x3f9873a242dc5b65ULL}, // 1e124 * 2**-284
{0x9745eb4d50ce6333ULL, 0x07bf484569c9b91fULL}, // 1e125 * 2**-288
{0xbd176620a501fc00ULL, 0x49af1a56c43c2767ULL}, // 1e126 * 2**-291
{0xec5d3fa8ce427b00ULL, 0x5c1ae0ec754b3141ULL}, // 1e127 * 2**-294
{0x93ba47c980e98ce0ULL, 0x3990cc93c94efec8ULL}, // 1e128 * 2**-298
{0xb8a8d9bbe123f018ULL, 0x47f4ffb8bba2be7bULL}, // 1e129 * 2**-301
{0xe6d3102ad96cec1eULL, 0x59f23fa6ea8b6e1aULL}, // 1e130 * 2**-304
{0x9043ea1ac7e41393ULL, 0x783767c8529724d0ULL}, // 1e131 * 2**-308
{0xb454e4a179dd1878ULL, 0xd64541ba673cee04ULL}, // 1e132 * 2**-311
{0xe16a1dc9d8545e95ULL, 0x0bd69229010c2985ULL}, // 1e133 * 2**-314
{0x8ce2529e2734bb1eULL, 0xe7661b59a0a799f3ULL}, // 1e134 * 2**-318
{0xb01ae745b101e9e5ULL, 0xa13fa23008d18070ULL}, // 1e135 * 2**-321
{0xdc21a1171d42645eULL, 0x898f8abc0b05e08cULL}, // 1e136 * 2**-324
{0x899504ae72497ebbULL, 0x95f9b6b586e3ac57ULL}, // 1e137 * 2**-328
{0xabfa45da0edbde6aULL, 0xfb782462e89c976dULL}, // 1e138 * 2**-331
{0xd6f8d7509292d604ULL, 0xba562d7ba2c3bd49ULL}, // 1e139 * 2**-334
{0x865b86925b9bc5c3ULL, 0xf475dc6d45ba564dULL}, // 1e140 * 2**-338
{0xa7f26836f282b733ULL, 0x719353889728ebe1ULL}, // 1e141 * 2**-341
{0xd1ef0244af236500ULL, 0xcdf8286abcf326d9ULL}, // 1e142 * 2**-344
{0x8335616aed761f20ULL, 0x80bb1942b617f847ULL}, // 1e143 * 2**-348
{0xa402b9c5a8d3a6e8ULL, 0xa0e9df93639df659ULL}, // 1e144 * 2**-351
{0xcd036837130890a2ULL, 0xc92457783c8573f0ULL}, // 1e145 * 2**-354
{0x802221226be55a65ULL, 0x3db6b6ab25d36876ULL}, // 1e146 * 2**-358
{0xa02aa96b06deb0feULL, 0x0d246455ef484293ULL}, // 1e147 * 2**-361
{0xc83553c5c8965d3eULL, 0x906d7d6b6b1a5338ULL}, // 1e148 * 2**-364
{0xfa42a8b73abbf48dULL, 0x3488dcc645e0e806ULL}, // 1e149 * 2**-367
{0x9c69a97284b578d8ULL, 0x00d589fbebac9104ULL}, // 1e150 * 2**-371
{0xc38413cf25e2d70eULL, 0x010aec7ae697b545ULL}, // 1e151 * 2**-374
{0xf46518c2ef5b8cd2ULL, 0x814da799a03da296ULL}, // 1e152 * 2**-377
{0x98bf2f79d5993803ULL, 0x10d088c00426859eULL}, // 1e153 * 2**-381
{0xbeeefb584aff8604ULL, 0x5504aaf005302705ULL}, // 1e154 * 2**-384
{0xeeaaba2e5dbf6785ULL, 0x6a45d5ac067c30c7ULL}, // 1e155 * 2**-387
{0x952ab45cfa97a0b3ULL, 0x226ba58b840d9e7cULL}, // 1e156 * 2**-391
{0xba756174393d88e0ULL, 0x6b068eee6511061bULL}, // 1e157 * 2**-394
{0xe912b9d1478ceb18ULL, 0x85c832a9fe5547a2ULL}, // 1e158 * 2**-397
{0x91abb422ccb812efULL, 0x539d1faa3ef54cc5ULL}, // 1e159 * 2**-401
{0xb616a12b7fe617abULL, 0xa8846794ceb29ff6ULL}, // 1e160 * 2**-404
{0xe39c49765fdf9d95ULL, 0x12a5817a025f47f4ULL}, // 1e161 * 2**-407
{0x8e41ade9fbebc27eULL, 0xeba770ec417b8cf8ULL}, // 1e162 * 2**-411
{0xb1d219647ae6b31dULL, 0xa6914d2751da7037ULL}, // 1e163 * 2**-414
{0xde469fbd99a05fe4ULL, 0x9035a07126510c44ULL}, // 1e164 * 2**-417
{0x8aec23d680043befULL, 0xda218446b7f2a7abULL}, // 1e165 * 2**-421
{0xada72ccc20054aeaULL, 0x50a9e55865ef5195ULL}, // 1e166 * 2**-424
{0xd910f7ff28069da5ULL, 0xe4d45eae7f6b25fbULL}, // 1e167 * 2**-427
{0x87aa9aff79042287ULL, 0x6f04bb2d0fa2f7bdULL}, // 1e168 * 2**-431
{0xa99541bf57452b29ULL, 0xcac5e9f8538bb5acULL}, // 1e169 * 2**-434
{0xd3fa922f2d1675f3ULL, 0xbd776476686ea317ULL}, // 1e170 * 2**-437
{0x847c9b5d7c2e09b8ULL, 0x966a9eca014525eeULL}, // 1e171 * 2**-441
{0xa59bc234db398c26ULL, 0xbc05467c81966f6aULL}, // 1e172 * 2**-444
{0xcf02b2c21207ef2fULL, 0x6b06981ba1fc0b44ULL}, // 1e173 * 2**-447
{0x8161afb94b44f57eULL, 0xe2e41f11453d870aULL}, // 1e174 * 2**-451
{0xa1ba1ba79e1632ddULL, 0x9b9d26d5968ce8cdULL}, // 1e175 * 2**-454
{0xca28a291859bbf94ULL, 0x8284708afc302301ULL}, // 1e176 * 2**-457
{0xfcb2cb35e702af79ULL, 0xa3258cadbb3c2bc1ULL}, // 1e177 * 2**-460
{0x9defbf01b061adacULL, 0xc5f777ec95059b58ULL}, // 1e178 * 2**-464
{0xc56baec21c7a1917ULL, 0xf77555e7ba47022fULL}, // 1e179 * 2**-467
{0xf6c69a72a3989f5cULL, 0x7552ab61a8d8c2baULL}, // 1e180 * 2**-470
{0x9a3c2087a63f639aULL, 0xc953ab1d098779b4ULL}, // 1e181 * 2**-474
{0xc0cb28a98fcf3c80ULL, 0x7ba895e44be95822ULL}, // 1e182 * 2**-477
{0xf0fdf2d3f3c30ba0ULL, 0x9a92bb5d5ee3ae2aULL}, // 1e183 * 2**-480
{0x969eb7c47859e744ULL, 0x609bb51a5b4e4cdaULL}, // 1e184 * 2**-484
{0xbc4665b596706115ULL, 0x78c2a260f221e011ULL}, // 1e185 * 2**-487
{0xeb57ff22fc0c795aULL, 0x56f34af92eaa5815ULL}, // 1e186 * 2**-490
{0x9316ff75dd87cbd9ULL, 0xf6580edbbd2a770dULL}, // 1e187 * 2**-494
{0xb7dcbf5354e9becfULL, 0xf3ee1292ac7514d0ULL}, // 1e188 * 2**-497
{0xe5d3ef282a242e82ULL, 0x70e9973757925a05ULL}, // 1e189 * 2**-500
{0x8fa475791a569d11ULL, 0x0691fe8296bb7843ULL}, // 1e190 * 2**-504
{0xb38d92d760ec4456ULL, 0xc8367e233c6a5653ULL}, // 1e191 * 2**-507
{0xe070f78d3927556bULL, 0x7a441dac0b84ebe8ULL}, // 1e192 * 2**-510
{0x8c469ab843b89563ULL, 0x6c6a928b87331371ULL}, // 1e193 * 2**-514
{0xaf58416654a6babcULL, 0xc785372e68ffd84dULL}, // 1e194 * 2**-517
{0xdb2e51bfe9d0696bULL, 0xf96684fa033fce61ULL}, // 1e195 * 2**-520
{0x88fcf317f22241e3ULL, 0xbbe0131c4207e0fcULL}, // 1e196 * 2**-524
{0xab3c2fddeeaad25bULL, 0x2ad817e35289d93cULL}, // 1e197 * 2**-527
{0xd60b3bd56a5586f2ULL, 0x758e1ddc272c4f8bULL}, // 1e198 * 2**-530
{0x85c7056562757457ULL, 0x0978d2a9987bb1b6ULL}, // 1e199 * 2**-534
{0xa738c6bebb12d16dULL, 0x4bd70753fe9a9e24ULL}, // 1e200 * 2**-537
{0xd106f86e69d785c8ULL, 0x1eccc928fe4145adULL}, // 1e201 * 2**-540
{0x82a45b450226b39dULL, 0x133ffdb99ee8cb8cULL}, // 1e202 * 2**-544
{0xa34d721642b06085ULL, 0xd80ffd2806a2fe6fULL}, // 1e203 * 2**-547
{0xcc20ce9bd35c78a6ULL, 0xce13fc72084bbe0bULL}, // 1e204 * 2**-550
{0xff290242c83396cfULL, 0x8198fb8e8a5ead8eULL}, // 1e205 * 2**-553
{0x9f79a169bd203e42ULL, 0xf0ff9d39167b2c79ULL}, // 1e206 * 2**-557
{0xc75809c42c684dd2ULL, 0xad3f84875c19f797ULL}, // 1e207 * 2**-560
{0xf92e0c3537826146ULL, 0x588f65a93320757dULL}, // 1e208 * 2**-563
{0x9bbcc7a142b17cccULL, 0x77599f89bff4496eULL}, // 1e209 * 2**-567
{0xc2abf989935ddbffULL, 0x9530076c2ff15bcaULL}, // 1e210 * 2**-570
{0xf356f7ebf83552ffULL, 0xfa7c09473bedb2bcULL}, // 1e211 * 2**-573
{0x98165af37b2153dfULL, 0x3c8d85cc85748fb5ULL}, // 1e212 * 2**-577
{0xbe1bf1b059e9a8d7ULL, 0x8bb0e73fa6d1b3a3ULL}, // 1e213 * 2**-580
{0xeda2ee1c7064130dULL, 0xee9d210f9086208cULL}, // 1e214 * 2**-583
{0x9485d4d1c63e8be8ULL, 0x752234a9ba53d457ULL}, // 1e215 * 2**-587
{0xb9a74a0637ce2ee2ULL, 0x926ac1d428e8c96dULL}, // 1e216 * 2**-590
{0xe8111c87c5c1ba9aULL, 0x370572493322fbc8ULL}, // 1e217 * 2**-593
{0x910ab1d4db9914a1ULL, 0xe263676dbff5dd5dULL}, // 1e218 * 2**-597
{0xb54d5e4a127f59c9ULL, 0xdafc41492ff354b4ULL}, // 1e219 * 2**-600
{0xe2a0b5dc971f303bULL, 0xd1bb519b7bf029e2ULL}, // 1e220 * 2**-603
{0x8da471a9de737e25ULL, 0xa31513012d761a2dULL}, // 1e221 * 2**-607
{0xb10d8e1456105daeULL, 0x8bda57c178d3a0b8ULL}, // 1e222 * 2**-610
{0xdd50f1996b947519ULL, 0x2ed0edb1d70888e6ULL}, // 1e223 * 2**-613
{0x8a5296ffe33cc930ULL, 0x7d42948f26655590ULL}, // 1e224 * 2**-617
{0xace73cbfdc0bfb7cULL, 0x9c9339b2effeaaf4ULL}, // 1e225 * 2**-620
{0xd8210befd30efa5bULL, 0xc3b8081fabfe55b1ULL}, // 1e226 * 2**-623
{0x8714a775e3e95c79ULL, 0x9a530513cb7ef58eULL}, // 1e227 * 2**-627
{0xa8d9d1535ce3b397ULL, 0x80e7c658be5eb2f2ULL}, // 1e228 * 2**-630
{0xd31045a8341ca07dULL, 0xe121b7eeedf65fafULL}, // 1e229 * 2**-633
{0x83ea2b892091e44eULL, 0x6cb512f554b9fbcdULL}, // 1e230 * 2**-637
{0xa4e4b66b68b65d61ULL, 0x07e257b2a9e87ac0ULL}, // 1e231 * 2**-640
{0xce1de40642e3f4baULL, 0xc9daed9f54629971ULL}, // 1e232 * 2**-643
{0x80d2ae83e9ce78f4ULL, 0x3e28d48394bd9fe6ULL}, // 1e233 * 2**-647
{0xa1075a24e4421731ULL, 0x4db309a479ed07e0ULL}, // 1e234 * 2**-650
{0xc94930ae1d529cfdULL, 0x211fcc0d986849d8ULL}, // 1e235 * 2**-653
{0xfb9b7cd9a4a7443dULL, 0xe967bf10fe825c4eULL}, // 1e236 * 2**-656
{0x9d412e0806e88aa6ULL, 0x71e0d76a9f1179b1ULL}, // 1e237 * 2**-660
{0xc491798a08a2ad4fULL, 0x0e590d4546d5d81dULL}, // 1e238 * 2**-663
{0xf5b5d7ec8acb58a3ULL, 0x51ef5096988b4e24ULL}, // 1e239 * 2**-666
{0x9991a6f3d6bf1766ULL, 0x5335925e1f5710d6ULL}, // 1e240 * 2**-670
{0xbff610b0cc6edd40ULL, 0xe802f6f5a72cd50cULL}, // 1e241 * 2**-673
{0xeff394dcff8a948fULL, 0x2203b4b310f80a4fULL}, // 1e242 * 2**-676
{0x95f83d0a1fb69cdaULL, 0xb54250efea9b0671ULL}, // 1e243 * 2**-680
{0xbb764c4ca7a44410ULL, 0x6292e52be541c80eULL}, // 1e244 * 2**-683
{0xea53df5fd18d5514ULL, 0x7b379e76de923a12ULL}, // 1e245 * 2**-686
{0x92746b9be2f8552dULL, 0xcd02c30a4b1b644bULL}, // 1e246 * 2**-690
{0xb7118682dbb66a78ULL, 0xc04373ccdde23d5eULL}, // 1e247 * 2**-693
{0xe4d5e82392a40516ULL, 0xf05450c0155accb5ULL}, // 1e248 * 2**-696
{0x8f05b1163ba6832eULL, 0xd634b2780d58bff1ULL}, // 1e249 * 2**-700
{0xb2c71d5bca9023f9ULL, 0x8bc1df1610aeefedULL}, // 1e250 * 2**-703
{0xdf78e4b2bd342cf7ULL, 0x6eb256db94daabe9ULL}, // 1e251 * 2**-706
{0x8bab8eefb6409c1bULL, 0xe52f76493d08ab71ULL}, // 1e252 * 2**-710
{0xae9672aba3d0c321ULL, 0x5e7b53db8c4ad64eULL}, // 1e253 * 2**-713
{0xda3c0f568cc4f3e9ULL, 0x361a28d26f5d8be1ULL}, // 1e254 * 2**-716
{0x8865899617fb1872ULL, 0x81d05983859a776dULL}, // 1e255 * 2**-720
{0xaa7eebfb9df9de8eULL, 0x22446fe467011548ULL}, // 1e256 * 2**-723
{0xd51ea6fa85785632ULL, 0xaad58bdd80c15a9aULL}, // 1e257 * 2**-726
{0x8533285c936b35dfULL, 0x2ac5776a7078d8a0ULL}, // 1e258 * 2**-730
{0xa67ff273b8460357ULL, 0x7576d5450c970ec8ULL}, // 1e259 * 2**-733
{0xd01fef10a657842dULL, 0xd2d48a964fbcd27aULL}, // 1e260 * 2**-736
{0x8213f56a67f6b29cULL, 0x63c4d69df1d6038cULL}, // 1e261 * 2**-740
{0xa298f2c501f45f43ULL, 0x7cb60c456e4b8470ULL}, // 1e262 * 2**-743
{0xcb3f2f7642717714ULL, 0xdbe38f56c9de658cULL}, // 1e263 * 2**-746
{0xfe0efb53d30dd4d8ULL, 0x12dc732c7c55feefULL}, // 1e264 * 2**-749
{0x9ec95d1463e8a507ULL, 0x0bc9c7fbcdb5bf55ULL}, // 1e265 * 2**-753
{0xc67bb4597ce2ce49ULL, 0x4ebc39fac1232f2aULL}, // 1e266 * 2**-756
{0xf81aa16fdc1b81dbULL, 0x226b4879716bfaf5ULL}, // 1e267 * 2**-759
{0x9b10a4e5e9913129ULL, 0x35830d4be6e37cd9ULL}, // 1e268 * 2**-763
{0xc1d4ce1f63f57d73ULL, 0x02e3d09ee09c5c0fULL}, // 1e269 * 2**-766
{0xf24a01a73cf2dcd0ULL, 0x439cc4c698c37313ULL}, // 1e270 * 2**-769
{0x976e41088617ca02ULL, 0x2a41fafc1f7a27ecULL}, // 1e271 * 2**-773
{0xbd49d14aa79dbc83ULL, 0xb4d279bb2758b1e7ULL}, // 1e272 * 2**-776
{0xec9c459d51852ba3ULL, 0x22071829f12ede61ULL}, // 1e273 * 2**-779
{0x93e1ab8252f33b46ULL, 0x35446f1a36bd4afcULL}, // 1e274 * 2**-783
{0xb8da1662e7b00a18ULL, 0xc2958ae0c46c9dbcULL}, // 1e275 * 2**-786
{0xe7109bfba19c0c9eULL, 0xf33aed98f587c52bULL}, // 1e276 * 2**-789
{0x906a617d450187e3ULL, 0xd804d47f9974db3aULL}, // 1e277 * 2**-793
{0xb484f9dc9641e9dbULL, 0x4e06099f7fd21209ULL}, // 1e278 * 2**-796
{0xe1a63853bbd26452ULL, 0xa1878c075fc6968cULL}, // 1e279 * 2**-799
{0x8d07e33455637eb3ULL, 0x24f4b7849bdc1e17ULL}, // 1e280 * 2**-803
{0xb049dc016abc5e60ULL, 0x6e31e565c2d3259dULL}, // 1e281 * 2**-806
{0xdc5c5301c56b75f8ULL, 0x89be5ebf3387ef04ULL}, // 1e282 * 2**-809
{0x89b9b3e11b6329bbULL, 0x5616fb378034f562ULL}, // 1e283 * 2**-813
{0xac2820d9623bf42aULL, 0xab9cba05604232bbULL}, // 1e284 * 2**-816
{0xd732290fbacaf134ULL, 0x5683e886b852bf6aULL}, // 1e285 * 2**-819
{0x867f59a9d4bed6c1ULL, 0xb61271543333b7a2ULL}, // 1e286 * 2**-823
{0xa81f301449ee8c71ULL, 0xa3970da94000a58bULL}, // 1e287 * 2**-826
{0xd226fc195c6a2f8dULL, 0x8c7cd1139000ceeeULL}, // 1e288 * 2**-829
{0x83585d8fd9c25db8ULL, 0x37ce02ac3a008154ULL}, // 1e289 * 2**-833
{0xa42e74f3d032f526ULL, 0x45c183574880a1aaULL}, // 1e290 * 2**-836
{0xcd3a1230c43fb270ULL, 0xd731e42d1aa0ca14ULL}, // 1e291 * 2**-839
{0x80444b5e7aa7cf86ULL, 0x867f2e9c30a47e4cULL}, // 1e292 * 2**-843
{0xa0555e361951c367ULL, 0x281efa433ccd9de0ULL}, // 1e293 * 2**-846
{0xc86ab5c39fa63441ULL, 0x7226b8d40c010558ULL}, // 1e294 * 2**-849
{0xfa856334878fc151ULL, 0x4eb067090f0146aeULL}, // 1e295 * 2**-852
{0x9c935e00d4b9d8d3ULL, 0x912e4065a960cc2cULL}, // 1e296 * 2**-856
{0xc3b8358109e84f08ULL, 0xf579d07f13b8ff37ULL}, // 1e297 * 2**-859
{0xf4a642e14c6262c9ULL, 0x32d8449ed8a73f05ULL}, // 1e298 * 2**-862
{0x98e7e9cccfbd7dbeULL, 0x7fc72ae347688763ULL}, // 1e299 * 2**-866
{0xbf21e44003acdd2dULL, 0x1fb8f59c1942a93cULL}, // 1e300 * 2**-869
{0xeeea5d5004981479ULL, 0xe7a733031f93538bULL}, // 1e301 * 2**-872
{0x95527a5202df0cccULL, 0xf0c87fe1f3bc1437ULL}, // 1e302 * 2**-876
{0xbaa718e68396cffeULL, 0x2cfa9fda70ab1945ULL}, // 1e303 * 2**-879
{0xe950df20247c83feULL, 0xb83947d10cd5df96ULL}, // 1e304 * 2**-882
{0x91d28b7416cdd27fULL, 0xb323cce2a805abbeULL}, // 1e305 * 2**-886
{0xb6472e511c81471eULL, 0x1fecc01b520716adULL}, // 1e306 * 2**-889
{0xe3d8f9e563a198e6ULL, 0xa7e7f0222688dc59ULL}, // 1e307 * 2**-892
{0x8e679c2f5e44ff90ULL, 0xa8f0f615581589b7ULL}, // 1e308 * 2**-896
{0xb201833b35d63f74ULL, 0xd32d339aae1aec25ULL}, // 1e309 * 2**-899
{0xde81e40a034bcf50ULL, 0x07f8808159a1a72eULL}, // 1e310 * 2**-902
{0x8b112e86420f6192ULL, 0x04fb5050d805087dULL}, // 1e311 * 2**-906
{0xadd57a27d29339f7ULL, 0x863a24650e064a9cULL}, // 1e312 * 2**-909
{0xd94ad8b1c7380875ULL, 0xe7c8ad7e5187dd43ULL}, // 1e313 * 2**-912
{0x87cec76f1c830549ULL, 0x70dd6c6ef2f4ea4aULL}, // 1e314 * 2**-916
{0xa9c2794ae3a3c69bULL, 0x4d14c78aafb224ddULL}, // 1e315 * 2**-919
{0xd433179d9c8cb842ULL, 0xa059f96d5b9eae14ULL}, // 1e316 * 2**-922
{0x849feec281d7f329ULL, 0x24383be459432cccULL}, // 1e317 * 2**-926
{0xa5c7ea73224deff4ULL, 0xed464add6f93f7ffULL}, // 1e318 * 2**-929
{0xcf39e50feae16bf0ULL, 0x2897dd94cb78f5ffULL}, // 1e319 * 2**-932
{0x81842f29f2cce376ULL, 0x195eea7cff2b99bfULL}, // 1e320 * 2**-936
{0xa1e53af46f801c54ULL, 0x9fb6a51c3ef6802fULL}, // 1e321 * 2**-939
{0xca5e89b18b602369ULL, 0xc7a44e634eb4203bULL}, // 1e322 * 2**-942
{0xfcf62c1dee382c43ULL, 0xb98d61fc2261284aULL}, // 1e323 * 2**-945
{0x9e19db92b4e31baaULL, 0x93f85d3d957cb92eULL}, // 1e324 * 2**-949
{0xc5a05277621be294ULL, 0x38f6748cfadbe77aULL}, // 1e325 * 2**-952
{0xf70867153aa2db39ULL, 0x473411b03992e158ULL}, // 1e326 * 2**-955
{0x9a65406d44a5c904ULL, 0x8c808b0e23fbccd7ULL}, // 1e327 * 2**-959
{0xc0fe908895cf3b45ULL, 0xafa0add1acfac00dULL}, // 1e328 * 2**-962
{0xf13e34aabb430a16ULL, 0x9b88d94618397010ULL}, // 1e329 * 2**-965
{0x96c6e0eab509e64eULL, 0xa13587cbcf23e60aULL}, // 1e330 * 2**-969
{0xbc789925624c5fe1ULL, 0x4982e9bec2ecdf8dULL}, // 1e331 * 2**-972
{0xeb96bf6ebadf77d9ULL, 0x1be3a42e73a81770ULL}, // 1e332 * 2**-975
{0x933e37a534cbaae8ULL, 0x716e469d08490ea6ULL}, // 1e333 * 2**-979
{0xb80dc58e81fe95a2ULL, 0x8dc9d8444a5b524fULL}, // 1e334 * 2**-982
{0xe61136f2227e3b0aULL, 0x313c4e555cf226e3ULL}, // 1e335 * 2**-985
{0x8fcac257558ee4e7ULL, 0xdec5b0f55a17584eULL}, // 1e336 * 2**-989
{0xb3bd72ed2af29e20ULL, 0x56771d32b09d2e62ULL}, // 1e337 * 2**-992
{0xe0accfa875af45a8ULL, 0x6c14e47f5cc479faULL}, // 1e338 * 2**-995
{0x8c6c01c9498d8b89ULL, 0x438d0ecf99facc3cULL}, // 1e339 * 2**-999
{0xaf87023b9bf0ee6bULL, 0x1470528380797f4bULL}, // 1e340 * 2**-1002
{0xdb68c2ca82ed2a06ULL, 0x598c67246097df1eULL}, // 1e341 * 2**-1005
{0x892179be91d43a44ULL, 0x77f7c076bc5eeb73ULL}, // 1e342 * 2**-1009
{0xab69d82e364948d5ULL, 0x95f5b0946b76a64fULL}, // 1e343 * 2**-1012
{0xd6444e39c3db9b0aULL, 0x7b731cb986544fe3ULL}, // 1e344 * 2**-1015
{0x85eab0e41a6940e6ULL, 0x0d27f1f3f3f4b1eeULL}, // 1e345 * 2**-1019
{0xa7655d1d21039120ULL, 0x9071ee70f0f1de6aULL}, // 1e346 * 2**-1022
{0xd13eb46469447568ULL, 0xb48e6a0d2d2e5604ULL}, // 1e347 * 2**-1025
};
} // namespace fpfmt
+14 -11
View File
@@ -11,7 +11,7 @@
#include "protozero/varint.hpp"
#include "protozero/pbf_reader.hpp"
#include "protozero/pbf_writer.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "jsonpull/jsonpull.h"
#include "text.hpp"
#include "errors.hpp"
@@ -57,7 +57,7 @@ serial_val readValue(protozero::pbf_reader &pbf) {
case 2:
sv.type = mvt_double;
sv.s = fpfmt::dtoa(pbf.get_double());
sv.s = milo::dtoa_milo(pbf.get_double());
break;
case 3:
@@ -394,25 +394,28 @@ void readFeature(protozero::pbf_reader &pbf, size_t dim, double e, std::vector<s
auto tip = other.find("tippecanoe");
if (tip != other.end()) {
json_pull_ptr jp = json_begin_string(tip->second.s.c_str());
json_object_ptr o = json_read_tree(jp);
json_pull *jp = json_begin_string(tip->second.s.c_str());
json_object *o = json_read_tree(jp);
if (o != nullptr) {
if (o != NULL) {
json_object *min = json_hash_get(o, "minzoom");
if (min != nullptr && (min->type == JSON_NUMBER)) {
sf.tippecanoe_minzoom = integer_zoom(sst->fname, fpfmt::dtoa(min->number()));
if (min != NULL && (min->type == JSON_NUMBER)) {
sf.tippecanoe_minzoom = integer_zoom(sst->fname, milo::dtoa_milo(min->value.number.number));
}
json_object *max = json_hash_get(o, "maxzoom");
if (max != nullptr && (max->type == JSON_NUMBER)) {
sf.tippecanoe_maxzoom = integer_zoom(sst->fname, fpfmt::dtoa(max->number()));
if (max != NULL && (max->type == JSON_NUMBER)) {
sf.tippecanoe_maxzoom = integer_zoom(sst->fname, milo::dtoa_milo(max->value.number.number));
}
json_object *tlayer = json_hash_get(o, "layer");
if (tlayer != nullptr && (tlayer->type == JSON_STRING)) {
layername = tlayer->string();
if (tlayer != NULL && (tlayer->type == JSON_STRING)) {
layername = tlayer->value.string.string;
}
}
json_free(o);
json_end(jp);
}
serialize_feature(sst, sf, layername);
+1 -1
View File
@@ -7,7 +7,7 @@
#include "main.hpp"
#include "text.hpp"
#include "csv.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "options.hpp"
#include "errors.hpp"
+27 -27
View File
@@ -26,34 +26,34 @@ static const char *geometry_names[GEOM_TYPES] = {
// XXX duplicated
static void json_context(json_object *j) {
std::string s = json_stringify(j);
char *s = json_stringify(j);
if (s.size() >= 500) {
s.resize(497);
s.append("...");
if (strlen(s) >= 500) {
snprintf(s + 497, strlen(s) + 1 - 497, "...");
}
fprintf(stderr, "in JSON object %s\n", s.c_str());
fprintf(stderr, "in JSON object %s\n", s);
free(s); // stringify
}
void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
void parse_json(json_feature_action *jfa, json_pull *jp) {
long long found_hashes = 0;
long long found_features = 0;
long long found_geometries = 0;
while (1) {
json_object *j = json_read(jp);
if (j == nullptr) {
if (jp->error != nullptr) {
if (j == NULL) {
if (jp->error != NULL) {
fprintf(stderr, "%s:%d: %s: ", jfa->fname.c_str(), jp->line, jp->error);
if (jp->root != nullptr) {
json_context(jp->root.get());
if (jp->root != NULL) {
json_context(jp->root);
} else {
fprintf(stderr, "\n");
}
}
jp->root.reset();
json_free(jp->root);
break;
}
@@ -66,7 +66,7 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
}
json_object *type = json_hash_get(j, "type");
if (type == nullptr || type->type != JSON_STRING) {
if (type == NULL || type->type != JSON_STRING) {
continue;
}
@@ -74,25 +74,25 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
int i;
int is_geometry = 0;
for (i = 0; i < GEOM_TYPES; i++) {
if (type->string() == geometry_names[i]) {
if (strcmp(type->value.string.string, geometry_names[i]) == 0) {
is_geometry = 1;
break;
}
}
if (is_geometry) {
if (j->parent != nullptr) {
if (j->parent->type == JSON_ARRAY && j->parent->parent != nullptr) {
if (j->parent != NULL) {
if (j->parent->type == JSON_ARRAY && j->parent->parent != NULL) {
if (j->parent->parent->type == JSON_HASH) {
json_object *geometries = json_hash_get(j->parent->parent, "geometries");
if (geometries != nullptr) {
if (geometries != NULL) {
// Parent of Parent must be a GeometryCollection
is_geometry = 0;
}
}
} else if (j->parent->type == JSON_HASH) {
json_object *geometry = json_hash_get(j->parent, "geometry");
if (geometry != nullptr) {
if (geometry != NULL) {
// Parent must be a Feature
is_geometry = 0;
}
@@ -102,8 +102,8 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
if (is_geometry) {
json_object *jo = j;
while (jo != nullptr) {
if (jo->parent != nullptr && jo->parent->type == JSON_HASH) {
while (jo != NULL) {
if (jo->parent != NULL && jo->parent->type == JSON_HASH) {
if (json_hash_get(jo->parent, "properties") == jo) {
// Ancestor is the value corresponding to a properties key
is_geometry = 0;
@@ -120,14 +120,14 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
}
found_geometries++;
jfa->add_feature(j, false, nullptr, nullptr, nullptr, j);
jfa->add_feature(j, false, NULL, NULL, NULL, j);
json_free(j);
continue;
}
}
if (type->string() != "Feature") {
if (type->string() == "FeatureCollection") {
if (strcmp(type->value.string.string, "Feature") != 0) {
if (strcmp(type->value.string.string, "FeatureCollection") == 0) {
jfa->check_crs(j);
json_free(j);
}
@@ -141,7 +141,7 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
found_features++;
json_object *geometry = json_hash_get(j, "geometry");
if (geometry == nullptr) {
if (geometry == NULL) {
fprintf(stderr, "%s:%d: feature with no geometry: ", jfa->fname.c_str(), jp->line);
json_context(j);
json_free(j);
@@ -149,7 +149,7 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
}
json_object *properties = json_hash_get(j, "properties");
if (properties == nullptr || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
if (properties == NULL || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
fprintf(stderr, "%s:%d: feature without properties hash: ", jfa->fname.c_str(), jp->line);
json_context(j);
json_free(j);
@@ -159,8 +159,8 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
bool is_feature = true;
{
json_object *jo = j;
while (jo != nullptr) {
if (jo->parent != nullptr && jo->parent->type == JSON_HASH) {
while (jo != NULL) {
if (jo->parent != NULL && jo->parent->type == JSON_HASH) {
if (json_hash_get(jo->parent, "properties") == jo) {
// Ancestor is the value corresponding to a properties key
is_feature = false;
@@ -178,7 +178,7 @@ void parse_json(json_feature_action *jfa, json_pull_ptr &jp) {
json_object *id = json_hash_get(j, "id");
json_object *geometries = json_hash_get(geometry, "geometries");
if (geometries != nullptr && geometries->type == JSON_ARRAY) {
if (geometries != NULL && geometries->type == JSON_ARRAY) {
jfa->add_feature(geometries, true, properties, id, tippecanoe, j);
} else {
jfa->add_feature(geometry, false, properties, id, tippecanoe, j);
+1 -1
View File
@@ -8,4 +8,4 @@ struct json_feature_action {
virtual void check_crs(json_object *j) = 0;
};
void parse_json(json_feature_action *action, json_pull_ptr &jp);
void parse_json(json_feature_action *action, json_pull *jp);
+51 -53
View File
@@ -37,12 +37,12 @@
#include "read_json.hpp"
#include "mvt.hpp"
#include "geojson-loop.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
int serialize_geojson_feature(struct serialization_state *sst, json_object *geometry, json_object *properties, json_object *id, int layer, json_object *tippecanoe, json_object *feature, std::string const &layername) {
json_object *geometry_type = json_hash_get(geometry, "type");
if (geometry_type == nullptr) {
if (geometry_type == NULL) {
static int warned = 0;
if (!warned) {
fprintf(stderr, "%s:%d: null geometry (additional not reported): ", sst->fname, sst->line);
@@ -60,7 +60,7 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
}
json_object *coordinates = json_hash_get(geometry, "coordinates");
if (coordinates == nullptr || coordinates->type != JSON_ARRAY) {
if (coordinates == NULL || coordinates->type != JSON_ARRAY) {
fprintf(stderr, "%s:%d: feature without coordinates array: ", sst->fname, sst->line);
json_context(feature);
return 0;
@@ -68,12 +68,12 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
int t;
for (t = 0; t < GEOM_TYPES; t++) {
if (geometry_type->string() == geometry_names[t]) {
if (strcmp(geometry_type->value.string.string, geometry_names[t]) == 0) {
break;
}
}
if (t >= GEOM_TYPES) {
fprintf(stderr, "%s:%d: Can't handle geometry type %s: ", sst->fname, sst->line, geometry_type->string().c_str());
fprintf(stderr, "%s:%d: Can't handle geometry type %s: ", sst->fname, sst->line, geometry_type->value.string.string);
json_context(feature);
return 0;
}
@@ -82,48 +82,48 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
int tippecanoe_maxzoom = -1;
std::string tippecanoe_layername = layername;
if (tippecanoe != nullptr) {
if (tippecanoe != NULL) {
json_object *min = json_hash_get(tippecanoe, "minzoom");
if (min != nullptr && (min->type == JSON_NUMBER)) {
tippecanoe_minzoom = integer_zoom(sst->fname, fpfmt::dtoa(min->number()));
if (min != NULL && (min->type == JSON_NUMBER)) {
tippecanoe_minzoom = integer_zoom(sst->fname, milo::dtoa_milo(min->value.number.number));
}
json_object *max = json_hash_get(tippecanoe, "maxzoom");
if (max != nullptr && (max->type == JSON_NUMBER)) {
tippecanoe_maxzoom = integer_zoom(sst->fname, fpfmt::dtoa(max->number()));
if (max != NULL && (max->type == JSON_NUMBER)) {
tippecanoe_maxzoom = integer_zoom(sst->fname, milo::dtoa_milo(max->value.number.number));
}
json_object *ln = json_hash_get(tippecanoe, "layer");
if (ln != nullptr && (ln->type == JSON_STRING)) {
tippecanoe_layername = ln->string();
if (ln != NULL && (ln->type == JSON_STRING)) {
tippecanoe_layername = std::string(ln->value.string.string);
}
}
bool has_id = false;
unsigned long long id_value = 0;
if (id != nullptr) {
if (id != NULL) {
if (id->type == JSON_NUMBER) {
if (id->number() >= 0) {
if (id->value.number.number >= 0) {
char *err = NULL;
std::string id_number = fpfmt::dtoa(id->number());
std::string id_number = milo::dtoa_milo(id->value.number.number);
id_value = strtoull(id_number.c_str(), &err, 10);
if (id->large_unsigned() != 0) {
id_value = id->large_unsigned();
if (id->value.number.large_unsigned != 0) {
id_value = id->value.number.large_unsigned;
}
if (err != NULL && *err != '\0') {
static bool warned_frac = false;
if (!warned_frac) {
fprintf(stderr, "Warning: Can't represent non-integer feature ID %s\n", fpfmt::dtoa(id->number()).c_str());
fprintf(stderr, "Warning: Can't represent non-integer feature ID %s\n", milo::dtoa_milo(id->value.number.number).c_str());
warned_frac = true;
}
} else if (id->large_unsigned() == 0 && std::to_string(id_value) != fpfmt::dtoa(id->number())) {
} else if (id->value.number.large_unsigned == 0 && std::to_string(id_value) != milo::dtoa_milo(id->value.number.number)) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: Can't represent too-large feature ID %s\n", fpfmt::dtoa(id->number()).c_str());
fprintf(stderr, "Warning: Can't represent too-large feature ID %s\n", milo::dtoa_milo(id->value.number.number).c_str());
warned = true;
}
} else {
@@ -133,7 +133,7 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
static bool warned_neg = false;
if (!warned_neg) {
fprintf(stderr, "Warning: Can't represent negative feature ID %s\n", fpfmt::dtoa(id->number()).c_str());
fprintf(stderr, "Warning: Can't represent negative feature ID %s\n", milo::dtoa_milo(id->value.number.number).c_str());
warned_neg = true;
}
}
@@ -142,20 +142,20 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
if (additional[A_CONVERT_NUMERIC_IDS] && id->type == JSON_STRING) {
char *err = NULL;
id_value = strtoull(id->string().c_str(), &err, 10);
id_value = strtoull(id->value.string.string, &err, 10);
if (err != NULL && *err != '\0') {
static bool warned_frac = false;
if (!warned_frac) {
fprintf(stderr, "Warning: Can't represent non-integer feature ID %s\n", id->string().c_str());
fprintf(stderr, "Warning: Can't represent non-integer feature ID %s\n", id->value.string.string);
warned_frac = true;
}
} else if (std::to_string(id_value) != id->string()) {
} else if (std::to_string(id_value) != id->value.string.string) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: Can't represent too-large feature ID %s\n", id->string().c_str());
fprintf(stderr, "Warning: Can't represent too-large feature ID %s\n", id->value.string.string);
warned = true;
}
} else {
@@ -168,29 +168,33 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
static bool warned_nan = false;
if (!warned_nan) {
fprintf(stderr, "Warning: Can't represent non-numeric feature ID %s\n", json_stringify(id).c_str());
char *s = json_stringify(id);
fprintf(stderr, "Warning: Can't represent non-numeric feature ID %s\n", s);
free(s); // stringify
warned_nan = true;
}
}
}
}
size_t nprop = 0;
if (properties != NULL && properties->type == JSON_HASH) {
nprop = properties->value.object.length;
}
std::vector<std::shared_ptr<std::string>> full_keys;
std::vector<serial_val> values;
full_keys.reserve(nprop);
values.reserve(nprop);
key_pool key_pool;
if (properties != nullptr && properties->type == JSON_HASH) {
const auto &entries = properties->entries();
full_keys.reserve(entries.size());
values.reserve(entries.size());
for (size_t i = 0; i < nprop; i++) {
if (properties->value.object.keys[i]->type == JSON_STRING) {
serial_val sv = stringify_value(properties->value.object.values[i], sst->fname, sst->line, feature);
for (const auto &e : entries) {
if (e.key->type == JSON_STRING) {
serial_val sv = stringify_value(e.value.get(), sst->fname, sst->line, feature);
full_keys.emplace_back(key_pool.pool(e.key->string()));
values.push_back(std::move(sv));
}
full_keys.emplace_back(key_pool.pool(properties->value.object.keys[i]->value.string.string));
values.push_back(std::move(sv));
}
}
@@ -216,14 +220,14 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
void check_crs(json_object *j, const char *reading) {
json_object *crs = json_hash_get(j, "crs");
if (crs != nullptr) {
if (crs != NULL) {
json_object *properties = json_hash_get(crs, "properties");
if (properties != nullptr) {
if (properties != NULL) {
json_object *name = json_hash_get(properties, "name");
if (name != nullptr && name->type == JSON_STRING) {
if (name->string() != projection->alias) {
if (name != NULL && name->type == JSON_STRING) {
if (strcmp(name->value.string.string, projection->alias) != 0) {
if (!quiet) {
fprintf(stderr, "%s: Warning: GeoJSON specified projection \"%s\", not the expected \"%s\".\n", reading, name->string().c_str(), projection->alias);
fprintf(stderr, "%s: Warning: GeoJSON specified projection \"%s\", not the expected \"%s\".\n", reading, name->value.string.string, projection->alias);
fprintf(stderr, "%s: If \"%s\" is not the expected projection, use -s to specify the right one.\n", reading, projection->alias);
}
}
@@ -238,13 +242,11 @@ struct json_serialize_action : json_feature_action {
std::string layername;
int add_feature(json_object *geometry, bool geometrycollection, json_object *properties, json_object *id, json_object *tippecanoe, json_object *feature) {
// Only json_read results reach this; a detached tree has no parser.
assert(geometry->parser != nullptr);
sst->line = geometry->parser->line;
if (geometrycollection) {
int ret = 1;
for (size_t g = 0; g < geometry->array().size(); g++) {
ret &= serialize_geojson_feature(sst, geometry->array()[g].get(), properties, id, layer, tippecanoe, feature, layername);
for (size_t g = 0; g < geometry->value.array.length; g++) {
ret &= serialize_geojson_feature(sst, geometry->value.array.array[g], properties, id, layer, tippecanoe, feature, layername);
}
return ret;
} else {
@@ -257,7 +259,7 @@ struct json_serialize_action : json_feature_action {
}
};
void parse_json(struct serialization_state *sst, json_pull_ptr &jp, int layer, std::string layername) {
void parse_json(struct serialization_state *sst, json_pull *jp, int layer, std::string layername) {
json_serialize_action jsa;
jsa.fname = sst->fname;
jsa.sst = sst;
@@ -294,7 +296,7 @@ ssize_t json_map_read(struct json_pull *jp, char *buffer, size_t n) {
return n;
}
json_pull_ptr json_begin_map(char *map, long long len) {
struct json_pull *json_begin_map(char *map, long long len) {
struct jsonmap *jm = new jsonmap;
if (jm == NULL) {
perror("Out of memory");
@@ -308,11 +310,7 @@ json_pull_ptr json_begin_map(char *map, long long len) {
return json_begin(json_map_read, jm);
}
void json_end_map(json_pull_ptr &jp) {
if (jp == nullptr) {
return;
}
void json_end_map(struct json_pull *jp) {
delete (struct jsonmap *) jp->source;
jp->source = nullptr;
json_end(jp);
}
+6 -6
View File
@@ -10,21 +10,21 @@
#include "serial.hpp"
struct parse_json_args {
json_pull_ptr jp;
json_pull *jp;
int layer;
std::string *layername;
struct serialization_state *sst;
parse_json_args(json_pull_ptr jp1, int layer1, std::string *layername1, struct serialization_state *sst1)
: jp(std::move(jp1)), layer(layer1), layername(layername1), sst(sst1) {
parse_json_args(json_pull *jp1, int layer1, std::string *layername1, struct serialization_state *sst1)
: jp(jp1), layer(layer1), layername(layername1), sst(sst1) {
}
};
json_pull_ptr json_begin_map(char *map, long long len);
void json_end_map(json_pull_ptr &jp);
struct json_pull *json_begin_map(char *map, long long len);
void json_end_map(struct json_pull *jp);
void parse_json(struct serialization_state *sst, json_pull_ptr &jp, int layer, std::string layername);
void parse_json(struct serialization_state *sst, json_pull *jp, int layer, std::string layername);
void *run_parse_json(void *v);
#endif
+4 -2
View File
@@ -148,7 +148,8 @@ 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);
bool deduplicate_by_id,
int tile_format = OUTPUT_MVT);
std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int ny,
int detail, int buffer,
@@ -164,7 +165,8 @@ 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);
bool deduplicate_by_id,
int tile_format = OUTPUT_MVT);
draw center_of_mass_mp(const drawvec &dv);
+996
View File
@@ -0,0 +1,996 @@
#define _GNU_SOURCE // for asprintf()
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include "jsonpull.h"
#include "../milo/milo.h"
#define BUFFER 10000
struct string {
char *buf;
size_t n;
size_t nalloc;
};
static void string_init(struct string *s);
static void string_free(struct string *s);
json_pull *json_begin(ssize_t (*read)(struct json_pull *, char *buffer, size_t n), void *source) {
json_pull *j = malloc(sizeof(json_pull));
if (j == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
j->error = NULL;
j->line = 1;
j->container = NULL;
j->root = NULL;
j->read = read;
j->source = source;
j->buffer_head = 0;
j->buffer_tail = 0;
j->buffer = malloc(BUFFER);
if (j->buffer == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
j->number_buffer = malloc(sizeof(struct string));
if (j->number_buffer == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
string_init(j->number_buffer);
return j;
}
static inline int peek(json_pull *j) {
if (j->buffer_head < j->buffer_tail) {
return (unsigned char) j->buffer[j->buffer_head];
} else {
j->buffer_head = 0;
j->buffer_tail = j->read(j, j->buffer, BUFFER);
if (j->buffer_head >= j->buffer_tail) {
return EOF;
}
return (unsigned char) j->buffer[j->buffer_head];
}
}
static inline int next(json_pull *j) {
if (j->buffer_head < j->buffer_tail) {
return (unsigned char) j->buffer[j->buffer_head++];
} else {
j->buffer_head = 0;
j->buffer_tail = j->read(j, j->buffer, BUFFER);
if (j->buffer_head >= j->buffer_tail) {
return EOF;
}
return (unsigned char) j->buffer[j->buffer_head++];
}
}
static ssize_t read_file(json_pull *j, char *buffer, size_t n) {
return fread(buffer, 1, n, j->source);
}
json_pull *json_begin_file(FILE *f) {
return json_begin(read_file, f);
}
static ssize_t read_string(json_pull *j, char *buffer, size_t n) {
const char *cp = j->source;
size_t out = 0;
while (out < n && cp[out] != '\0') {
buffer[out] = cp[out];
out++;
}
j->source = (void *) (cp + out);
return out;
}
json_pull *json_begin_string(const char *s) {
return json_begin(read_string, (void *) s);
}
void json_end(json_pull *p) {
string_free(p->number_buffer);
free(p->number_buffer);
json_free(p->root);
free(p->buffer);
free(p);
}
static inline int read_wrap(json_pull *j) {
int c = next(j);
if (c == '\n') {
j->line++;
}
return c;
}
#define SIZE_FOR(i, size) ((size_t) ((((i) + 7) & ~7) * size))
static json_object *fabricate_object(json_pull *jp, json_object *parent, json_type type) {
json_object *o = malloc(sizeof(struct json_object));
if (o == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
o->type = type;
o->parent = parent;
o->parser = jp;
if (type == JSON_ARRAY) {
o->value.array.array = NULL;
o->value.array.length = 0;
} else if (type == JSON_HASH) {
o->value.object.keys = NULL;
o->value.object.values = NULL;
o->value.object.length = 0;
}
return o;
}
static json_object *add_object(json_pull *j, json_type type) {
json_object *c = j->container;
json_object *o = fabricate_object(j, c, type);
if (c != NULL) {
if (c->type == JSON_ARRAY) {
if (c->expect == JSON_ITEM) {
if (SIZE_FOR(c->value.array.length + 1, sizeof(json_object *)) != SIZE_FOR(c->value.array.length, sizeof(json_object *))) {
if (SIZE_FOR(c->value.array.length + 1, sizeof(json_object *)) < SIZE_FOR(c->value.array.length, sizeof(json_object *))) {
fprintf(stderr, "Array size overflow\n");
exit(EXIT_FAILURE);
}
c->value.array.array = realloc(c->value.array.array, SIZE_FOR(c->value.array.length + 1, sizeof(json_object *)));
if (c->value.array.array == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
}
c->value.array.array[c->value.array.length++] = o;
c->expect = JSON_COMMA;
} else {
j->error = "Expected a comma, not a list item";
free(o);
return NULL;
}
} else if (c->type == JSON_HASH) {
if (c->expect == JSON_VALUE) {
c->value.object.values[c->value.object.length - 1] = o;
c->expect = JSON_COMMA;
} else if (c->expect == JSON_KEY) {
if (type != JSON_STRING) {
j->error = "Hash key is not a string";
free(o);
return NULL;
}
if (SIZE_FOR(c->value.object.length + 1, sizeof(json_object *)) != SIZE_FOR(c->value.object.length, sizeof(json_object *))) {
if (SIZE_FOR(c->value.object.length + 1, sizeof(json_object *)) < SIZE_FOR(c->value.object.length, sizeof(json_object *))) {
fprintf(stderr, "Hash size overflow\n");
exit(EXIT_FAILURE);
}
c->value.object.keys = realloc(c->value.object.keys, SIZE_FOR(c->value.object.length + 1, sizeof(json_object *)));
c->value.object.values = realloc(c->value.object.values, SIZE_FOR(c->value.object.length + 1, sizeof(json_object *)));
if (c->value.object.keys == NULL || c->value.object.values == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
}
c->value.object.keys[c->value.object.length] = o;
c->value.object.values[c->value.object.length] = NULL;
c->value.object.length++;
c->expect = JSON_COLON;
} else {
j->error = "Expected a comma or colon";
free(o);
return NULL;
}
}
} else {
if (j->root != NULL) {
json_free(j->root);
}
j->root = o;
}
return o;
}
json_object *json_hash_get(json_object *o, const char *s) {
if (o == NULL || o->type != JSON_HASH) {
return NULL;
}
size_t i;
for (i = 0; i < o->value.object.length; i++) {
if (o->value.object.keys[i] != NULL && o->value.object.keys[i]->type == JSON_STRING) {
if (strcmp(o->value.object.keys[i]->value.string.string, s) == 0) {
return o->value.object.values[i];
}
}
}
return NULL;
}
static void string_init(struct string *s) {
s->nalloc = 500;
s->buf = malloc(s->nalloc);
if (s->buf == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
s->n = 0;
s->buf[0] = '\0';
}
static void string_append(struct string *s, char c) {
if (s->n + 2 >= s->nalloc) {
size_t prev = s->nalloc;
s->nalloc += 500;
if (s->nalloc <= prev) {
fprintf(stderr, "String size overflowed\n");
exit(EXIT_FAILURE);
}
s->buf = realloc(s->buf, s->nalloc);
if (s->buf == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
}
s->buf[s->n++] = c;
s->buf[s->n] = '\0';
}
static void string_append_string(struct string *s, char *add) {
size_t len = strlen(add);
if (s->n + len + 1 >= s->nalloc) {
size_t prev = s->nalloc;
s->nalloc += 500 + len;
if (s->nalloc <= prev) {
fprintf(stderr, "String size overflowed\n");
exit(EXIT_FAILURE);
}
s->buf = realloc(s->buf, s->nalloc);
if (s->buf == NULL) {
perror("Out of memory");
exit(EXIT_FAILURE);
}
}
for (; *add != '\0'; add++) {
s->buf[s->n++] = *add;
}
s->buf[s->n] = '\0';
}
static void string_free(struct string *s) {
free(s->buf);
}
json_object *json_read_separators(json_pull *j, json_separator_callback cb, void *state) {
int c;
// In case there is an error at the top level
if (j->container == NULL) {
if (j->root != NULL) {
json_free(j->root);
}
j->root = NULL;
}
again:
c = read_wrap(j);
if (c == EOF) {
if (j->container != NULL) {
j->error = "Reached EOF without all containers being closed";
}
return NULL;
}
switch (c) {
/////////////////////////// Byte order mark
case 0xEF: {
int c2 = peek(j);
if (c2 == 0xBB) {
c2 = read_wrap(j);
c2 = peek(j);
if (c2 == 0xBF) {
c2 = read_wrap(j);
c = ' ';
goto again;
}
}
j->error = "Corrupt byte-order mark found";
return NULL;
}
/////////////////////////// Whitespace
case ' ':
case '\t':
case '\r':
case '\n':
case 0x1E:
goto again;
/////////////////////////// Arrays
case '[': {
json_object *o = add_object(j, JSON_ARRAY);
if (o == NULL) {
return NULL;
}
j->container = o;
j->container->expect = JSON_ITEM;
if (cb != NULL) {
cb(JSON_ARRAY, j, state);
}
goto again;
}
case ']': {
if (j->container == NULL) {
j->error = "Found ] at top level";
return NULL;
}
if (j->container->type != JSON_ARRAY) {
j->error = "Found ] not in an array";
return NULL;
}
if (j->container->expect != JSON_COMMA) {
if (!(j->container->expect == JSON_ITEM && j->container->value.array.length == 0)) {
j->error = "Found ] without final element";
return NULL;
}
}
json_object *ret = j->container;
j->container = ret->parent;
return ret;
}
/////////////////////////// Hashes
case '{': {
json_object *o = add_object(j, JSON_HASH);
if (o == NULL) {
return NULL;
}
j->container = o;
j->container->expect = JSON_KEY;
if (cb != NULL) {
cb(JSON_HASH, j, state);
}
goto again;
}
case '}': {
if (j->container == NULL) {
j->error = "Found } at top level";
return NULL;
}
if (j->container->type != JSON_HASH) {
j->error = "Found } not in a hash";
return NULL;
}
if (j->container->expect != JSON_COMMA) {
if (!(j->container->expect == JSON_KEY && j->container->value.object.length == 0)) {
j->error = "Found } without final element";
return NULL;
}
}
json_object *ret = j->container;
j->container = ret->parent;
return ret;
}
/////////////////////////// Null
case 'n': {
if (read_wrap(j) != 'u' || read_wrap(j) != 'l' || read_wrap(j) != 'l') {
j->error = "Found misspelling of null";
return NULL;
}
return add_object(j, JSON_NULL);
}
/////////////////////////// NaN
case 'N': {
if (read_wrap(j) != 'a' || read_wrap(j) != 'N') {
j->error = "Found misspelling of NaN";
return NULL;
}
j->error = "JSON does not allow NaN";
return NULL;
}
/////////////////////////// Infinity
case 'I': {
if (read_wrap(j) != 'n' || read_wrap(j) != 'f' || read_wrap(j) != 'i' ||
read_wrap(j) != 'n' || read_wrap(j) != 'i' || read_wrap(j) != 't' ||
read_wrap(j) != 'y') {
j->error = "Found misspelling of Infinity";
return NULL;
}
j->error = "JSON does not allow Infinity";
return NULL;
}
/////////////////////////// True
case 't': {
if (read_wrap(j) != 'r' || read_wrap(j) != 'u' || read_wrap(j) != 'e') {
j->error = "Found misspelling of true";
return NULL;
}
return add_object(j, JSON_TRUE);
}
/////////////////////////// False
case 'f': {
if (read_wrap(j) != 'a' || read_wrap(j) != 'l' || read_wrap(j) != 's' || read_wrap(j) != 'e') {
j->error = "Found misspelling of false";
return NULL;
}
return add_object(j, JSON_FALSE);
}
/////////////////////////// Comma
case ',': {
if (j->container != NULL) {
if (j->container->expect != JSON_COMMA) {
j->error = "Found unexpected comma";
return NULL;
}
if (j->container->type == JSON_HASH) {
j->container->expect = JSON_KEY;
} else {
j->container->expect = JSON_ITEM;
}
}
if (cb != NULL) {
cb(JSON_COMMA, j, state);
}
goto again;
}
/////////////////////////// Colon
case ':': {
if (j->container == NULL) {
j->error = "Found colon at top level";
return NULL;
}
if (j->container->expect != JSON_COLON) {
j->error = "Found unexpected colon";
return NULL;
}
j->container->expect = JSON_VALUE;
if (cb != NULL) {
cb(JSON_COLON, j, state);
}
goto again;
}
/////////////////////////// Numbers
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': {
j->number_buffer->n = 0;
int decimal = 0;
if (c == '-') {
string_append(j->number_buffer, c);
c = read_wrap(j);
}
if (c == '0') {
string_append(j->number_buffer, c);
} else if (c >= '1' && c <= '9') {
string_append(j->number_buffer, c);
c = peek(j);
while (c >= '0' && c <= '9') {
string_append(j->number_buffer, read_wrap(j));
c = peek(j);
}
}
if (peek(j) == '.') {
string_append(j->number_buffer, read_wrap(j));
decimal = 1;
c = peek(j);
if (c < '0' || c > '9') {
j->error = "Decimal point without digits";
string_free(j->number_buffer);
return NULL;
}
while (c >= '0' && c <= '9') {
string_append(j->number_buffer, read_wrap(j));
c = peek(j);
}
}
c = peek(j);
if (c == 'e' || c == 'E') {
string_append(j->number_buffer, read_wrap(j));
decimal = 1;
c = peek(j);
if (c == '+' || c == '-') {
string_append(j->number_buffer, read_wrap(j));
}
c = peek(j);
if (c < '0' || c > '9') {
j->error = "Exponent without digits";
string_free(j->number_buffer);
return NULL;
}
while (c >= '0' && c <= '9') {
string_append(j->number_buffer, read_wrap(j));
c = peek(j);
}
}
json_object *n = add_object(j, JSON_NUMBER);
if (n != NULL) {
n->value.number.number = atof(j->number_buffer->buf);
n->value.number.large_signed = 0;
n->value.number.large_unsigned = 0;
#define MAX_SAFE_INTEGER 9007199254740991.0
#define MIN_SAFE_INTEGER -9007199254740991.0
if (!decimal && n->value.number.number > MAX_SAFE_INTEGER) {
errno = 0;
char *err = NULL;
unsigned long long ull = strtoull(j->number_buffer->buf, &err, 10);
if (errno == 0 && (err == NULL || *err == '\0')) {
n->value.number.large_unsigned = ull;
}
}
if (!decimal && n->value.number.number < MIN_SAFE_INTEGER) {
errno = 0;
char *err = NULL;
long long ll = strtoll(j->number_buffer->buf, &err, 10);
if (errno == 0 && (err == NULL || *err == '\0')) {
n->value.number.large_signed = ll;
}
}
}
return n;
}
/////////////////////////// Strings
case '"': {
struct string val;
string_init(&val);
int surrogate = -1;
while ((c = read_wrap(j)) != EOF) {
if (c == '"') {
if (surrogate >= 0) {
string_append(&val, 0xE0 | (surrogate >> 12));
string_append(&val, 0x80 | ((surrogate >> 6) & 0x3F));
string_append(&val, 0x80 | (surrogate & 0x3F));
surrogate = -1;
}
break;
} else if (c == '\\') {
c = read_wrap(j);
if (c == 'u') {
char hex[5] = "aaaa";
int i;
for (i = 0; i < 4; i++) {
hex[i] = read_wrap(j);
if (hex[i] < '0' || (hex[i] > '9' && hex[i] < 'A') || (hex[i] > 'F' && hex[i] < 'a') || hex[i] > 'f') {
j->error = "Invalid \\u hex character";
string_free(&val);
return NULL;
}
}
unsigned long ch = strtoul(hex, NULL, 16);
if (ch >= 0xd800 && ch <= 0xdbff) {
if (surrogate < 0) {
surrogate = ch;
} else {
// Impossible surrogate, so output the first half,
// keep what might be a legitimate new first half.
string_append(&val, 0xE0 | (surrogate >> 12));
string_append(&val, 0x80 | ((surrogate >> 6) & 0x3F));
string_append(&val, 0x80 | (surrogate & 0x3F));
surrogate = ch;
}
continue;
} else if (ch >= 0xdc00 && c <= 0xdfff) {
if (surrogate >= 0) {
long c1 = surrogate - 0xd800;
long c2 = ch - 0xdc00;
ch = ((c1 << 10) | c2) + 0x010000;
surrogate = -1;
}
}
if (surrogate >= 0) {
string_append(&val, 0xE0 | (surrogate >> 12));
string_append(&val, 0x80 | ((surrogate >> 6) & 0x3F));
string_append(&val, 0x80 | (surrogate & 0x3F));
surrogate = -1;
}
if (ch <= 0x7F) {
string_append(&val, ch);
} else if (ch <= 0x7FF) {
string_append(&val, 0xC0 | (ch >> 6));
string_append(&val, 0x80 | (ch & 0x3F));
} else if (ch < 0xFFFF) {
string_append(&val, 0xE0 | (ch >> 12));
string_append(&val, 0x80 | ((ch >> 6) & 0x3F));
string_append(&val, 0x80 | (ch & 0x3F));
} else {
string_append(&val, 0xF0 | (ch >> 18));
string_append(&val, 0x80 | ((ch >> 12) & 0x3F));
string_append(&val, 0x80 | ((ch >> 6) & 0x3F));
string_append(&val, 0x80 | (ch & 0x3F));
}
} else {
if (surrogate >= 0) {
string_append(&val, 0xE0 | (surrogate >> 12));
string_append(&val, 0x80 | ((surrogate >> 6) & 0x3F));
string_append(&val, 0x80 | (surrogate & 0x3F));
surrogate = -1;
}
if (c == '"') {
string_append(&val, '"');
} else if (c == '\\') {
string_append(&val, '\\');
} else if (c == '/') {
string_append(&val, '/');
} else if (c == 'b') {
string_append(&val, '\b');
} else if (c == 'f') {
string_append(&val, '\f');
} else if (c == 'n') {
string_append(&val, '\n');
} else if (c == 'r') {
string_append(&val, '\r');
} else if (c == 't') {
string_append(&val, '\t');
} else {
j->error = "Found backslash followed by unknown character";
string_free(&val);
return NULL;
}
}
} else if (c < ' ') {
j->error = "Found control character in string";
string_free(&val);
return NULL;
} else {
if (surrogate >= 0) {
string_append(&val, 0xE0 | (surrogate >> 12));
string_append(&val, 0x80 | ((surrogate >> 6) & 0x3F));
string_append(&val, 0x80 | (surrogate & 0x3F));
surrogate = -1;
}
string_append(&val, c);
}
}
if (c == EOF) {
j->error = "String without closing quote mark";
string_free(&val);
return NULL;
}
json_object *s = add_object(j, JSON_STRING);
if (s != NULL) {
s->value.string.string = val.buf;
s->value.string.refcon = NULL;
} else {
string_free(&val);
}
return s;
}
}
j->error = "Found unexpected character";
return NULL;
}
json_object *json_read(json_pull *j) {
return json_read_separators(j, NULL, NULL);
}
json_object *json_read_tree(json_pull *p) {
json_object *j;
while ((j = json_read(p)) != NULL) {
if (j->parent == NULL) {
return j;
}
}
return NULL;
}
void json_free(json_object *o) {
size_t i;
if (o == NULL) {
return;
}
// Free any data linked from here
if (o->type == JSON_ARRAY) {
json_object **a = o->value.array.array;
size_t n = o->value.array.length;
o->value.array.array = NULL;
o->value.array.length = 0;
for (i = 0; i < n; i++) {
json_free(a[i]);
}
free(a);
} else if (o->type == JSON_HASH) {
json_object **k = o->value.object.keys;
json_object **v = o->value.object.values;
size_t n = o->value.object.length;
o->value.object.keys = NULL;
o->value.object.values = NULL;
o->value.object.length = 0;
for (i = 0; i < n; i++) {
json_free(k[i]);
json_free(v[i]);
}
free(k);
free(v);
} else if (o->type == JSON_STRING) {
free(o->value.string.string);
} else if (o->type == JSON_NUMBER) {
;
}
json_disconnect(o);
free(o);
}
static void json_disconnect_parser(json_object *o) {
if (o->type == JSON_HASH) {
size_t i;
for (i = 0; i < o->value.object.length; i++) {
json_disconnect_parser(o->value.object.keys[i]);
json_disconnect_parser(o->value.object.values[i]);
}
} else if (o->type == JSON_ARRAY) {
size_t i;
for (i = 0; i < o->value.array.length; i++) {
json_disconnect_parser(o->value.array.array[i]);
}
}
o->parser = NULL;
}
void json_disconnect(json_object *o) {
// Expunge references to this as an array element
// or a hash key or value.
if (o->parent != NULL) {
if (o->parent->type == JSON_ARRAY) {
size_t i;
for (i = 0; i < o->parent->value.array.length; i++) {
if (o->parent->value.array.array[i] == o) {
break;
}
}
if (i < o->parent->value.array.length) {
memmove(o->parent->value.array.array + i, o->parent->value.array.array + i + 1, o->parent->value.array.length - i - 1);
o->parent->value.array.length--;
}
}
if (o->parent->type == JSON_HASH) {
size_t i;
for (i = 0; i < o->parent->value.object.length; i++) {
if (o->parent->value.object.keys[i] == o) {
o->parent->value.object.keys[i] = fabricate_object(o->parser, o->parent, JSON_NULL);
break;
}
if (o->parent->value.object.values[i] == o) {
o->parent->value.object.values[i] = fabricate_object(o->parser, o->parent, JSON_NULL);
break;
}
}
if (i < o->parent->value.object.length) {
if (o->parent->value.object.keys[i] != NULL && o->parent->value.object.keys[i]->type == JSON_NULL) {
if (o->parent->value.object.values[i] != NULL && o->parent->value.object.values[i]->type == JSON_NULL) {
free(o->parent->value.object.keys[i]);
free(o->parent->value.object.values[i]);
memmove(o->parent->value.object.keys + i, o->parent->value.object.keys + i + 1, o->parent->value.object.length - i - 1);
memmove(o->parent->value.object.values + i, o->parent->value.object.values + i + 1, o->parent->value.object.length - i - 1);
o->parent->value.object.length--;
}
}
}
}
}
if (o->parser != NULL && o->parser->root == o) {
o->parser->root = NULL;
}
json_disconnect_parser(o);
o->parent = NULL;
}
static void json_print_one(struct string *val, json_object *o) {
if (o == NULL) {
string_append_string(val, "...");
} else if (o->type == JSON_STRING) {
string_append(val, '\"');
char *cp;
for (cp = o->value.string.string; *cp != '\0'; cp++) {
if (*cp == '\\' || *cp == '"') {
string_append(val, '\\');
string_append(val, *cp);
} else if (*cp >= 0 && *cp < ' ') {
char *s;
if (asprintf(&s, "\\u%04x", *cp) >= 0) {
string_append_string(val, s);
free(s);
}
} else {
string_append(val, *cp);
}
}
string_append(val, '\"');
} else if (o->type == JSON_NUMBER) {
if (o->value.number.large_signed != 0) {
char s[65];
sprintf(s, "%lld", o->value.number.large_signed);
string_append_string(val, s);
} else if (o->value.number.large_unsigned != 0) {
char s[65];
sprintf(s, "%llu", o->value.number.large_unsigned);
string_append_string(val, s);
} else {
char *s = dtoa_milo(o->value.number.number);
string_append_string(val, s);
free(s);
}
} else if (o->type == JSON_NULL) {
string_append_string(val, "null");
} else if (o->type == JSON_TRUE) {
string_append_string(val, "true");
} else if (o->type == JSON_FALSE) {
string_append_string(val, "false");
} else if (o->type == JSON_HASH) {
string_append(val, '}');
} else if (o->type == JSON_ARRAY) {
string_append(val, ']');
}
}
static void json_print(struct string *val, json_object *o) {
if (o == NULL) {
// Hash value in incompletely read hash
string_append_string(val, "...");
} else if (o->type == JSON_HASH) {
string_append(val, '{');
size_t i;
for (i = 0; i < o->value.object.length; i++) {
json_print(val, o->value.object.keys[i]);
string_append(val, ':');
json_print(val, o->value.object.values[i]);
if (i + 1 < o->value.object.length) {
string_append(val, ',');
}
}
string_append(val, '}');
} else if (o->type == JSON_ARRAY) {
string_append(val, '[');
size_t i;
for (i = 0; i < o->value.array.length; i++) {
json_print(val, o->value.array.array[i]);
if (i + 1 < o->value.array.length) {
string_append(val, ',');
}
}
string_append(val, ']');
} else {
json_print_one(val, o);
}
}
char *json_stringify(json_object *o) {
struct string val;
string_init(&val);
json_print(&val, o);
return val.buf;
}
-855
View File
@@ -1,855 +0,0 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE // for asprintf()
#endif
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <memory>
#include <string>
#include <vector>
#include "jsonpull.h"
#include "../fpfmt/fpfmt.hpp"
#define BUFFER 10000
json_pull_ptr json_begin(ssize_t (*read)(struct json_pull *, char *buffer, size_t n), void *source) {
auto j = std::make_shared<json_pull>();
j->read = read;
j->source = source;
j->buffer.resize(BUFFER);
return j;
}
static inline int peek(json_pull *j) {
if (j->buffer_head < j->buffer_tail) {
return (unsigned char) j->buffer[j->buffer_head];
} else {
j->buffer_head = 0;
j->buffer_tail = j->read(j, j->buffer.data(), BUFFER);
if (j->buffer_head >= j->buffer_tail) {
return EOF;
}
return (unsigned char) j->buffer[j->buffer_head];
}
}
static inline int next(json_pull *j) {
if (j->buffer_head < j->buffer_tail) {
return (unsigned char) j->buffer[j->buffer_head++];
} else {
j->buffer_head = 0;
j->buffer_tail = j->read(j, j->buffer.data(), BUFFER);
if (j->buffer_head >= j->buffer_tail) {
return EOF;
}
return (unsigned char) j->buffer[j->buffer_head++];
}
}
static ssize_t read_file(json_pull *j, char *buffer, size_t n) {
return fread(buffer, 1, n, (FILE *) j->source);
}
json_pull_ptr json_begin_file(FILE *f) {
return json_begin(read_file, f);
}
static ssize_t read_string(json_pull *j, char *buffer, size_t n) {
const char *cp = (const char *) j->source;
size_t out = 0;
while (out < n && cp[out] != '\0') {
buffer[out] = cp[out];
out++;
}
j->source = (void *) (cp + out);
return out;
}
json_pull_ptr json_begin_string(const char *s) {
return json_begin(read_string, (void *) s);
}
void json_end(json_pull_ptr &p) {
p.reset();
}
static inline int read_wrap(json_pull *j) {
int c = next(j);
if (c == '\n') {
j->line++;
}
return c;
}
// JSON_TRUE / JSON_FALSE / JSON_NULL and the parse-token types are bare
// json_objects; the value-bearing types each get their own subclass.
static json_object_ptr make_object(json_type type, json_object *parent, json_pull *jp) {
switch (type) {
case JSON_NUMBER:
return json_object_ptr(new json_number(parent, jp));
case JSON_STRING:
return json_object_ptr(new json_string(parent, jp));
case JSON_ARRAY:
return json_object_ptr(new json_array(parent, jp));
case JSON_HASH:
return json_object_ptr(new json_hash(parent, jp));
default:
return json_object_ptr(new json_object(type, parent, jp));
}
}
static inline json_pull::parse_frame *current_frame(json_pull *j) {
return j->container_stack.empty() ? nullptr : &j->container_stack.back();
}
// Install a new node of `type` in the current container, or as the parser's
// root if the stack is empty. Returns it borrowed, or nullptr after setting
// j->error.
static json_object *add_object(json_pull *j, json_type type) {
json_pull::parse_frame *f = current_frame(j);
json_object *c = f ? f->container : nullptr;
json_object_ptr o = make_object(type, c, j);
json_object *raw = o.get();
if (f != nullptr) {
if (c->type == JSON_ARRAY) {
if (f->expect == JSON_ITEM) {
c->array().push_back(std::move(o));
f->expect = JSON_COMMA;
} else {
j->error = "Expected a comma, not a list item";
return nullptr;
}
} else if (c->type == JSON_HASH) {
if (f->expect == JSON_VALUE) {
// A colon is the only thing that sets JSON_VALUE, and it
// requires a key already pushed.
assert(!c->entries().empty());
c->entries().back().value = std::move(o);
f->expect = JSON_COMMA;
} else if (f->expect == JSON_KEY) {
if (type != JSON_STRING) {
j->error = "Hash key is not a string";
return nullptr;
}
c->entries().push_back({std::move(o), nullptr});
f->expect = JSON_COLON;
} else {
j->error = "Expected a comma or colon";
return nullptr;
}
}
} else {
// Replacing the parser's root destroys the previous top-level
// value (if no one called json_disconnect / json_read_tree to
// take ownership of it).
j->root = std::move(o);
}
return raw;
}
json_object *json_hash_get(json_object *o, const char *s) {
if (o == nullptr || o->type != JSON_HASH) {
return nullptr;
}
for (const auto &e : o->entries()) {
if (e.key != nullptr && e.key->type == JSON_STRING && e.key->string() == s) {
return e.value.get();
}
}
return nullptr;
}
json_object *json_hash_get(const json_object_ptr &o, const char *s) {
return json_hash_get(o.get(), s);
}
json_object *json_read_separators(json_pull_ptr &jp, json_separator_callback cb, void *state) {
int c;
json_pull *j = jp.get();
// In case there is an error at the top level
if (j->container_stack.empty()) {
j->root.reset();
}
again:
c = read_wrap(j);
if (c == EOF) {
if (!j->container_stack.empty()) {
j->error = "Reached EOF without all containers being closed";
}
return nullptr;
}
switch (c) {
/////////////////////////// Byte order mark
case 0xEF: {
int c2 = peek(j);
if (c2 == 0xBB) {
c2 = read_wrap(j);
c2 = peek(j);
if (c2 == 0xBF) {
c2 = read_wrap(j);
c = ' ';
goto again;
}
}
j->error = "Corrupt byte-order mark found";
return nullptr;
}
/////////////////////////// Whitespace
case ' ':
case '\t':
case '\r':
case '\n':
case 0x1E:
goto again;
/////////////////////////// Arrays
case '[': {
json_object *o = add_object(j, JSON_ARRAY);
if (o == nullptr) {
return nullptr;
}
j->container_stack.push_back({o, JSON_ITEM});
if (cb != nullptr) {
cb(JSON_ARRAY, j, state);
}
goto again;
}
case ']': {
json_pull::parse_frame *f = current_frame(j);
if (f == nullptr) {
j->error = "Found ] at top level";
return nullptr;
}
json_object *cc = f->container;
if (cc->type != JSON_ARRAY) {
j->error = "Found ] not in an array";
return nullptr;
}
if (f->expect != JSON_COMMA) {
if (!(f->expect == JSON_ITEM && cc->array().size() == 0)) {
j->error = "Found ] without final element";
return nullptr;
}
}
j->container_stack.pop_back();
return cc;
}
/////////////////////////// Hashes
case '{': {
json_object *o = add_object(j, JSON_HASH);
if (o == nullptr) {
return nullptr;
}
j->container_stack.push_back({o, JSON_KEY});
if (cb != nullptr) {
cb(JSON_HASH, j, state);
}
goto again;
}
case '}': {
json_pull::parse_frame *f = current_frame(j);
if (f == nullptr) {
j->error = "Found } at top level";
return nullptr;
}
json_object *cc = f->container;
if (cc->type != JSON_HASH) {
j->error = "Found } not in a hash";
return nullptr;
}
if (f->expect != JSON_COMMA) {
if (!(f->expect == JSON_KEY && cc->entries().size() == 0)) {
j->error = "Found } without final element";
return nullptr;
}
}
j->container_stack.pop_back();
return cc;
}
/////////////////////////// Null
case 'n': {
if (read_wrap(j) != 'u' || read_wrap(j) != 'l' || read_wrap(j) != 'l') {
j->error = "Found misspelling of null";
return nullptr;
}
return add_object(j, JSON_NULL);
}
/////////////////////////// NaN
case 'N': {
if (read_wrap(j) != 'a' || read_wrap(j) != 'N') {
j->error = "Found misspelling of NaN";
return nullptr;
}
j->error = "JSON does not allow NaN";
return nullptr;
}
/////////////////////////// Infinity
case 'I': {
if (read_wrap(j) != 'n' || read_wrap(j) != 'f' || read_wrap(j) != 'i' ||
read_wrap(j) != 'n' || read_wrap(j) != 'i' || read_wrap(j) != 't' ||
read_wrap(j) != 'y') {
j->error = "Found misspelling of Infinity";
return nullptr;
}
j->error = "JSON does not allow Infinity";
return nullptr;
}
/////////////////////////// True
case 't': {
if (read_wrap(j) != 'r' || read_wrap(j) != 'u' || read_wrap(j) != 'e') {
j->error = "Found misspelling of true";
return nullptr;
}
return add_object(j, JSON_TRUE);
}
/////////////////////////// False
case 'f': {
if (read_wrap(j) != 'a' || read_wrap(j) != 'l' || read_wrap(j) != 's' || read_wrap(j) != 'e') {
j->error = "Found misspelling of false";
return nullptr;
}
return add_object(j, JSON_FALSE);
}
/////////////////////////// Comma
case ',': {
json_pull::parse_frame *f = current_frame(j);
if (f != nullptr) {
if (f->expect != JSON_COMMA) {
j->error = "Found unexpected comma";
return nullptr;
}
if (f->container->type == JSON_HASH) {
f->expect = JSON_KEY;
} else {
f->expect = JSON_ITEM;
}
}
if (cb != nullptr) {
cb(JSON_COMMA, j, state);
}
goto again;
}
/////////////////////////// Colon
case ':': {
json_pull::parse_frame *f = current_frame(j);
if (f == nullptr) {
j->error = "Found colon at top level";
return nullptr;
}
if (f->expect != JSON_COLON) {
j->error = "Found unexpected colon";
return nullptr;
}
f->expect = JSON_VALUE;
if (cb != nullptr) {
cb(JSON_COLON, j, state);
}
goto again;
}
/////////////////////////// Numbers
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': {
j->number_buffer.clear();
int decimal = 0;
if (c == '-') {
j->number_buffer.push_back(c);
c = read_wrap(j);
}
if (c == '0') {
j->number_buffer.push_back(c);
} else if (c >= '1' && c <= '9') {
j->number_buffer.push_back(c);
c = peek(j);
while (c >= '0' && c <= '9') {
j->number_buffer.push_back(read_wrap(j));
c = peek(j);
}
}
if (peek(j) == '.') {
j->number_buffer.push_back(read_wrap(j));
decimal = 1;
c = peek(j);
if (c < '0' || c > '9') {
j->error = "Decimal point without digits";
return nullptr;
}
while (c >= '0' && c <= '9') {
j->number_buffer.push_back(read_wrap(j));
c = peek(j);
}
}
c = peek(j);
if (c == 'e' || c == 'E') {
j->number_buffer.push_back(read_wrap(j));
decimal = 1;
c = peek(j);
if (c == '+' || c == '-') {
j->number_buffer.push_back(read_wrap(j));
}
c = peek(j);
if (c < '0' || c > '9') {
j->error = "Exponent without digits";
return nullptr;
}
while (c >= '0' && c <= '9') {
j->number_buffer.push_back(read_wrap(j));
c = peek(j);
}
}
json_object *n = add_object(j, JSON_NUMBER);
if (n != nullptr) {
double d = atof(j->number_buffer.c_str());
n->set_number(d);
#define MAX_SAFE_INTEGER 9007199254740991.0
#define MIN_SAFE_INTEGER -9007199254740991.0
if (!decimal && d > MAX_SAFE_INTEGER) {
errno = 0;
char *err = nullptr;
unsigned long long ull = strtoull(j->number_buffer.c_str(), &err, 10);
if (errno == 0 && (err == nullptr || *err == '\0')) {
n->set_large_unsigned(ull);
}
}
if (!decimal && d < MIN_SAFE_INTEGER) {
errno = 0;
char *err = nullptr;
long long ll = strtoll(j->number_buffer.c_str(), &err, 10);
if (errno == 0 && (err == nullptr || *err == '\0')) {
n->set_large_signed(ll);
}
}
}
return n;
}
/////////////////////////// Strings
case '"': {
// Reused across tokens; see json_pull::string_buffer.
std::string &val = j->string_buffer;
val.clear();
int surrogate = -1;
while ((c = read_wrap(j)) != EOF) {
if (c == '"') {
if (surrogate >= 0) {
val.push_back(0xE0 | (surrogate >> 12));
val.push_back(0x80 | ((surrogate >> 6) & 0x3F));
val.push_back(0x80 | (surrogate & 0x3F));
surrogate = -1;
}
break;
} else if (c == '\\') {
c = read_wrap(j);
if (c == 'u') {
char hex[5] = "aaaa";
int i;
for (i = 0; i < 4; i++) {
hex[i] = read_wrap(j);
if (hex[i] < '0' || (hex[i] > '9' && hex[i] < 'A') || (hex[i] > 'F' && hex[i] < 'a') || hex[i] > 'f') {
j->error = "Invalid \\u hex character";
return nullptr;
}
}
unsigned long ch = strtoul(hex, nullptr, 16);
if (ch >= 0xd800 && ch <= 0xdbff) {
if (surrogate < 0) {
surrogate = ch;
} else {
// Impossible surrogate, so output the first half,
// keep what might be a legitimate new first half.
val.push_back(0xE0 | (surrogate >> 12));
val.push_back(0x80 | ((surrogate >> 6) & 0x3F));
val.push_back(0x80 | (surrogate & 0x3F));
surrogate = ch;
}
continue;
} else if (ch >= 0xdc00 && ch <= 0xdfff) {
if (surrogate >= 0) {
long c1 = surrogate - 0xd800;
long c2 = ch - 0xdc00;
ch = ((c1 << 10) | c2) + 0x010000;
surrogate = -1;
}
}
if (surrogate >= 0) {
val.push_back(0xE0 | (surrogate >> 12));
val.push_back(0x80 | ((surrogate >> 6) & 0x3F));
val.push_back(0x80 | (surrogate & 0x3F));
surrogate = -1;
}
if (ch <= 0x7F) {
val.push_back(ch);
} else if (ch <= 0x7FF) {
val.push_back(0xC0 | (ch >> 6));
val.push_back(0x80 | (ch & 0x3F));
} else if (ch <= 0xFFFF) {
val.push_back(0xE0 | (ch >> 12));
val.push_back(0x80 | ((ch >> 6) & 0x3F));
val.push_back(0x80 | (ch & 0x3F));
} else {
// Only reachable for a code point assembled from a
// surrogate pair above, since `ch` on its own comes
// from four hex digits and so cannot exceed 0xFFFF.
val.push_back(0xF0 | (ch >> 18));
val.push_back(0x80 | ((ch >> 12) & 0x3F));
val.push_back(0x80 | ((ch >> 6) & 0x3F));
val.push_back(0x80 | (ch & 0x3F));
}
} else {
if (surrogate >= 0) {
val.push_back(0xE0 | (surrogate >> 12));
val.push_back(0x80 | ((surrogate >> 6) & 0x3F));
val.push_back(0x80 | (surrogate & 0x3F));
surrogate = -1;
}
if (c == '"') {
val.push_back('"');
} else if (c == '\\') {
val.push_back('\\');
} else if (c == '/') {
val.push_back('/');
} else if (c == 'b') {
val.push_back('\b');
} else if (c == 'f') {
val.push_back('\f');
} else if (c == 'n') {
val.push_back('\n');
} else if (c == 'r') {
val.push_back('\r');
} else if (c == 't') {
val.push_back('\t');
} else {
j->error = "Found backslash followed by unknown character";
return nullptr;
}
}
} else if (c < ' ') {
j->error = "Found control character in string";
return nullptr;
} else {
if (surrogate >= 0) {
val.push_back(0xE0 | (surrogate >> 12));
val.push_back(0x80 | ((surrogate >> 6) & 0x3F));
val.push_back(0x80 | (surrogate & 0x3F));
surrogate = -1;
}
val.push_back(c);
}
}
if (c == EOF) {
j->error = "String without closing quote mark";
return nullptr;
}
json_object *s = add_object(j, JSON_STRING);
if (s != nullptr) {
// Copy, not move, so the buffer keeps its capacity.
s->string() = val;
}
return s;
}
}
j->error = "Found unexpected character";
return nullptr;
}
json_object *json_read(json_pull_ptr &j) {
return json_read_separators(j, nullptr, nullptr);
}
static void detach_subtree(json_object *o);
json_object_ptr json_read_tree(json_pull_ptr &p) {
json_object *j;
while ((j = json_read(p)) != nullptr) {
if (j->parent == nullptr) {
json_object_ptr tree = std::move(p->root);
detach_subtree(tree.get());
return tree;
}
}
return nullptr;
}
// Move the owning json_object_ptr out of whatever vector slot or hash entry
// holds `o`. Empty if nothing tracked owns it -- already detached, or borrowed
// from elsewhere.
//
// Detaching one half of a hash entry would disturb the surrounding key/value
// pairing, so the extracted half is replaced by a JSON_NULL placeholder and the
// entry is erased only once both halves are gone.
static json_object_ptr take_from_owner(json_object *o) {
if (o == nullptr) {
return nullptr;
}
json_object *parent = o->parent;
if (parent == nullptr) {
// Top-level value: the parser owns it via root, unless the
// caller already moved it out.
json_pull *parser = o->parser;
if (parser != nullptr && parser->root.get() == o) {
return std::move(parser->root);
}
return nullptr;
}
if (parent->type == JSON_ARRAY) {
auto &arr = parent->array();
for (size_t i = 0; i < arr.size(); i++) {
if (arr[i].get() == o) {
json_object_ptr taken = std::move(arr[i]);
arr.erase(arr.begin() + i);
return taken;
}
}
} else if (parent->type == JSON_HASH) {
auto &entries = parent->entries();
for (size_t i = 0; i < entries.size(); i++) {
auto &e = entries[i];
if (e.key.get() == o) {
json_object_ptr taken = std::move(e.key);
e.key = make_object(JSON_NULL, parent, parent->parser);
if (e.value != nullptr && e.value->type == JSON_NULL && e.key->type == JSON_NULL) {
entries.erase(entries.begin() + i);
}
return taken;
}
if (e.value.get() == o) {
json_object_ptr taken = std::move(e.value);
e.value = make_object(JSON_NULL, parent, parent->parser);
if (e.key != nullptr && e.key->type == JSON_NULL && e.value->type == JSON_NULL) {
entries.erase(entries.begin() + i);
}
return taken;
}
}
}
return nullptr;
}
// Splice `o` out of its owner and destroy it; `o` dangles afterwards. No need
// to clear back-pointers, since nothing will observe them again.
void json_free(json_object *o) {
(void) take_from_owner(o);
}
// See Ownership model in jsonpull.h for why only `parser` is cleared here.
static void clear_parser_pointers(json_object *o) {
if (o == nullptr) {
return;
}
if (o->type == JSON_HASH) {
for (const auto &e : o->entries()) {
clear_parser_pointers(e.key.get());
clear_parser_pointers(e.value.get());
}
} else if (o->type == JSON_ARRAY) {
const auto &arr = o->array();
for (size_t i = 0; i < arr.size(); i++) {
clear_parser_pointers(arr[i].get());
}
}
o->parser = nullptr;
}
// The root's `parent` pointed out of the subtree, at a node the parser still
// owns; leaving it set would make a later json_free look for this node in a
// container that no longer holds it.
static void detach_subtree(json_object *o) {
if (o == nullptr) {
return;
}
clear_parser_pointers(o);
o->parent = nullptr;
}
json_object_ptr json_disconnect(json_object *o) {
json_object_ptr taken = take_from_owner(o);
if (taken != nullptr) {
detach_subtree(taken.get());
}
return taken;
}
static void json_print_one(std::string &val, const json_object *o) {
if (o == nullptr) {
val.append("...");
} else if (o->type == JSON_STRING) {
val.push_back('\"');
// Range, not c_str(): the value may contain an embedded NUL, which the
// control-character branch below escapes like any other.
for (char c : o->string()) {
if (c == '\\' || c == '"') {
val.push_back('\\');
val.push_back(c);
} else if (c >= 0 && c < ' ') {
char *s;
if (asprintf(&s, "\\u%04x", c) >= 0) {
val.append(s);
free(s);
}
} else {
val.push_back(c);
}
}
val.push_back('\"');
} else if (o->type == JSON_NUMBER) {
if (o->large_signed() != 0) {
char s[65];
snprintf(s, sizeof(s), "%lld", o->large_signed());
val.append(s);
} else if (o->large_unsigned() != 0) {
char s[65];
snprintf(s, sizeof(s), "%llu", o->large_unsigned());
val.append(s);
} else {
val.append(fpfmt::dtoa(o->number()));
}
} else if (o->type == JSON_NULL) {
val.append("null");
} else if (o->type == JSON_TRUE) {
val.append("true");
} else if (o->type == JSON_FALSE) {
val.append("false");
}
// JSON_HASH and JSON_ARRAY never reach here: json_print handles both
// itself and only delegates to json_print_one for the scalar types.
}
static void json_print(std::string &val, const json_object *o) {
if (o == nullptr) {
// Hash value in incompletely read hash
val.append("...");
} else if (o->type == JSON_HASH) {
val.push_back('{');
const auto &entries = o->entries();
for (size_t i = 0; i < entries.size(); i++) {
json_print(val, entries[i].key.get());
val.push_back(':');
json_print(val, entries[i].value.get());
if (i + 1 < entries.size()) {
val.push_back(',');
}
}
val.push_back('}');
} else if (o->type == JSON_ARRAY) {
val.push_back('[');
const auto &arr = o->array();
for (size_t i = 0; i < arr.size(); i++) {
json_print(val, arr[i].get());
if (i + 1 < arr.size()) {
val.push_back(',');
}
}
val.push_back(']');
} else {
json_print_one(val, o);
}
}
std::string json_stringify(const json_object *o) {
std::string val;
json_print(val, o);
return val;
}
+54 -281
View File
@@ -1,12 +1,9 @@
#ifndef JSONPULL_H
#define JSONPULL_H
#include <stdio.h>
#include <sys/types.h>
#include <cassert>
#include <memory>
#include <string>
#include <vector>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum json_type {
// These types can be returned by json_read()
@@ -28,298 +25,74 @@ typedef enum json_type {
JSON_VALUE,
} json_type;
struct json_object;
struct json_pull;
typedef struct json_object {
struct json_object *parent;
struct json_pull *parser;
// Ownership model
//
// Every node has exactly one owner: its parent (a json_object_ptr in the
// parent's vector or hash entry), the parser (jp->root) for a top-level value,
// or the caller once json_read_tree / json_disconnect hands the tree over.
// json_read and json_hash_get return borrowed pointers, valid while the owning
// container is intact.
//
// `parent` and `parser` are non-owning, so they cannot form a cycle. Detaching
// clears every `parser` in the subtree, since the json_pull may die first, and
// clears `parent` only on the detached root, which pointed out of the subtree.
// Interior `parent` links stay, so a detached tree is still walkable upwards
// and json_free / json_disconnect still work inside it -- both find a node's
// owner through `parent`.
//
// json_object has no vptr; json_object_deleter switches on `type` and
// static_casts so the right subclass destructor runs. Payloads live in those
// subclasses rather than one wide struct, and the accessors assert on `type`
// before downcasting.
//
// json_pull_ptr is a shared_ptr: a parser is created and freed once.
union {
struct {
double number;
unsigned long long large_unsigned;
long long large_signed;
} number;
// Stateless, so json_object_ptr stays one pointer wide. See Ownership model.
struct json_object_deleter {
void operator()(json_object *p) const noexcept;
};
struct {
char *string;
void *refcon; // reference constant for caller's use
} string;
typedef std::unique_ptr<json_object, json_object_deleter> json_object_ptr;
typedef std::shared_ptr<json_pull> json_pull_ptr;
struct {
struct json_object **array;
size_t length;
} array;
// One key/value pair in a JSON_HASH, held in source order.
struct json_entry {
json_object_ptr key;
json_object_ptr value;
};
struct json_object {
json_object *parent = nullptr;
json_pull *parser = nullptr;
json_type type;
json_object(json_type t)
: type(t) {
}
json_object(json_type t, json_object *p, json_pull *pl)
: parent(p), parser(pl), type(t) {
}
inline std::string &string();
inline const std::string &string() const;
// large_unsigned() / large_signed() return 0 when the number is not
// held in that representation, the convention callers already expect.
inline double number() const;
inline unsigned long long large_unsigned() const;
inline long long large_signed() const;
inline void set_number(double d);
inline void set_large_unsigned(unsigned long long u);
inline void set_large_signed(long long s);
inline std::vector<json_object_ptr> &array();
inline const std::vector<json_object_ptr> &array() const;
inline std::vector<json_entry> &entries();
inline const std::vector<json_entry> &entries() const;
};
struct json_number : json_object {
enum repr_t { REPR_DOUBLE,
REPR_LARGE_UNSIGNED,
REPR_LARGE_SIGNED };
repr_t repr = REPR_DOUBLE;
union value_t {
double d;
unsigned long long u;
long long s;
value_t()
: d(0) {
}
struct {
struct json_object **keys;
struct json_object **values;
size_t length;
} object;
} value;
json_number()
: json_object(JSON_NUMBER) {
}
json_number(json_object *p, json_pull *pl)
: json_object(JSON_NUMBER, p, pl) {
}
};
json_type type;
int expect;
} json_object;
struct json_string : json_object {
std::string string_value;
typedef struct json_pull {
char *error;
int line;
json_string()
: json_object(JSON_STRING) {
}
json_string(json_object *p, json_pull *pl)
: json_object(JSON_STRING, p, pl) {
}
};
ssize_t (*read)(struct json_pull *, char *buf, size_t n);
void *source;
char *buffer;
ssize_t buffer_tail;
ssize_t buffer_head;
struct json_array : json_object {
std::vector<json_object_ptr> array_value;
json_object *container;
json_object *root;
// 2 slots: coordinate pairs dominate the parse workload.
json_array()
: json_object(JSON_ARRAY) {
array_value.reserve(2);
}
json_array(json_object *p, json_pull *pl)
: json_object(JSON_ARRAY, p, pl) {
array_value.reserve(2);
}
};
struct string *number_buffer;
} json_pull;
struct json_hash : json_object {
std::vector<json_entry> entries_value;
json_pull *json_begin_file(FILE *f);
json_pull *json_begin_string(const char *s);
// 4 slots: the typical GeoJSON property hash.
json_hash()
: json_object(JSON_HASH) {
entries_value.reserve(4);
}
json_hash(json_object *p, json_pull *pl)
: json_object(JSON_HASH, p, pl) {
entries_value.reserve(4);
}
};
inline std::string &json_object::string() {
assert(type == JSON_STRING);
return static_cast<json_string *>(this)->string_value;
}
inline const std::string &json_object::string() const {
assert(type == JSON_STRING);
return static_cast<const json_string *>(this)->string_value;
}
inline double json_object::number() const {
assert(type == JSON_NUMBER);
auto *n = static_cast<const json_number *>(this);
switch (n->repr) {
case json_number::REPR_LARGE_UNSIGNED:
return static_cast<double>(n->value.u);
case json_number::REPR_LARGE_SIGNED:
return static_cast<double>(n->value.s);
case json_number::REPR_DOUBLE:
default:
return n->value.d;
}
}
inline unsigned long long json_object::large_unsigned() const {
assert(type == JSON_NUMBER);
auto *n = static_cast<const json_number *>(this);
return n->repr == json_number::REPR_LARGE_UNSIGNED ? n->value.u : 0;
}
inline long long json_object::large_signed() const {
assert(type == JSON_NUMBER);
auto *n = static_cast<const json_number *>(this);
return n->repr == json_number::REPR_LARGE_SIGNED ? n->value.s : 0;
}
inline void json_object::set_number(double d) {
assert(type == JSON_NUMBER);
auto *n = static_cast<json_number *>(this);
n->repr = json_number::REPR_DOUBLE;
n->value.d = d;
}
inline void json_object::set_large_unsigned(unsigned long long u) {
assert(type == JSON_NUMBER);
auto *n = static_cast<json_number *>(this);
n->repr = json_number::REPR_LARGE_UNSIGNED;
n->value.u = u;
}
inline void json_object::set_large_signed(long long s) {
assert(type == JSON_NUMBER);
auto *n = static_cast<json_number *>(this);
n->repr = json_number::REPR_LARGE_SIGNED;
n->value.s = s;
}
inline std::vector<json_object_ptr> &json_object::array() {
assert(type == JSON_ARRAY);
return static_cast<json_array *>(this)->array_value;
}
inline const std::vector<json_object_ptr> &json_object::array() const {
assert(type == JSON_ARRAY);
return static_cast<const json_array *>(this)->array_value;
}
inline std::vector<json_entry> &json_object::entries() {
assert(type == JSON_HASH);
return static_cast<json_hash *>(this)->entries_value;
}
inline const std::vector<json_entry> &json_object::entries() const {
assert(type == JSON_HASH);
return static_cast<const json_hash *>(this)->entries_value;
}
inline void json_object_deleter::operator()(json_object *p) const noexcept {
if (p == nullptr) {
return;
}
switch (p->type) {
case JSON_NUMBER:
delete static_cast<json_number *>(p);
break;
case JSON_STRING:
delete static_cast<json_string *>(p);
break;
case JSON_ARRAY:
delete static_cast<json_array *>(p);
break;
case JSON_HASH:
delete static_cast<json_hash *>(p);
break;
default:
// JSON_TRUE / JSON_FALSE / JSON_NULL: no extra fields.
delete p;
break;
}
}
struct json_pull {
const char *error = nullptr; // points at a string literal; no allocation
int line = 1;
ssize_t (*read)(struct json_pull *, char *buf, size_t n) = nullptr;
void *source = nullptr;
std::vector<char> buffer;
ssize_t buffer_tail = 0;
ssize_t buffer_head = 0;
// Currently-open containers, innermost last, each with the token it
// expects next. `container` is borrowed; the owner is the surrounding
// container, or `root` for the outermost.
struct parse_frame {
json_object *container;
json_type expect;
};
std::vector<parse_frame> container_stack;
// Most recently completed top-level value, owned until the next one
// starts parsing or the caller takes it.
json_object_ptr root;
// Reused across tokens, cleared but not shrunk, so they stop
// reallocating once grown to the largest token seen.
std::string number_buffer;
std::string string_buffer;
};
json_pull_ptr json_begin_file(FILE *f);
json_pull_ptr json_begin_string(const char *s);
json_pull_ptr json_begin(ssize_t (*read)(struct json_pull *, char *buffer, size_t n), void *source);
// Resets the caller's pointer. Optional: the parser frees itself when the
// last json_pull_ptr to it goes away.
void json_end(json_pull_ptr &p);
json_pull *json_begin(ssize_t (*read)(struct json_pull *, char *buffer, size_t n), void *source);
void json_end(json_pull *p);
typedef void (*json_separator_callback)(json_type type, json_pull *j, void *state);
// The next completed node, borrowed. Valid until the next call that extends
// or trims the parser's tree. nullptr at end of input or on error.
json_object *json_read(json_pull_ptr &j);
json_object *json_read_separators(json_pull_ptr &j, json_separator_callback cb, void *state);
json_object *json_read_tree(json_pull *j);
json_object *json_read(json_pull *j);
json_object *json_read_separators(json_pull *j, json_separator_callback cb, void *state);
void json_free(json_object *j);
void json_disconnect(json_object *j);
// Drains the next top-level value out of the parser and hands it over. The
// returned tree can outlive the json_pull. See Ownership model for what the
// detach does and does not clear.
json_object_ptr json_read_tree(json_pull_ptr &j);
// json_free splices `o` out of its parent (if any), or clears the
// parser's root if `o` is the parser's current top-level value, and
// destroys the subtree. After this call, `o` is a dangling pointer
// that must not be used. Safe to call with nullptr.
void json_free(json_object *o);
// Splices `o` out of whatever owns it and hands it over, same detach as
// json_read_tree. See Ownership model.
json_object_ptr json_disconnect(json_object *o);
// Borrowed value for `s`. nullptr if `o` is not a hash, `s` is absent, or the
// hash is mid-parse with that value slot unfilled -- a JSON `null` is none of
// those, and comes back as a JSON_NULL node.
json_object *json_hash_get(const json_object_ptr &o, const char *s);
json_object *json_hash_get(json_object *o, const char *s);
std::string json_stringify(const json_object *o);
char *json_stringify(json_object *o);
#ifdef __cplusplus
}
#endif
#endif
+67 -27
View File
@@ -11,7 +11,7 @@
#include "csv.hpp"
#include "text.hpp"
#include "geojson-loop.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
#include "usage.hpp"
@@ -147,16 +147,17 @@ void out(std::string const &s, int type, json_object *properties) {
bool found = false;
json_object *o = json_hash_get(properties, extract);
if (o != nullptr) {
if (o != NULL) {
found = true;
if (o->type == JSON_STRING) {
extracted = sort_quote(o->string().c_str());
if (o->type == JSON_STRING || o->type == JSON_NUMBER) {
extracted = sort_quote(o->value.string.string);
} else {
// Numbers, booleans, null, and any other non-string
// values are rendered via json_stringify(); calling
// o->string() here would assert because the type-tagged
// accessor requires JSON_STRING.
extracted = sort_quote(json_stringify(o).c_str());
// Don't really know what to do about sort quoting
// for arbitrary objects
const char *out = json_stringify(o);
extracted = sort_quote(out);
free((void *) out);
}
}
@@ -232,13 +233,13 @@ void join_csv(json_object *j) {
}
json_object *properties = json_hash_get(j, "properties");
json_object *key = nullptr;
json_object *key = NULL;
if (properties != nullptr) {
if (properties != NULL) {
key = json_hash_get(properties, header[0].c_str());
}
if (key == nullptr) {
if (key == NULL) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Warning: couldn't find CSV key \"%s\" in JSON\n", header[0].c_str());
@@ -249,11 +250,13 @@ void join_csv(json_object *j) {
std::string joinkey;
if (key->type == JSON_STRING) {
joinkey = key->string();
joinkey = key->value.string.string;
} else if (key->type == JSON_NUMBER) {
joinkey = fpfmt::dtoa(key->number());
joinkey = milo::dtoa_milo(key->value.number.number);
} else {
joinkey = json_stringify(key);
const char *s = json_stringify(key);
joinkey = s;
free((void *) s);
}
if (joinkey < prev_joinkey) {
@@ -303,7 +306,14 @@ void join_csv(json_object *j) {
}
if (fields.size() > 0 && joinkey == fields[0]) {
properties->entries().reserve(properties->entries().size() + fields.size());
// This knows more about the structure of JSON objects than it ought to
// The 8 is to round up at least as much as SIZE_FOR in json_pull.c
properties->value.object.keys = (json_object **) realloc((void *) properties->value.object.keys, (properties->value.object.length + 8 + fields.size()) * sizeof(json_object *));
properties->value.object.values = (json_object **) realloc((void *) properties->value.object.values, (properties->value.object.length + 8 + fields.size()) * sizeof(json_object *));
if (properties->value.object.keys == NULL || properties->value.object.values == NULL) {
perror("realloc");
exit(EXIT_MEMORY);
}
for (size_t i = 1; i < fields.size(); i++) {
std::string k = header[i];
@@ -321,21 +331,46 @@ void join_csv(json_object *j) {
}
if (attr_type != JSON_NULL) {
json_object_ptr ko(new json_string(properties, properties->parser));
ko->string() = k;
// This knows more about the structure of JSON objects than it ought to
json_object *ko = (json_object *) malloc(sizeof(json_object));
json_object *vo = (json_object *) malloc(sizeof(json_object));
if (ko == NULL || vo == NULL) {
perror("malloc");
exit(EXIT_MEMORY);
}
ko->type = JSON_STRING;
ko->parent = properties;
ko->parser = properties->parser;
ko->value.string.string = strdup(k.c_str());
if (ko->value.string.string == NULL) {
perror("strdup");
exit(EXIT_MEMORY);
}
vo->type = attr_type;
vo->parent = properties;
vo->parser = properties->parser;
json_object_ptr vo;
if (attr_type == JSON_STRING) {
vo = json_object_ptr(new json_string(properties, properties->parser));
vo->string() = v;
vo->value.string.string = strdup(v.c_str());
if (vo->value.string.string == NULL) {
perror("strdup");
exit(EXIT_MEMORY);
}
} else if (attr_type == JSON_NUMBER) {
vo = json_object_ptr(new json_number(properties, properties->parser));
vo->set_number(atof(v.c_str()));
vo->value.number.number = atof(v.c_str());
vo->value.number.large_unsigned = 0;
vo->value.number.large_signed = 0;
} else {
abort();
}
properties->entries().push_back({std::move(ko), std::move(vo)});
properties->value.object.keys[properties->value.object.length] = ko;
properties->value.object.values[properties->value.object.length] = vo;
properties->value.object.length++;
}
}
}
@@ -348,9 +383,13 @@ struct json_join_action : json_feature_action {
join_csv(feature);
}
out(json_stringify(feature), 1, json_hash_get(feature, "properties"));
char *s = json_stringify(feature);
out(s, 1, json_hash_get(feature, "properties"));
free(s);
} else {
out(json_stringify(geometry), 2, nullptr);
char *s = json_stringify(geometry);
out(s, 2, NULL);
free(s);
}
return 1;
@@ -361,11 +400,12 @@ struct json_join_action : json_feature_action {
};
void process(FILE *fp, const char *fname) {
json_pull_ptr jp = json_begin_file(fp);
json_pull *jp = json_begin_file(fp);
json_join_action jja;
jja.fname = fname;
parse_json(&jja, jp);
json_end(jp);
}
static const struct option long_options[] = {
+45 -25
View File
@@ -50,6 +50,7 @@
#include "projection.hpp"
#include "memfile.hpp"
#include "main.hpp"
#include "mlt.hpp"
#include "geojson.hpp"
#include "geobuf.hpp"
#include "flatgeobuf.hpp"
@@ -587,7 +588,7 @@ struct STREAM {
}
}
json_pull_ptr json_begin() {
json_pull *json_begin() {
return ::json_begin(read_stream, this);
}
};
@@ -1832,7 +1833,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
// Plain serial reading
std::atomic<long long> layer_seq(overall_offset);
json_pull_ptr jp = fp->json_begin();
json_pull *jp = fp->json_begin();
struct serialization_state sst;
sst.fname = reading.c_str();
@@ -1859,6 +1860,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
sst.attribute_types = attribute_types;
parse_json(&sst, jp, layer, sources[layer].layer);
json_end(jp);
overall_offset = layer_seq;
checkdisk(&readers);
}
@@ -2834,7 +2836,8 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
ai->second.maxzoom = maxzoom;
}
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);
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);
if (outdb != NULL) {
mbtiles_write_metadata(outdb, m, forcetable);
} else {
@@ -2883,10 +2886,10 @@ void set_attribute_type(std::unordered_map<std::string, int> &attribute_types, c
void set_attribute_value(const char *arg) {
if (*arg == '{') {
json_pull_ptr jp = json_begin_string(arg);
json_object_ptr o = json_read_tree(jp);
json_pull *jp = json_begin_string(arg);
json_object *o = json_read_tree(jp);
if (o == nullptr) {
if (o == NULL) {
fprintf(stderr, "%s: --set-attribute %s: %s\n", *av, arg, jp->error);
exit(EXIT_JSON);
}
@@ -2896,18 +2899,21 @@ void set_attribute_value(const char *arg) {
exit(EXIT_JSON);
}
for (size_t i = 0; i < o->entries().size(); i++) {
const auto &e = o->entries()[i];
for (size_t i = 0; i < o->value.object.length; i++) {
json_object *k = o->value.object.keys[i];
json_object *v = o->value.object.values[i];
if (e.key->type != JSON_STRING) {
if (k->type != JSON_STRING) {
fprintf(stderr, "%s: --set-attribute %s: key %zu not a string\n", *av, arg, i);
exit(EXIT_JSON);
}
serial_val val = stringify_value(e.value.get(), "json", 1, o.get());
set_attributes.emplace(e.key->string(), val);
serial_val val = stringify_value(v, "json", 1, o);
set_attributes.emplace(k->value.string.string, val);
}
json_free(o);
json_end(jp);
return;
}
@@ -2932,10 +2938,10 @@ void set_attribute_value(const char *arg) {
}
void parse_json_source(const char *arg, struct source &src) {
json_pull_ptr jp = json_begin_string(arg);
json_object_ptr o = json_read_tree(jp);
json_pull *jp = json_begin_string(arg);
json_object *o = json_read_tree(jp);
if (o == nullptr) {
if (o == NULL) {
fprintf(stderr, "%s: -L%s: %s\n", *av, arg, jp->error);
exit(EXIT_JSON);
}
@@ -2946,27 +2952,30 @@ void parse_json_source(const char *arg, struct source &src) {
}
json_object *fname = json_hash_get(o, "file");
if (fname == nullptr || fname->type != JSON_STRING) {
if (fname == NULL || fname->type != JSON_STRING) {
fprintf(stderr, "%s: -L%s: requires \"file\": filename\n", *av, arg);
exit(EXIT_JSON);
}
src.file = fname->string();
src.file = std::string(fname->value.string.string);
json_object *layer = json_hash_get(o, "layer");
if (layer != nullptr && layer->type == JSON_STRING) {
src.layer = layer->string();
if (layer != NULL && layer->type == JSON_STRING) {
src.layer = std::string(layer->value.string.string);
}
json_object *description = json_hash_get(o, "description");
if (description != nullptr && description->type == JSON_STRING) {
src.description = description->string();
if (description != NULL && description->type == JSON_STRING) {
src.description = std::string(description->value.string.string);
}
json_object *format = json_hash_get(o, "format");
if (format != nullptr && format->type == JSON_STRING) {
src.format = format->string();
if (format != NULL && format->type == JSON_STRING) {
src.format = std::string(format->value.string.string);
}
json_free(o);
json_end(jp);
}
static const struct option long_options_orig[] = {
@@ -3111,6 +3120,9 @@ 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, '~'},
@@ -3207,7 +3219,7 @@ int main(int argc, char **argv) {
int exclude_all = 0;
int read_parallel = 0;
int files_open_at_start;
json_object_ptr filter;
json_object *filter = NULL;
memsize = calc_memsize();
@@ -3339,6 +3351,12 @@ 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);
@@ -3833,7 +3851,7 @@ int main(int argc, char **argv) {
auto input_ret = read_input(sources, name ? name : out_mbtiles ? out_mbtiles
: out_dir,
maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, out_dir, &exclude, &include, exclude_all, filter.get(), droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0, file_bbox, file_bbox1, file_bbox2, prefilter, postfilter, description, guess_maxzoom, guess_cluster_maxzoom, &attribute_types, argv[0], &attribute_accum, attribute_descriptions, commandline, minimum_maxzoom);
maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, out_dir, &exclude, &include, exclude_all, filter, droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0, file_bbox, file_bbox1, file_bbox2, prefilter, postfilter, description, guess_maxzoom, guess_cluster_maxzoom, &attribute_types, argv[0], &attribute_accum, attribute_descriptions, commandline, minimum_maxzoom);
ret = std::get<0>(input_ret);
@@ -3856,7 +3874,9 @@ int main(int argc, char **argv) {
exit(EXIT_IMPOSSIBLE);
}
filter.reset();
if (filter != NULL) {
json_free(filter);
}
return ret;
}
+45 -5
View File
@@ -49,12 +49,19 @@ $ brew install tippecanoe
.PP
On Ubuntu it will usually be easiest to build from the source repository:
.EX
$ git clone https://github.com/felt/tippecanoe.git
$ git clone --recurse-submodules 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
@@ -357,7 +364,7 @@ specified maximum zoom and to any levels added beyond that.
\fB--extend-zooms-if-still-dropping-maximum=\fR\fIcount\fP: Increase the maxzoom if features are still being dropped at that zoom level
by up to \fIcount\fP zoom levels.
.IP \(bu 2
\fB-at\fR or \fB--generate-variable-depth-tile-pyramid\fR: Don't produce child tiles for any tile that should be sufficient to be overzoomed to any higher zoom level. Such tiles will be produced with maximum detail, retaining every vertex that is not collinear with its neighbors, but their polygons are still cleaned so that overlapping areas are merged rather than left stacked. Tiles with point features below the basezoom, or which contain too many features or bytes with full detail, will be written out with normal detail and split into child tiles. If any features have to be dropped dynamically at a zoom level, no tile in that zoom level is truncated, so that the whole zoom level is reduced consistently; any tile that was already being skipped because an ancestor had been truncated is written out after all. Tilesets generated with this option are suitable for use only with tile servers that will find the appropriate tile to overzoom from and will simplify the geometries appropriately before serving the tile.
\fB-at\fR or \fB--generate-variable-depth-tile-pyramid\fR: Don't produce child tiles for any tile that should be sufficient to be overzoomed to any higher zoom level. Such tiles will be produced with maximum detail and no simplification or polygon cleaning. Tiles with point features below the basezoom or where any features have to be dropped dynamically, or which contain too many features or bytes with full detail, will be written out with normal detail and split into child tiles. Tilesets generated with this option are suitable for use only with tile servers that will find the appropriate tile to overzoom from and will simplify and clean the geometries appropriately before serving the tile.
.IP \(bu 2
\fB-R\fR \fIzoom\fP\fB/\fR\fIx\fP\fB/\fR\fIy\fP or \fB--one-tile=\fR\fIzoom\fP\fB/\fR\fIx\fP\fB/\fR\fIy\fP: Set the minzoom and maxzoom to \fIzoom\fP and produce only
the single specified tile at that zoom level.
@@ -615,7 +622,14 @@ 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 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.
\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.
.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.
@@ -830,6 +844,10 @@ 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
@@ -892,7 +910,14 @@ 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 PBF vector tile data.
\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.
.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.
@@ -972,6 +997,10 @@ 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
@@ -1076,6 +1105,10 @@ 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\&.
@@ -1108,4 +1141,11 @@ and produces tile \fBoutz/outx/outy\fR of \fBout.mvt.gz\fR from them.
.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 PBF vector tile data in the output tile.
\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.
Submodule maplibre-tile-spec added at d457bf2b01
+7 -6
View File
@@ -17,7 +17,7 @@
#include "mvt.hpp"
#include "mbtiles.hpp"
#include "text.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "write_json.hpp"
#include "version.hpp"
#include "errors.hpp"
@@ -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, 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 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 m;
m.name = fname;
m.description = description != NULL ? description : fname;
m.version = 2;
m.type = "overlay";
m.format = vector ? "pbf" : "png";
m.format = tile_format;
m.minzoom = minzoom;
m.maxzoom = maxzoom;
@@ -708,13 +708,14 @@ metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minla
}
if (basezoom != maxzoom || droprate != 2.5 || retain_points_multiplier != 1) {
m.decisions_json = std::string("{") +
"\"basezoom\":" + fpfmt::dtoa(basezoom) + "," +
"\"droprate\":" + fpfmt::dtoa(droprate) + "," +
"\"basezoom\":" + milo::dtoa_milo(basezoom) + "," +
"\"droprate\":" + milo::dtoa_milo(droprate) + "," +
"\"retain_points_multiplier\":" + std::to_string(retain_points_multiplier) +
std::string("}");
}
if (vector) {
bool is_vector_format = (strcmp(tile_format, "pbf") == 0 || strcmp(tile_format, "mlt") == 0);
if (is_vector_format) {
{
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, 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 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);
void mbtiles_write_metadata(sqlite3 *db, const metadata &m, bool forcetable);
void mbtiles_close(sqlite3 *outdb, const char *pgm);
-6
View File
@@ -1,9 +1,3 @@
// Grisu2, from https://github.com/miloyip/dtoa-benchmark.
//
// Tippecanoe no longer formats numbers with this; fpfmt::dtoa() (fpfmt/) has
// replaced it. The header is kept only as the baseline for fpfmt/bench.cpp,
// so the correctness and speed comparison between the two stays reproducible.
#pragma once
#include <assert.h>
#include <math.h>
+9
View File
@@ -0,0 +1,9 @@
#ifdef __cplusplus
extern "C" {
#endif
char *dtoa_milo(double val);
#ifdef __cplusplus
}
#endif
+344
View File
@@ -0,0 +1,344 @@
#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
@@ -0,0 +1,40 @@
#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
@@ -0,0 +1,311 @@
#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
+11 -6
View File
@@ -8,11 +8,12 @@
#include <limits.h>
#include <ctype.h>
#include "mvt.hpp"
#include "mlt.hpp"
#include "geometry.hpp"
#include "protozero/varint.hpp"
#include "protozero/pbf_reader.hpp"
#include "protozero/pbf_writer.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
#include "serial.hpp"
#include "text.hpp"
@@ -127,6 +128,10 @@ 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>();
@@ -407,7 +412,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;
@@ -590,7 +595,7 @@ std::string mvt_value::toString() const {
if (v == (long long) v) {
return std::to_string((long long) v);
} else {
return fpfmt::dtoa(v);
return milo::dtoa_milo(v);
}
}
case mvt_float: {
@@ -598,7 +603,7 @@ std::string mvt_value::toString() const {
if (v == (long long) v) {
return std::to_string((long long) v);
} else {
return fpfmt::dtoa(v);
return milo::dtoa_milo(v);
}
}
case mvt_sint:
@@ -786,11 +791,11 @@ serial_val mvt_value_to_serial_val(mvt_value const &v) {
break;
case mvt_float:
sv.type = mvt_double;
sv.s = fpfmt::dtoa(v.numeric_value.float_value);
sv.s = milo::dtoa_milo(v.numeric_value.float_value);
break;
case mvt_double:
sv.type = mvt_double;
sv.s = fpfmt::dtoa(v.numeric_value.double_value);
sv.s = milo::dtoa_milo(v.numeric_value.double_value);
break;
case mvt_int:
sv.type = mvt_double;
+4
View File
@@ -17,6 +17,10 @@
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,
+18 -2
View File
@@ -5,6 +5,7 @@
#include <set>
#include "errors.hpp"
#include "mvt.hpp"
#include "mlt.hpp"
#include "geometry.hpp"
#include "evaluator.hpp"
#include "attribute.hpp"
@@ -36,6 +37,9 @@ 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'},
@@ -192,6 +196,18 @@ 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);
@@ -263,7 +279,7 @@ int main(int argc, char **argv) {
std::string out;
{
json_object_ptr json_filter;
json_object *json_filter = NULL;
if (filter.size() > 0) {
json_filter = parse_filter(filter.c_str());
}
@@ -289,7 +305,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.get(), preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, std::vector<mvt_layer>(), "", "", SIZE_MAX, std::vector<clipbbox>(), deduplicate_by_id);
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);
}
FILE *f = fopen(outfile, "wb");
+41 -43
View File
@@ -27,7 +27,9 @@
#include "errors.hpp"
#include "thread.hpp"
extern "C" {
#include "jsonpull/jsonpull.h"
}
#include "plugin.hpp"
#include "write_json.hpp"
@@ -143,55 +145,53 @@ std::vector<mvt_layer> parse_layers(int fd, int z, unsigned x, unsigned y, std::
}
// Reads from the prefilter
serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, std::vector<std::map<std::string, layermap_entry>> *layermaps, size_t tiling_seg, std::vector<std::vector<std::string>> *layer_unmaps, bool postfilter, key_pool &key_pool) {
serial_feature parse_feature(json_pull *jp, int z, unsigned x, unsigned y, std::vector<std::map<std::string, layermap_entry>> *layermaps, size_t tiling_seg, std::vector<std::vector<std::string>> *layer_unmaps, bool postfilter, key_pool &key_pool) {
serial_feature sf;
while (1) {
// json_read also returns the intermediate containers of a feature
// still being assembled, so the `continue` paths leave `j` alone;
// freeing one would splice it out of its parent. `j` is only freed
// once it is a complete Feature.
json_object *j = json_read(jp);
if (j == nullptr) {
if (jp->error != nullptr) {
if (j == NULL) {
if (jp->error != NULL) {
fprintf(stderr, "Filter output:%d: %s: ", jp->line, jp->error);
if (jp->root != nullptr) {
json_context(jp->root.get());
if (jp->root != NULL) {
json_context(jp->root);
} else {
fprintf(stderr, "\n");
}
exit(EXIT_JSON);
}
jp->root.reset();
json_free(jp->root);
sf.t = -1;
return sf;
}
json_object *type = json_hash_get(j, "type");
if (type == nullptr || type->type != JSON_STRING) {
if (type == NULL || type->type != JSON_STRING) {
continue;
}
if (type->string() != "Feature") {
if (strcmp(type->value.string.string, "Feature") != 0) {
continue;
}
json_object *geometry = json_hash_get(j, "geometry");
if (geometry == nullptr) {
if (geometry == NULL) {
fprintf(stderr, "Filter output:%d: filtered feature with no geometry: ", jp->line);
json_context(j);
json_free(j);
exit(EXIT_JSON);
}
json_object *properties = json_hash_get(j, "properties");
if (properties == nullptr || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
if (properties == NULL || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
fprintf(stderr, "Filter output:%d: feature without properties hash: ", jp->line);
json_context(j);
json_free(j);
exit(EXIT_JSON);
}
json_object *geometry_type = json_hash_get(geometry, "type");
if (geometry_type == nullptr) {
if (geometry_type == NULL) {
fprintf(stderr, "Filter output:%d: null geometry (additional not reported): ", jp->line);
json_context(j);
exit(EXIT_JSON);
@@ -204,7 +204,7 @@ serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, s
}
json_object *coordinates = json_hash_get(geometry, "coordinates");
if (coordinates == nullptr || coordinates->type != JSON_ARRAY) {
if (coordinates == NULL || coordinates->type != JSON_ARRAY) {
fprintf(stderr, "Filter output:%d: feature without coordinates array: ", jp->line);
json_context(j);
exit(EXIT_JSON);
@@ -212,12 +212,12 @@ serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, s
int t;
for (t = 0; t < GEOM_TYPES; t++) {
if (geometry_type->string() == geometry_names[t]) {
if (strcmp(geometry_type->value.string.string, geometry_names[t]) == 0) {
break;
}
}
if (t >= GEOM_TYPES) {
fprintf(stderr, "Filter output:%d: Can't handle geometry type %s: ", jp->line, geometry_type->string().c_str());
fprintf(stderr, "Filter output:%d: Can't handle geometry type %s: ", jp->line, geometry_type->value.string.string);
json_context(j);
exit(EXIT_JSON);
}
@@ -253,29 +253,29 @@ serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, s
std::string layername = "unknown";
json_object *tippecanoe = json_hash_get(j, "tippecanoe");
if (tippecanoe != nullptr) {
if (tippecanoe != NULL) {
json_object *layer = json_hash_get(tippecanoe, "layer");
if (layer != nullptr && layer->type == JSON_STRING) {
layername = layer->string();
if (layer != NULL && layer->type == JSON_STRING) {
layername = std::string(layer->value.string.string);
}
json_object *index = json_hash_get(tippecanoe, "index");
if (index != nullptr && index->type == JSON_NUMBER) {
sf.index = index->number();
if (index != NULL && index->type == JSON_NUMBER) {
sf.index = index->value.number.number;
}
json_object *sequence = json_hash_get(tippecanoe, "sequence");
if (sequence != nullptr && sequence->type == JSON_NUMBER) {
sf.seq = sequence->number();
if (sequence != NULL && sequence->type == JSON_NUMBER) {
sf.seq = sequence->value.number.number;
}
json_object *extent = json_hash_get(tippecanoe, "extent");
if (extent != nullptr && extent->type == JSON_NUMBER) {
sf.extent = extent->number();
if (extent != NULL && extent->type == JSON_NUMBER) {
sf.extent = extent->value.number.number;
}
json_object *dropped = json_hash_get(tippecanoe, "dropped");
if (dropped != nullptr && dropped->type == JSON_TRUE) {
if (dropped != NULL && dropped->type == JSON_TRUE) {
sf.dropped = FEATURE_DROPPED; // dropped
} else {
sf.dropped = FEATURE_KEPT; // kept
@@ -300,10 +300,10 @@ serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, s
}
json_object *id = json_hash_get(j, "id");
if (id != nullptr && id->type == JSON_NUMBER) {
sf.id = id->number();
if (id->large_unsigned() > 0) {
sf.id = id->large_unsigned();
if (id != NULL && id->type == JSON_NUMBER) {
sf.id = id->value.number.number;
if (id->value.number.large_unsigned > 0) {
sf.id = id->value.number.large_unsigned;
}
sf.has_id = true;
}
@@ -347,20 +347,18 @@ serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, s
}
}
if (properties->type == JSON_HASH) {
for (const auto &e : properties->entries()) {
serial_val v = stringify_value(e.value.get(), "Filter output", jp->line, j);
for (size_t i = 0; i < properties->value.object.length; i++) {
serial_val v = stringify_value(properties->value.object.values[i], "Filter output", jp->line, j);
// Nulls can be excluded here because the expression evaluation filter
// would have already run before prefiltering
// Nulls can be excluded here because the expression evaluation filter
// would have already run before prefiltering
if (v.type != mvt_null) {
sf.full_keys.push_back(key_pool.pool(e.key->string()));
sf.full_values.push_back(v);
if (v.type != mvt_null) {
sf.full_keys.push_back(key_pool.pool(std::string(properties->value.object.keys[i]->value.string.string)));
sf.full_values.push_back(v);
if (!postfilter) {
add_to_tilestats(ts->second.tilestats, e.key->string(), v);
}
if (!postfilter) {
add_to_tilestats(ts->second.tilestats, std::string(properties->value.object.keys[i]->value.string.string), v);
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
struct key_pool;
std::vector<mvt_layer> filter_layers(const char *filter, std::vector<mvt_layer> &layer, unsigned z, unsigned x, unsigned y, std::vector<std::map<std::string, layermap_entry>> *layermaps, size_t tiling_seg, std::vector<std::vector<std::string>> *layer_unmaps, int extent);
void setup_filter(const char *filter, int *write_to, int *read_from, pid_t *pid, unsigned z, unsigned x, unsigned y);
serial_feature parse_feature(json_pull_ptr &jp, int z, unsigned x, unsigned y, std::vector<std::map<std::string, layermap_entry>> *layermaps, size_t tiling_seg, std::vector<std::vector<std::string>> *layer_unmaps, bool filters, key_pool &key_pool);
serial_feature parse_feature(json_pull *jp, int z, unsigned x, unsigned y, std::vector<std::map<std::string, layermap_entry>> *layermaps, size_t tiling_seg, std::vector<std::vector<std::string>> *layer_unmaps, bool filters, key_pool &key_pool);
+20 -25
View File
@@ -397,9 +397,9 @@ sqlite3 *pmtilesmeta2tmp(const char *fname, const char *pmtiles_map) {
exit(EXIT_OPEN);
}
json_pull_ptr jp = json_begin_string(decompressed_json.c_str());
json_object_ptr o = json_read_tree(jp);
if (o == nullptr) {
json_pull *jp = json_begin_string(decompressed_json.c_str());
json_object *o = json_read_tree(jp);
if (o == NULL) {
fprintf(stderr, "%s: metadata parsing error: %s\n", fname, jp->error);
exit(EXIT_JSON);
}
@@ -415,50 +415,45 @@ sqlite3 *pmtilesmeta2tmp(const char *fname, const char *pmtiles_map) {
state.nospace = true;
state.json_write_hash();
for (const auto &e : o->entries()) {
// Check before reading, since string() asserts on the type.
if (e.key->type != JSON_STRING) {
fprintf(stderr, "%s: non-string key in metadata\n", fname);
continue;
}
const std::string &key = e.key->string();
if (key == "vector_layers" && e.value->type == JSON_ARRAY) {
for (size_t i = 0; i < o->value.object.length; i++) {
const char *key = o->value.object.keys[i]->value.string.string;
if (strcmp(key, "vector_layers") == 0 && o->value.object.values[i]->type == JSON_ARRAY) {
has_json = true;
state.nospace = true;
state.json_write_string("vector_layers");
state.nospace = true;
state.json_write_json(json_stringify(e.value.get()));
} else if (key == "tilestats" && e.value->type == JSON_HASH) {
state.json_write_json(json_stringify(o->value.object.values[i]));
} else if (strcmp(key, "tilestats") == 0 && o->value.object.values[i]->type == JSON_HASH) {
has_json = true;
state.nospace = true;
state.json_write_string("tilestats");
state.nospace = true;
state.json_write_json(json_stringify(e.value.get()));
} else if (key == "strategies" && e.value->type == JSON_ARRAY) {
sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES ('strategies', %Q);", json_stringify(e.value.get()).c_str());
state.json_write_json(json_stringify(o->value.object.values[i]));
} else if (strcmp(key, "strategies") == 0 && o->value.object.values[i]->type == JSON_ARRAY) {
sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES ('strategies', %Q);", json_stringify(o->value.object.values[i]));
if (sqlite3_exec(db, sql, NULL, NULL, &err) != SQLITE_OK) {
fprintf(stderr, "set %s in metadata: %s\n", key.c_str(), err);
fprintf(stderr, "set %s in metadata: %s\n", key, err);
}
sqlite3_free(sql);
} else if (key == "tippecanoe_decisions" && e.value->type == JSON_HASH) {
sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES ('tippecanoe_decisions', %Q);", json_stringify(e.value.get()).c_str());
} else if (strcmp(key, "tippecanoe_decisions") == 0 && o->value.object.values[i]->type == JSON_HASH) {
sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES ('tippecanoe_decisions', %Q);", json_stringify(o->value.object.values[i]));
if (sqlite3_exec(db, sql, NULL, NULL, &err) != SQLITE_OK) {
fprintf(stderr, "set %s in metadata: %s\n", key.c_str(), err);
fprintf(stderr, "set %s in metadata: %s\n", key, err);
}
sqlite3_free(sql);
} else if (e.value->type != JSON_STRING) {
fprintf(stderr, "%s\n", key.c_str());
} else if (o->value.object.keys[i]->type != JSON_STRING || o->value.object.values[i]->type != JSON_STRING) {
fprintf(stderr, "%s\n", key);
fprintf(stderr, "%s: non-string in metadata\n", fname);
} else {
sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES (%Q, %Q);", key.c_str(), e.value->string().c_str());
sql = sqlite3_mprintf("INSERT INTO metadata (name, value) VALUES (%Q, %Q);", key, o->value.object.values[i]->value.string.string);
if (sqlite3_exec(db, sql, NULL, NULL, &err) != SQLITE_OK) {
fprintf(stderr, "set %s in metadata: %s\n", key.c_str(), err);
fprintf(stderr, "set %s in metadata: %s\n", key, err);
}
sqlite3_free(sql);
}
}
json_end(jp);
state.nospace = true;
state.json_end_hash();
+57 -54
View File
@@ -11,7 +11,7 @@
#include "read_json.hpp"
#include "text.hpp"
#include "mvt.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
#include "serial.hpp"
@@ -43,18 +43,18 @@ int mb_geometry[GEOM_TYPES] = {
};
void json_context(json_object *j) {
std::string s = json_stringify(j);
char *s = json_stringify(j);
if (s.size() >= 500) {
s.resize(497);
s.append("...");
if (strlen(s) >= 500) {
snprintf(s + 497, strlen(s) + 1 - 497, "...");
}
fprintf(stderr, "in JSON object %s\n", s.c_str());
fprintf(stderr, "in JSON object %s\n", s);
free(s); // stringify
}
void parse_coordinates(int t, json_object *j, drawvec &out, int op, const char *fname, int line, json_object *feature) {
if (j == nullptr || j->type != JSON_ARRAY) {
if (j == NULL || j->type != JSON_ARRAY) {
fprintf(stderr, "%s:%d: expected array for geometry type %d: ", fname, line, t);
json_context(feature);
return;
@@ -63,7 +63,7 @@ void parse_coordinates(int t, json_object *j, drawvec &out, int op, const char *
int within = geometry_within[t];
if (within >= 0) {
size_t i;
for (i = 0; i < j->array().size(); i++) {
for (i = 0; i < j->value.array.length; i++) {
if (within == GEOM_POINT) {
if (i == 0 || mb_geometry[t] == VT_POINT) {
op = VT_MOVETO;
@@ -72,16 +72,16 @@ void parse_coordinates(int t, json_object *j, drawvec &out, int op, const char *
}
}
parse_coordinates(within, j->array()[i].get(), out, op, fname, line, feature);
parse_coordinates(within, j->value.array.array[i], out, op, fname, line, feature);
}
} else {
if (j->array().size() >= 2 && j->array()[0]->type == JSON_NUMBER && j->array()[1]->type == JSON_NUMBER) {
if (j->value.array.length >= 2 && j->value.array.array[0]->type == JSON_NUMBER && j->value.array.array[1]->type == JSON_NUMBER) {
long long x, y;
double lon = j->array()[0]->number();
double lat = j->array()[1]->number();
double lon = j->value.array.array[0]->value.number.number;
double lat = j->value.array.array[1]->value.number.number;
projection->project(lon, lat, 32, &x, &y);
if (j->array().size() > 2) {
if (j->value.array.length > 2) {
static int warned = 0;
if (!warned) {
@@ -124,12 +124,12 @@ void parse_coordinates(int t, json_object *j, drawvec &out, int op, const char *
serial_val stringify_value(json_object *value, const char *reading, int line, json_object *feature) {
serial_val sv;
if (value != nullptr) {
if (value != NULL) {
int vt = value->type;
if (vt == JSON_STRING) {
sv.type = mvt_string;
sv.s = value->string();
sv.s = value->value.string.string;
std::string err = check_utf8(sv.s);
if (err.size() > 0) {
@@ -140,12 +140,12 @@ serial_val stringify_value(json_object *value, const char *reading, int line, js
} else if (vt == JSON_NUMBER) {
sv.type = mvt_double;
if (value->large_unsigned() != 0) {
sv.s = std::to_string(value->large_unsigned());
} else if (value->large_signed() != 0) {
sv.s = std::to_string(value->large_signed());
if (value->value.number.large_unsigned != 0) {
sv.s = std::to_string(value->value.number.large_unsigned);
} else if (value->value.number.large_signed != 0) {
sv.s = std::to_string(value->value.number.large_signed);
} else {
sv.s = fpfmt::dtoa(value->number());
sv.s = milo::dtoa_milo(value->value.number.number);
}
} else if (vt == JSON_TRUE) {
sv.type = mvt_bool;
@@ -158,7 +158,9 @@ serial_val stringify_value(json_object *value, const char *reading, int line, js
sv.s = "null";
} else {
sv.type = mvt_string;
sv.s = json_stringify(value);
const char *v = json_stringify(value);
sv.s = std::string(v);
free((void *) v); // stringify
}
}
@@ -176,10 +178,10 @@ static std::vector<mvt_geometry> to_feature(drawvec &geom) {
return out;
}
std::pair<int, drawvec> parse_geometry(json_object *geometry, json_pull_ptr &jp, json_object *j,
std::pair<int, drawvec> parse_geometry(json_object *geometry, json_pull *jp, json_object *j,
int z, int x, int y, long long extent, bool fix_longitudes, bool mvt_style) {
json_object *geometry_type = json_hash_get(geometry, "type");
if (geometry_type == nullptr) {
if (geometry_type == NULL) {
fprintf(stderr, "Filter output:%d: null geometry (additional not reported): ", jp->line);
json_context(j);
exit(EXIT_JSON);
@@ -192,7 +194,7 @@ std::pair<int, drawvec> parse_geometry(json_object *geometry, json_pull_ptr &jp,
}
json_object *coordinates = json_hash_get(geometry, "coordinates");
if (coordinates == nullptr || coordinates->type != JSON_ARRAY) {
if (coordinates == NULL || coordinates->type != JSON_ARRAY) {
fprintf(stderr, "Filter output:%d: geometry without coordinates array: ", jp->line);
json_context(j);
exit(EXIT_JSON);
@@ -200,12 +202,12 @@ std::pair<int, drawvec> parse_geometry(json_object *geometry, json_pull_ptr &jp,
int t;
for (t = 0; t < GEOM_TYPES; t++) {
if (geometry_type->string() == geometry_names[t]) {
if (strcmp(geometry_type->value.string.string, geometry_names[t]) == 0) {
break;
}
}
if (t >= GEOM_TYPES) {
fprintf(stderr, "Filter output:%d: Can't handle geometry type %s: ", jp->line, geometry_type->string().c_str());
fprintf(stderr, "Filter output:%d: Can't handle geometry type %s: ", jp->line, geometry_type->value.string.string);
json_context(j);
exit(EXIT_JSON);
}
@@ -303,47 +305,47 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
std::map<std::string, mvt_layer> ret;
std::shared_ptr<std::string> tile_stringpool = std::make_shared<std::string>();
json_pull_ptr jp = json_begin_file(fp);
json_pull *jp = json_begin_file(fp);
while (1) {
json_object *j = json_read(jp);
if (j == nullptr) {
if (jp->error != nullptr) {
if (j == NULL) {
if (jp->error != NULL) {
fprintf(stderr, "Filter output:%d: %s: ", jp->line, jp->error);
if (jp->root != nullptr) {
json_context(jp->root.get());
if (jp->root != NULL) {
json_context(jp->root);
} else {
fprintf(stderr, "\n");
}
exit(EXIT_JSON);
}
jp->root.reset();
json_free(jp->root);
break;
}
// Only complete Features are freed; see plugin.cpp::parse_feature.
json_object *type = json_hash_get(j, "type");
if (type == nullptr || type->type != JSON_STRING) {
if (type == NULL || type->type != JSON_STRING) {
continue;
}
if (type->string() != "Feature") {
if (strcmp(type->value.string.string, "Feature") != 0) {
continue;
}
json_object *properties = json_hash_get(j, "properties");
if (properties == nullptr || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
if (properties == NULL || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
fprintf(stderr, "Filter output:%d: feature without properties hash: ", jp->line);
json_context(j);
json_free(j);
exit(EXIT_JSON);
}
std::string layername = "unknown";
json_object *tippecanoe = json_hash_get(j, "tippecanoe");
json_object *layer = nullptr;
if (tippecanoe != nullptr) {
json_object *layer = NULL;
if (tippecanoe != NULL) {
layer = json_hash_get(tippecanoe, "layer");
if (layer != nullptr && layer->type == JSON_STRING) {
layername = layer->string();
if (layer != NULL && layer->type == JSON_STRING) {
layername = std::string(layer->value.string.string);
}
}
@@ -358,9 +360,10 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
auto l = ret.find(layername);
json_object *geometry = json_hash_get(j, "geometry");
if (geometry == nullptr) {
if (geometry == NULL) {
fprintf(stderr, "Filter output:%d: filtered feature with no geometry: ", jp->line);
json_context(j);
json_free(j);
exit(EXIT_JSON);
}
@@ -375,25 +378,23 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
feature.geometry = to_feature(dv);
json_object *id = json_hash_get(j, "id");
if (id != nullptr && id->type == JSON_NUMBER) {
feature.id = id->number();
if (id->large_unsigned() > 0) {
feature.id = id->large_unsigned();
if (id != NULL && id->type == JSON_NUMBER) {
feature.id = id->value.number.number;
if (id->value.number.large_unsigned > 0) {
feature.id = id->value.number.large_unsigned;
}
feature.has_id = true;
}
if (properties->type == JSON_HASH) {
for (const auto &e : properties->entries()) {
serial_val sv = stringify_value(e.value.get(), "Filter output", jp->line, j);
for (size_t i = 0; i < properties->value.object.length; i++) {
serial_val sv = stringify_value(properties->value.object.values[i], "Filter output", jp->line, j);
// Nulls can be excluded here because this is the postfilter
// and it is nearly time to create the vector representation
// Nulls can be excluded here because this is the postfilter
// and it is nearly time to create the vector representation
if (sv.type != mvt_null) {
mvt_value v = stringified_to_mvt_value(sv.type, sv.s.c_str(), tile_stringpool);
l->second.tag(feature, e.key->string(), v);
}
if (sv.type != mvt_null) {
mvt_value v = stringified_to_mvt_value(sv.type, sv.s.c_str(), tile_stringpool);
l->second.tag(feature, std::string(properties->value.object.keys[i]->value.string.string), v);
}
}
@@ -403,6 +404,8 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
json_free(j);
}
json_end(jp);
std::vector<mvt_layer> final;
for (auto a : ret) {
final.push_back(a.second);
+1 -1
View File
@@ -12,7 +12,7 @@ extern int mb_geometry[GEOM_TYPES];
void json_context(json_object *j);
void parse_coordinates(int t, json_object *j, drawvec &out, int op, const char *fname, int line, json_object *feature);
std::pair<int, drawvec> parse_geometry(json_object *geometry, json_pull_ptr &jp, json_object *j,
std::pair<int, drawvec> parse_geometry(json_object *geometry, json_pull *jp, json_object *j,
int z, int x, int y, long long extent, bool fix_longitudes, bool mvt_style);
std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int extent, bool fix_longitudes);
+3 -3
View File
@@ -21,7 +21,7 @@
#include "pool.hpp"
#include "projection.hpp"
#include "evaluator.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
#include "text.hpp"
@@ -805,7 +805,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
if (sf.full_values[i].type == mvt_double) {
// don't coerce integers to floats, since that is counterproductive
if (sf.full_values[i].s.find('.') != std::string::npos) {
sf.full_values[i].s = fpfmt::dtoa((float) atof(sf.full_values[i].s.c_str()));
sf.full_values[i].s = milo::dtoa_milo((float) atof(sf.full_values[i].s.c_str()));
}
}
}
@@ -928,7 +928,7 @@ void coerce_value(std::string const &key, int &vt, std::string &val, std::unorde
vt = mvt_string;
} else if (a->second == mvt_float) {
vt = mvt_double;
val = fpfmt::dtoa(atof(val.c_str()));
val = milo::dtoa_milo(atof(val.c_str()));
} else if (a->second == mvt_int) {
vt = mvt_double;
if (val.size() == 0) {
+2 -2
View File
@@ -55,7 +55,7 @@ struct serial_val {
serial_val(double val) {
type = mvt_double;
s = fpfmt::dtoa(val);
s = milo::dtoa_milo(val);
}
double to_double() const {
@@ -82,7 +82,7 @@ struct serial_val {
void set_double_count(double v, size_t c) {
type = mvt_double;
s = fpfmt::dtoa(v) + '\0' + std::to_string(c);
s = milo::dtoa_milo(v) + '\0' + std::to_string(c);
}
};
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1001","GEOID10":"060014201001001","NAME10":"Block 1001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":11297,"AWATER10":0,"INTPTLAT10":"+37.897321","INTPTLON10":"-122.291217","population":21},"geometry":{"type":"Polygon","coordinates":[[[-122.290726,37.897886],[-122.29074,37.897638],[-122.290787,37.896901],[-122.290805,37.896657],[-122.290984,37.896663],[-122.291521,37.896682],[-122.291701,37.896689],[-122.291678,37.89697],[-122.291634,37.897545],[-122.291618,37.897816],[-122.291605,37.8981],[-122.291468,37.898054],[-122.291079,37.897926],[-122.290938,37.89791],[-122.290756,37.897889],[-122.290726,37.897886]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1002","GEOID10":"060014201001002","NAME10":"Block 1002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14980,"AWATER10":0,"INTPTLAT10":"+37.897482","INTPTLON10":"-122.292153","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.291605,37.8981],[-122.291618,37.897816],[-122.291634,37.897545],[-122.291678,37.89697],[-122.291701,37.896689],[-122.291893,37.896692],[-122.292469,37.896704],[-122.292661,37.896708],[-122.292651,37.896903],[-122.292624,37.89749],[-122.292615,37.897686],[-122.292632,37.897815],[-122.292655,37.897974],[-122.292657,37.898134],[-122.292647,37.898178],[-122.292648,37.898205],[-122.292649,37.898267],[-122.292653,37.89833],[-122.292655,37.898338],[-122.292526,37.898316],[-122.292346,37.898286],[-122.291979,37.898225],[-122.291911,37.898202],[-122.291815,37.89817],[-122.291644,37.898113],[-122.291605,37.8981]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1003","GEOID10":"060014201001003","NAME10":"Block 1003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1246,"AWATER10":0,"INTPTLAT10":"+37.898006","INTPTLON10":"-122.292741"},"geometry":{"type":"Polygon","coordinates":[[[-122.292828,37.898367],[-122.29271,37.898347],[-122.292655,37.898338],[-122.292653,37.89833],[-122.292649,37.898267],[-122.292648,37.898205],[-122.292647,37.898178],[-122.292657,37.898134],[-122.292655,37.897974],[-122.292632,37.897815],[-122.292615,37.897686],[-122.292837,37.897691],[-122.292846,37.897692],[-122.292828,37.898367]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1004","GEOID10":"060014201001004","NAME10":"Block 1004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":6640,"AWATER10":0,"INTPTLAT10":"+37.898096","INTPTLON10":"-122.293296","population":9},"geometry":{"type":"Polygon","coordinates":[[[-122.293661,37.898516],[-122.293684,37.898637],[-122.293656,37.898634],[-122.293579,37.898625],[-122.293547,37.898608],[-122.29345,37.89856],[-122.29342,37.898545],[-122.293253,37.898461],[-122.29318,37.898425],[-122.29283,37.898368],[-122.292828,37.898367],[-122.292846,37.897692],[-122.293505,37.897709],[-122.293728,37.897715],[-122.29372,37.897876],[-122.293697,37.898359],[-122.293696,37.898391],[-122.293661,37.898516]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1004","GEOID10":"060014201001004","NAME10":"Block 1004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":6640,"AWATER10":0,"INTPTLAT10":"+37.898096","INTPTLON10":"-122.293296","population":9},"geometry":{"type":"Polygon","coordinates":[[[-122.293661,37.898516],[-122.293684,37.898637],[-122.293656,37.898634],[-122.293579,37.898625],[-122.293547,37.898608],[-122.29345000000001,37.89856],[-122.29342,37.898545],[-122.293253,37.898461],[-122.29318,37.898425],[-122.29283,37.898368],[-122.292828,37.898367],[-122.292846,37.897692],[-122.293505,37.897709],[-122.293728,37.897715],[-122.29372,37.897876],[-122.293697,37.898359],[-122.293696,37.898391],[-122.293661,37.898516]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1005","GEOID10":"060014201001005","NAME10":"Block 1005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":8083,"AWATER10":0,"INTPTLAT10":"+37.898210","INTPTLON10":"-122.294138"},"geometry":{"type":"Polygon","coordinates":[[[-122.294554,37.898735],[-122.29448,37.898725],[-122.294359,37.898711],[-122.293774,37.898647],[-122.293684,37.898637],[-122.293661,37.898516],[-122.293696,37.898391],[-122.293697,37.898359],[-122.29372,37.897876],[-122.293728,37.897715],[-122.293898,37.89772],[-122.294408,37.897737],[-122.294579,37.897743],[-122.294573,37.897941],[-122.294558,37.898536],[-122.294555,37.898689],[-122.294554,37.898735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1006","GEOID10":"060014201001006","NAME10":"Block 1006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14453,"AWATER10":0,"INTPTLAT10":"+37.898332","INTPTLON10":"-122.295280"},"geometry":{"type":"Polygon","coordinates":[[[-122.294554,37.898735],[-122.294555,37.898689],[-122.294558,37.898536],[-122.294573,37.897941],[-122.294579,37.897743],[-122.294803,37.897747],[-122.295478,37.897759],[-122.295703,37.897763],[-122.295794,37.897999],[-122.295882,37.898223],[-122.2961,37.898695],[-122.296207,37.898925],[-122.29598,37.898925],[-122.295874,37.898911],[-122.295176,37.898818],[-122.294884,37.898779],[-122.294554,37.898735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1007","GEOID10":"060014201001007","NAME10":"Block 1007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":17265,"AWATER10":0,"INTPTLAT10":"+37.896623","INTPTLON10":"-122.294972","population":87},"geometry":{"type":"Polygon","coordinates":[[[-122.294579,37.897743],[-122.294615,37.897096],[-122.294631,37.896828],[-122.294639,37.896549],[-122.294709,37.895468],[-122.2947,37.895378],[-122.294677,37.895296],[-122.294628,37.895169],[-122.294395,37.894565],[-122.294444,37.894555],[-122.294591,37.894529],[-122.294641,37.894521],[-122.294853,37.895169],[-122.295037,37.895732],[-122.295218,37.896312],[-122.295397,37.896857],[-122.295482,37.897117],[-122.295557,37.897346],[-122.295703,37.897763],[-122.295478,37.897759],[-122.294803,37.897747],[-122.294579,37.897743]]]}}
@@ -24,16 +24,16 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2003","GEOID10":"060014201002003","NAME10":"Block 2003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1027,"AWATER10":0,"INTPTLAT10":"+37.897345","INTPTLON10":"-122.288150"},"geometry":{"type":"Polygon","coordinates":[[[-122.288161,37.898102],[-122.288092,37.89814],[-122.288099,37.89793],[-122.28814,37.896582],[-122.288211,37.896582],[-122.2882,37.896885],[-122.28817,37.897797],[-122.288168,37.897886],[-122.288161,37.898102]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2004","GEOID10":"060014201002004","NAME10":"Block 2004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":11206,"AWATER10":0,"INTPTLAT10":"+37.897263","INTPTLON10":"-122.288602","population":16},"geometry":{"type":"Polygon","coordinates":[[[-122.288161,37.898102],[-122.288168,37.897886],[-122.28817,37.897797],[-122.2882,37.896885],[-122.288211,37.896582],[-122.288386,37.896587],[-122.288914,37.896604],[-122.28909,37.89661],[-122.28907,37.896861],[-122.289013,37.897619],[-122.289008,37.897701],[-122.288996,37.897874],[-122.288869,37.897886],[-122.28848,37.897925],[-122.288326,37.89801],[-122.288161,37.898102]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2005","GEOID10":"060014201002005","NAME10":"Block 2005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":10320,"AWATER10":0,"INTPTLAT10":"+37.897228","INTPTLON10":"-122.289472","population":17},"geometry":{"type":"Polygon","coordinates":[[[-122.288996,37.897874],[-122.289008,37.897701],[-122.289013,37.897619],[-122.28907,37.896861],[-122.28909,37.89661],[-122.289264,37.896614],[-122.289788,37.896629],[-122.289963,37.896634],[-122.289941,37.896871],[-122.289881,37.897585],[-122.289872,37.897693],[-122.289862,37.897825],[-122.289722,37.897825],[-122.28948,37.897825],[-122.289223,37.897851],[-122.289058,37.897868],[-122.288996,37.897874]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2006","GEOID10":"060014201002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15730,"AWATER10":0,"INTPTLAT10":"+37.895696","INTPTLON10":"-122.289570","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.289184,37.894754],[-122.289358,37.89476],[-122.289881,37.894779],[-122.290056,37.894786],[-122.290045,37.894895],[-122.290039,37.894995],[-122.290012,37.895525],[-122.290007,37.895625],[-122.289998,37.895835],[-122.28999,37.895994],[-122.28997,37.896474],[-122.289963,37.896634],[-122.289788,37.896629],[-122.289264,37.896614],[-122.28909,37.89661],[-122.289108,37.896238],[-122.289164,37.895125],[-122.289184,37.894754]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2006","GEOID10":"060014201002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15730,"AWATER10":0,"INTPTLAT10":"+37.895696","INTPTLON10":"-122.289570","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.289184,37.894754],[-122.28935799999999,37.89476],[-122.289881,37.894779],[-122.290056,37.894786],[-122.290045,37.894895],[-122.290039,37.894995],[-122.290012,37.895525],[-122.290007,37.895625],[-122.289998,37.895835],[-122.28999,37.895994],[-122.28997,37.896474],[-122.289963,37.896634],[-122.289788,37.896629],[-122.289264,37.896614],[-122.28909,37.89661],[-122.289108,37.896238],[-122.289164,37.895125],[-122.289184,37.894754]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2007","GEOID10":"060014201002007","NAME10":"Block 2007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15930,"AWATER10":0,"INTPTLAT10":"+37.895669","INTPTLON10":"-122.288696","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.28909,37.89661],[-122.288914,37.896604],[-122.288386,37.896587],[-122.288211,37.896582],[-122.288229,37.896212],[-122.288283,37.895104],[-122.288302,37.894735],[-122.288478,37.894738],[-122.289007,37.89475],[-122.289184,37.894754],[-122.289164,37.895125],[-122.289108,37.896238],[-122.28909,37.89661]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2008","GEOID10":"060014201002008","NAME10":"Block 2008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1214,"AWATER10":0,"INTPTLAT10":"+37.895673","INTPTLON10":"-122.288221"},"geometry":{"type":"Polygon","coordinates":[[[-122.288211,37.896582],[-122.28814,37.896582],[-122.288238,37.89473],[-122.288302,37.894735],[-122.288283,37.895104],[-122.288229,37.896212],[-122.288211,37.896582]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2009","GEOID10":"060014201002009","NAME10":"Block 2009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15974,"AWATER10":0,"INTPTLAT10":"+37.895646","INTPTLON10":"-122.287747","population":33},"geometry":{"type":"Polygon","coordinates":[[[-122.28814,37.896582],[-122.28802,37.896579],[-122.28745,37.896567],[-122.28726,37.896563],[-122.287278,37.896193],[-122.287332,37.895085],[-122.287351,37.894716],[-122.287541,37.894719],[-122.288111,37.894728],[-122.288238,37.89473],[-122.28814,37.896582]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2010","GEOID10":"060014201002010","NAME10":"Block 2010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":3628,"AWATER10":0,"INTPTLAT10":"+37.895607","INTPTLON10":"-122.287205","population":10},"geometry":{"type":"Polygon","coordinates":[[[-122.287078,37.896557],[-122.287088,37.896187],[-122.28712,37.895078],[-122.287132,37.894709],[-122.287175,37.89471],[-122.287307,37.894714],[-122.287351,37.894716],[-122.287332,37.895085],[-122.287278,37.896193],[-122.28726,37.896563],[-122.287223,37.896561],[-122.287114,37.896558],[-122.287078,37.896557]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2011","GEOID10":"060014201002011","NAME10":"Block 2011","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":4556,"AWATER10":0,"INTPTLAT10":"+37.893731","INTPTLON10":"-122.287275","population":11},"geometry":{"type":"Polygon","coordinates":[[[-122.287132,37.894709],[-122.28714,37.894329],[-122.287163,37.893189],[-122.287172,37.89281],[-122.287224,37.89281],[-122.28738,37.89281],[-122.287432,37.89281],[-122.287422,37.893191],[-122.287416,37.89345],[-122.28737,37.894334],[-122.287351,37.894716],[-122.287307,37.894714],[-122.287175,37.89471],[-122.287132,37.894709]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2012","GEOID10":"060014201002012","NAME10":"Block 2012","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16253,"AWATER10":0,"INTPTLAT10":"+37.893780","INTPTLON10":"-122.287836","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.288317,37.892856],[-122.288238,37.89473],[-122.288111,37.894728],[-122.287541,37.894719],[-122.287351,37.894716],[-122.28737,37.894334],[-122.287416,37.89345],[-122.287422,37.893191],[-122.287432,37.89281],[-122.287609,37.892825],[-122.287623,37.892825],[-122.2882,37.89285],[-122.288317,37.892856]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2013","GEOID10":"060014201002013","NAME10":"Block 2013","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1269,"AWATER10":0,"INTPTLAT10":"+37.893772","INTPTLON10":"-122.288313"},"geometry":{"type":"Polygon","coordinates":[[[-122.288238,37.89473],[-122.288317,37.892856],[-122.28835,37.892856],[-122.288392,37.892863],[-122.288373,37.893237],[-122.28832,37.89436],[-122.288302,37.894735],[-122.288238,37.89473]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2014","GEOID10":"060014201002014","NAME10":"Block 2014","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16117,"AWATER10":0,"INTPTLAT10":"+37.893809","INTPTLON10":"-122.288787","population":32},"geometry":{"type":"Polygon","coordinates":[[[-122.288302,37.894735],[-122.28832,37.89436],[-122.288373,37.893237],[-122.288392,37.892863],[-122.288568,37.892867],[-122.289097,37.892882],[-122.289274,37.892887],[-122.289255,37.89326],[-122.289202,37.89438],[-122.289184,37.894754],[-122.289007,37.89475],[-122.288478,37.894738],[-122.288302,37.894735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2015","GEOID10":"060014201002015","NAME10":"Block 2015","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15921,"AWATER10":0,"INTPTLAT10":"+37.893833","INTPTLON10":"-122.289663","population":35},"geometry":{"type":"Polygon","coordinates":[[[-122.289274,37.892887],[-122.289447,37.89289],[-122.289966,37.892899],[-122.29014,37.892903],[-122.290122,37.893279],[-122.290072,37.894409],[-122.290056,37.894786],[-122.289881,37.894779],[-122.289358,37.89476],[-122.289184,37.894754],[-122.289202,37.89438],[-122.289255,37.89326],[-122.289274,37.892887]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2013","GEOID10":"060014201002013","NAME10":"Block 2013","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1269,"AWATER10":0,"INTPTLAT10":"+37.893772","INTPTLON10":"-122.288313"},"geometry":{"type":"Polygon","coordinates":[[[-122.288238,37.89473],[-122.288317,37.892856],[-122.28835,37.892856],[-122.288392,37.892863],[-122.28837300000001,37.893237],[-122.28832,37.89436],[-122.288302,37.894735],[-122.288238,37.89473]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2014","GEOID10":"060014201002014","NAME10":"Block 2014","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16117,"AWATER10":0,"INTPTLAT10":"+37.893809","INTPTLON10":"-122.288787","population":32},"geometry":{"type":"Polygon","coordinates":[[[-122.288302,37.894735],[-122.28832,37.89436],[-122.28837300000001,37.893237],[-122.288392,37.892863],[-122.288568,37.892867],[-122.289097,37.892882],[-122.289274,37.892887],[-122.289255,37.89326],[-122.289202,37.89438],[-122.289184,37.894754],[-122.289007,37.89475],[-122.288478,37.894738],[-122.288302,37.894735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2015","GEOID10":"060014201002015","NAME10":"Block 2015","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15921,"AWATER10":0,"INTPTLAT10":"+37.893833","INTPTLON10":"-122.289663","population":35},"geometry":{"type":"Polygon","coordinates":[[[-122.289274,37.892887],[-122.289447,37.89289],[-122.289966,37.892899],[-122.29014,37.892903],[-122.290122,37.893279],[-122.290072,37.894409],[-122.290056,37.894786],[-122.289881,37.894779],[-122.28935799999999,37.89476],[-122.289184,37.894754],[-122.289202,37.89438],[-122.289255,37.89326],[-122.289274,37.892887]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3000","GEOID10":"060014201003000","NAME10":"Block 3000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15665,"AWATER10":0,"INTPTLAT10":"+37.893860","INTPTLON10":"-122.290522","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.290056,37.894786],[-122.290072,37.894409],[-122.290122,37.893279],[-122.29014,37.892903],[-122.290308,37.892908],[-122.290813,37.892925],[-122.290982,37.892931],[-122.290968,37.893306],[-122.29093,37.894434],[-122.290918,37.89481],[-122.290745,37.894805],[-122.290228,37.89479],[-122.290056,37.894786]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3001","GEOID10":"060014201003001","NAME10":"Block 3001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16246,"AWATER10":0,"INTPTLAT10":"+37.893883","INTPTLON10":"-122.291391","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.291796,37.894851],[-122.29162,37.894834],[-122.291598,37.894832],[-122.291093,37.894815],[-122.290918,37.89481],[-122.29093,37.894434],[-122.290968,37.893306],[-122.290982,37.892931],[-122.29116,37.892937],[-122.291698,37.892955],[-122.291877,37.892961],[-122.291858,37.893285],[-122.291855,37.893338],[-122.29181,37.894472],[-122.291796,37.894851]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3002","GEOID10":"060014201003002","NAME10":"Block 3002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19544,"AWATER10":0,"INTPTLAT10":"+37.891804","INTPTLON10":"-122.291474","population":38},"geometry":{"type":"Polygon","coordinates":[[[-122.291921,37.890645],[-122.291943,37.890729],[-122.291946,37.890796],[-122.291936,37.891075],[-122.291892,37.892376],[-122.291878,37.89281],[-122.291877,37.89284],[-122.291877,37.89293],[-122.291877,37.892961],[-122.291698,37.892955],[-122.29116,37.892937],[-122.290982,37.892931],[-122.29102,37.892483],[-122.291024,37.89244],[-122.29105,37.891137],[-122.29106,37.890689],[-122.291232,37.890679],[-122.291748,37.890653],[-122.291921,37.890645]]]}}
@@ -41,7 +41,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3004","GEOID10":"060014201003004","NAME10":"Block 3004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18095,"AWATER10":0,"INTPTLAT10":"+37.891824","INTPTLON10":"-122.289764","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.29014,37.892903],[-122.289966,37.892899],[-122.289447,37.89289],[-122.289274,37.892887],[-122.289296,37.892464],[-122.289362,37.891196],[-122.289385,37.890774],[-122.289485,37.890769],[-122.289786,37.890756],[-122.289887,37.890752],[-122.289959,37.890746],[-122.290178,37.89073],[-122.290251,37.890725],[-122.290228,37.89116],[-122.290162,37.892467],[-122.29014,37.892903]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3005","GEOID10":"060014201003005","NAME10":"Block 3005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16537,"AWATER10":0,"INTPTLAT10":"+37.891906","INTPTLON10":"-122.288910","population":29},"geometry":{"type":"Polygon","coordinates":[[[-122.288392,37.892863],[-122.28841,37.892428],[-122.288448,37.891575],[-122.288456,37.891528],[-122.288475,37.891476],[-122.288517,37.891402],[-122.288685,37.891199],[-122.288694,37.891189],[-122.288746,37.891135],[-122.288786,37.891077],[-122.288809,37.891023],[-122.288829,37.890933],[-122.288847,37.890809],[-122.288954,37.890801],[-122.289277,37.890781],[-122.289385,37.890774],[-122.289362,37.891196],[-122.289296,37.892464],[-122.289274,37.892887],[-122.289097,37.892882],[-122.288568,37.892867],[-122.288392,37.892863]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3006","GEOID10":"060014201003006","NAME10":"Block 3006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1509,"AWATER10":0,"INTPTLAT10":"+37.892606","INTPTLON10":"-122.288382"},"geometry":{"type":"Polygon","coordinates":[[[-122.288317,37.892856],[-122.28838,37.891572],[-122.288401,37.891473],[-122.288438,37.891395],[-122.288481,37.891327],[-122.288619,37.891164],[-122.28871,37.891072],[-122.288738,37.89102],[-122.288751,37.890966],[-122.28877,37.890812],[-122.288847,37.890809],[-122.288829,37.890933],[-122.288809,37.891023],[-122.288786,37.891077],[-122.288746,37.891135],[-122.288694,37.891189],[-122.288685,37.891199],[-122.288517,37.891402],[-122.288475,37.891476],[-122.288456,37.891528],[-122.288448,37.891575],[-122.28841,37.892428],[-122.288392,37.892863],[-122.28835,37.892856],[-122.288317,37.892856]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3007","GEOID10":"060014201003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18637,"AWATER10":0,"INTPTLAT10":"+37.891785","INTPTLON10":"-122.287969","population":28},"geometry":{"type":"Polygon","coordinates":[[[-122.28877,37.890812],[-122.288751,37.890966],[-122.288738,37.89102],[-122.28871,37.891072],[-122.288619,37.891164],[-122.288481,37.891327],[-122.288438,37.891395],[-122.288401,37.891473],[-122.28838,37.891572],[-122.288317,37.892856],[-122.2882,37.89285],[-122.287623,37.892825],[-122.287609,37.892825],[-122.287432,37.89281],[-122.287448,37.892424],[-122.287498,37.891267],[-122.287516,37.890882],[-122.287553,37.890879],[-122.287668,37.890874],[-122.287706,37.890872],[-122.287934,37.890859],[-122.288618,37.890821],[-122.288767,37.890813],[-122.28877,37.890812]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3007","GEOID10":"060014201003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18637,"AWATER10":0,"INTPTLAT10":"+37.891785","INTPTLON10":"-122.287969","population":28},"geometry":{"type":"Polygon","coordinates":[[[-122.28877,37.890812],[-122.288751,37.890966],[-122.288738,37.89102],[-122.28871,37.891072],[-122.288619,37.891164],[-122.288481,37.891327],[-122.288438,37.891395],[-122.288401,37.891473],[-122.28838,37.891572],[-122.288317,37.892856],[-122.2882,37.89285],[-122.287623,37.892825],[-122.287609,37.892825],[-122.287432,37.89281],[-122.287448,37.892424],[-122.287498,37.891267],[-122.287516,37.890882],[-122.287553,37.890879],[-122.287668,37.890874],[-122.287706,37.890872],[-122.287934,37.890859],[-122.288618,37.890821],[-122.28876700000001,37.890813],[-122.28877,37.890812]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3008","GEOID10":"060014201003008","NAME10":"Block 3008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":5620,"AWATER10":0,"INTPTLAT10":"+37.891809","INTPTLON10":"-122.287323","population":12},"geometry":{"type":"Polygon","coordinates":[[[-122.287432,37.89281],[-122.28738,37.89281],[-122.287224,37.89281],[-122.287172,37.89281],[-122.287172,37.89243],[-122.287172,37.891291],[-122.287172,37.890912],[-122.28724,37.890905],[-122.287447,37.890888],[-122.287516,37.890882],[-122.287498,37.891267],[-122.287448,37.892424],[-122.287432,37.89281]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"1000","GEOID10":"060014202001000","NAME10":"Block 1000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":13452,"AWATER10":0,"INTPTLAT10":"+37.898271","INTPTLON10":"-122.296474","population":113},"geometry":{"type":"Polygon","coordinates":[[[-122.295703,37.897763],[-122.295745,37.897753],[-122.295873,37.897727],[-122.295916,37.897719],[-122.296087,37.897683],[-122.296603,37.897579],[-122.296775,37.897544],[-122.296859,37.897814],[-122.297113,37.898626],[-122.297144,37.898723],[-122.297162,37.898783],[-122.297197,37.898898],[-122.297,37.898922],[-122.29698,37.898925],[-122.296405,37.898925],[-122.296338,37.898925],[-122.296207,37.898925],[-122.2961,37.898695],[-122.295882,37.898223],[-122.295794,37.897999],[-122.295703,37.897763]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"1001","GEOID10":"060014202001001","NAME10":"Block 1001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":11928,"AWATER10":0,"INTPTLAT10":"+37.898151","INTPTLON10":"-122.297410","population":49},"geometry":{"type":"Polygon","coordinates":[[[-122.297197,37.898898],[-122.297162,37.898783],[-122.297144,37.898723],[-122.297113,37.898626],[-122.296859,37.897814],[-122.296775,37.897544],[-122.296942,37.897512],[-122.297443,37.897418],[-122.297611,37.897387],[-122.297697,37.897656],[-122.297958,37.898466],[-122.298008,37.89862],[-122.298024,37.898671],[-122.298044,37.898737],[-122.297879,37.898791],[-122.29778,37.898825],[-122.297368,37.898876],[-122.297197,37.898898]]]}}
@@ -66,8 +66,8 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2005","GEOID10":"060014202002005","NAME10":"Block 2005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14270,"AWATER10":0,"INTPTLAT10":"+37.894854","INTPTLON10":"-122.297242","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.297079,37.895752],[-122.296974,37.895424],[-122.296662,37.89444],[-122.296559,37.894113],[-122.29668,37.894103],[-122.296731,37.894094],[-122.296759,37.89409],[-122.297241,37.89399],[-122.297411,37.893956],[-122.297512,37.894282],[-122.297819,37.89526],[-122.297921,37.895586],[-122.297752,37.895619],[-122.297247,37.895718],[-122.297079,37.895752]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2006","GEOID10":"060014202002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14158,"AWATER10":0,"INTPTLAT10":"+37.893232","INTPTLON10":"-122.296730","population":32},"geometry":{"type":"Polygon","coordinates":[[[-122.296056,37.892502],[-122.296222,37.892468],[-122.296721,37.892368],[-122.296888,37.892335],[-122.296992,37.892659],[-122.297306,37.893631],[-122.297411,37.893956],[-122.297241,37.89399],[-122.296759,37.89409],[-122.296731,37.894094],[-122.29668,37.894103],[-122.296559,37.894113],[-122.296458,37.89379],[-122.296156,37.892824],[-122.296056,37.892502]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2007","GEOID10":"060014202002007","NAME10":"Block 2007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14053,"AWATER10":0,"INTPTLAT10":"+37.893393","INTPTLON10":"-122.295888","population":33},"geometry":{"type":"Polygon","coordinates":[[[-122.296056,37.892502],[-122.296156,37.892824],[-122.296458,37.89379],[-122.296559,37.894113],[-122.29647,37.894126],[-122.296394,37.894149],[-122.295895,37.894257],[-122.295729,37.894293],[-122.295626,37.893968],[-122.295317,37.892994],[-122.295215,37.89267],[-122.295383,37.892636],[-122.295887,37.892535],[-122.296056,37.892502]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2008","GEOID10":"060014202002008","NAME10":"Block 2008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18377,"AWATER10":0,"INTPTLAT10":"+37.891538","INTPTLON10":"-122.295286","population":50},"geometry":{"type":"Polygon","coordinates":[[[-122.294504,37.890519],[-122.294681,37.890508],[-122.295212,37.890478],[-122.29539,37.890468],[-122.295523,37.890874],[-122.295922,37.892095],[-122.296056,37.892502],[-122.295887,37.892535],[-122.295383,37.892636],[-122.295215,37.89267],[-122.295072,37.892239],[-122.294646,37.890949],[-122.294504,37.890519]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2009","GEOID10":"060014202002009","NAME10":"Block 2009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19818,"AWATER10":0,"INTPTLAT10":"+37.891658","INTPTLON10":"-122.294418","population":57},"geometry":{"type":"Polygon","coordinates":[[[-122.293622,37.890561],[-122.293645,37.890559],[-122.293714,37.890556],[-122.293738,37.890555],[-122.29377,37.890552],[-122.293869,37.890547],[-122.293902,37.890546],[-122.294022,37.890541],[-122.294243,37.890533],[-122.294383,37.890525],[-122.294504,37.890519],[-122.294646,37.890949],[-122.295072,37.892239],[-122.295215,37.89267],[-122.29504,37.892706],[-122.294515,37.892817],[-122.294476,37.892826],[-122.294338,37.892841],[-122.294194,37.892385],[-122.293765,37.891017],[-122.293622,37.890561]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2008","GEOID10":"060014202002008","NAME10":"Block 2008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18377,"AWATER10":0,"INTPTLAT10":"+37.891538","INTPTLON10":"-122.295286","population":50},"geometry":{"type":"Polygon","coordinates":[[[-122.294504,37.890519],[-122.294681,37.890508],[-122.295212,37.890478],[-122.29539,37.890468],[-122.295523,37.890874],[-122.295922,37.892095],[-122.296056,37.892502],[-122.295887,37.892535],[-122.295383,37.892636],[-122.295215,37.89267],[-122.295072,37.892238999999999],[-122.294646,37.890949],[-122.294504,37.890519]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2009","GEOID10":"060014202002009","NAME10":"Block 2009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19818,"AWATER10":0,"INTPTLAT10":"+37.891658","INTPTLON10":"-122.294418","population":57},"geometry":{"type":"Polygon","coordinates":[[[-122.293622,37.890561],[-122.293645,37.890559],[-122.293714,37.890556],[-122.293738,37.890555],[-122.29377,37.890552],[-122.293869,37.890547],[-122.293902,37.890546],[-122.294022,37.890541],[-122.294243,37.890533],[-122.294383,37.890525],[-122.294504,37.890519],[-122.294646,37.890949],[-122.295072,37.892238999999999],[-122.295215,37.89267],[-122.29504,37.892706],[-122.294515,37.892817],[-122.294476,37.892826],[-122.294338,37.892841],[-122.294194,37.892385],[-122.293765,37.891017],[-122.293622,37.890561]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2010","GEOID10":"060014202002010","NAME10":"Block 2010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":8445,"AWATER10":0,"INTPTLAT10":"+37.891485","INTPTLON10":"-122.293695"},"geometry":{"type":"Polygon","coordinates":[[[-122.293139,37.891024],[-122.293159,37.890585],[-122.293288,37.890575],[-122.293302,37.890574],[-122.293364,37.890568],[-122.293387,37.890567],[-122.293622,37.890561],[-122.293765,37.891017],[-122.294194,37.892385],[-122.294338,37.892841],[-122.29429,37.892845],[-122.294234,37.892851],[-122.294147,37.89285],[-122.2941,37.89285],[-122.293834,37.891979],[-122.293649,37.891725],[-122.293139,37.891024]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2011","GEOID10":"060014202002011","NAME10":"Block 2011","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":700,"AWATER10":0,"INTPTLAT10":"+37.890745","INTPTLON10":"-122.293047"},"geometry":{"type":"Polygon","coordinates":[[[-122.293159,37.890585],[-122.293139,37.891024],[-122.293092,37.890965],[-122.292898,37.890719],[-122.292897,37.890695],[-122.292894,37.890624],[-122.292894,37.890601],[-122.292992,37.890595],[-122.293159,37.890585]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2012","GEOID10":"060014202002012","NAME10":"Block 2012","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":17230,"AWATER10":0,"INTPTLAT10":"+37.891425","INTPTLON10":"-122.296144","population":51},"geometry":{"type":"Polygon","coordinates":[[[-122.296056,37.892502],[-122.295922,37.892095],[-122.295523,37.890874],[-122.29539,37.890468],[-122.295564,37.890454],[-122.296087,37.890415],[-122.296262,37.890403],[-122.296387,37.890789],[-122.296762,37.891948],[-122.296888,37.892335],[-122.296721,37.892368],[-122.296222,37.892468],[-122.296056,37.892502]]]}}
@@ -81,7 +81,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3007","GEOID10":"060014202003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14185,"AWATER10":0,"INTPTLAT10":"+37.893063","INTPTLON10":"-122.297570","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.297411,37.893956],[-122.297306,37.893631],[-122.296992,37.892659],[-122.296888,37.892335],[-122.297057,37.892301],[-122.297566,37.892203],[-122.297736,37.892171],[-122.297838,37.892498],[-122.298145,37.893479],[-122.298248,37.893806],[-122.29808,37.893836],[-122.297578,37.893925],[-122.297411,37.893956]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3008","GEOID10":"060014202003008","NAME10":"Block 3008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16353,"AWATER10":0,"INTPTLAT10":"+37.891320","INTPTLON10":"-122.297001","population":51},"geometry":{"type":"Polygon","coordinates":[[[-122.296888,37.892335],[-122.296762,37.891948],[-122.296387,37.890789],[-122.296262,37.890403],[-122.296437,37.890394],[-122.296963,37.890371],[-122.297139,37.890363],[-122.297258,37.890724],[-122.297616,37.891809],[-122.297736,37.892171],[-122.297566,37.892203],[-122.297057,37.892301],[-122.296888,37.892335]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3009","GEOID10":"060014202003009","NAME10":"Block 3009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15100,"AWATER10":0,"INTPTLAT10":"+37.891205","INTPTLON10":"-122.297856","population":84},"geometry":{"type":"Polygon","coordinates":[[[-122.297736,37.892171],[-122.297616,37.891809],[-122.297258,37.890724],[-122.297139,37.890363],[-122.297316,37.890353],[-122.297849,37.890327],[-122.298027,37.890319],[-122.298132,37.890652],[-122.298448,37.891651],[-122.298554,37.891985],[-122.29839,37.892022],[-122.297899,37.892133],[-122.297736,37.892171]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3010","GEOID10":"060014202003010","NAME10":"Block 3010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14291,"AWATER10":0,"INTPTLAT10":"+37.891101","INTPTLON10":"-122.298726","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.298929,37.890275],[-122.299416,37.891816],[-122.299342,37.89183],[-122.298751,37.891946],[-122.298554,37.891985],[-122.298448,37.891651],[-122.298132,37.890652],[-122.298027,37.890319],[-122.298232,37.890312],[-122.298514,37.890304],[-122.298724,37.890294],[-122.298846,37.890282],[-122.298929,37.890275]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3010","GEOID10":"060014202003010","NAME10":"Block 3010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14291,"AWATER10":0,"INTPTLAT10":"+37.891101","INTPTLON10":"-122.298726","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.298929,37.890275],[-122.299416,37.891816],[-122.299342,37.89183],[-122.298751,37.891946],[-122.298554,37.891985],[-122.298448,37.891651],[-122.298132,37.890652],[-122.298027,37.890319],[-122.298232,37.890312],[-122.298514,37.890304],[-122.29872400000001,37.890294],[-122.298846,37.890282],[-122.298929,37.890275]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3011","GEOID10":"060014202003011","NAME10":"Block 3011","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1922,"AWATER10":0,"INTPTLAT10":"+37.891043","INTPTLON10":"-122.299235"},"geometry":{"type":"Polygon","coordinates":[[[-122.299416,37.891816],[-122.298929,37.890275],[-122.299051,37.890264],[-122.299148,37.890569],[-122.299442,37.891486],[-122.29954,37.891792],[-122.299416,37.891816]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3012","GEOID10":"060014202003012","NAME10":"Block 3012","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":636,"AWATER10":0,"INTPTLAT10":"+37.892051","INTPTLON10":"-122.299561"},"geometry":{"type":"Polygon","coordinates":[[[-122.299706,37.892285],[-122.299584,37.892313],[-122.299416,37.891816],[-122.29954,37.891792],[-122.299573,37.89189],[-122.299672,37.892186],[-122.299706,37.892285]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"1000","GEOID10":"060014203001000","NAME10":"Block 1000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16605,"AWATER10":0,"INTPTLAT10":"+37.895003","INTPTLON10":"-122.301039","population":42},"geometry":{"type":"Polygon","coordinates":[[[-122.300593,37.895043],[-122.300538,37.894865],[-122.300374,37.894333],[-122.30032,37.894156],[-122.300487,37.89412],[-122.300989,37.894014],[-122.301157,37.893979],[-122.30128,37.89435],[-122.301651,37.895463],[-122.301775,37.895834],[-122.3016,37.895871],[-122.301077,37.895981],[-122.300903,37.896019],[-122.300841,37.895823],[-122.300655,37.895238],[-122.300593,37.895043]]]}}
@@ -102,10 +102,10 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"1015","GEOID10":"060014203001015","NAME10":"Block 1015","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19773,"AWATER10":0,"INTPTLAT10":"+37.888859","INTPTLON10":"-122.299964","population":70},"geometry":{"type":"Polygon","coordinates":[[[-122.300752,37.889909],[-122.299902,37.890073],[-122.299766,37.889637],[-122.299319,37.888203],[-122.299171,37.887725],[-122.300045,37.88771],[-122.300752,37.889909]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"2000","GEOID10":"060014203002000","NAME10":"Block 2000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":412555,"AWATER10":0,"INTPTLAT10":"+37.894918","INTPTLON10":"-122.304889","population":1118},"geometry":{"type":"Polygon","coordinates":[[[-122.308946,37.89797],[-122.30878,37.898025],[-122.308634,37.898036],[-122.308451,37.89805],[-122.307352,37.898134],[-122.307065,37.898157],[-122.306747,37.898181],[-122.30618,37.898225],[-122.306,37.898264],[-122.30546,37.898385],[-122.305336,37.898413],[-122.30528,37.898425],[-122.305184,37.898425],[-122.304896,37.898425],[-122.304801,37.898425],[-122.304756,37.898425],[-122.304629,37.898425],[-122.304624,37.898425],[-122.30458,37.898425],[-122.30438,37.898445],[-122.30378,37.898505],[-122.30371,37.898512],[-122.30358,37.898525],[-122.303513,37.898525],[-122.303314,37.898525],[-122.303248,37.898525],[-122.303194,37.898525],[-122.303033,37.898525],[-122.30298,37.898525],[-122.30282,37.898525],[-122.30234,37.898525],[-122.30218,37.898525],[-122.302095,37.898525],[-122.301841,37.898525],[-122.301757,37.898525],[-122.301625,37.898525],[-122.301572,37.898423],[-122.301527,37.898252],[-122.301503,37.898162],[-122.30121,37.897048],[-122.301114,37.896678],[-122.301071,37.896546],[-122.300945,37.89615],[-122.300903,37.896019],[-122.301077,37.895981],[-122.3016,37.895871],[-122.301775,37.895834],[-122.301939,37.895799],[-122.302434,37.895697],[-122.302599,37.895664],[-122.302481,37.895293],[-122.302127,37.894182],[-122.30201,37.893812],[-122.302175,37.893776],[-122.302673,37.893671],[-122.30284,37.893637],[-122.302889,37.893812],[-122.303039,37.894337],[-122.303089,37.894513],[-122.303117,37.894247],[-122.303106,37.894159],[-122.303093,37.89404],[-122.303084,37.893855],[-122.3031,37.893715],[-122.303128,37.893528],[-122.303181,37.893366],[-122.303254,37.893216],[-122.303298,37.893132],[-122.303335,37.893065],[-122.303492,37.892834],[-122.30341,37.892587],[-122.303167,37.891846],[-122.303086,37.891599],[-122.303167,37.891344],[-122.303231,37.891145],[-122.303317,37.890839],[-122.303426,37.890586],[-122.303452,37.890527],[-122.303489,37.890457],[-122.30355,37.890349],[-122.303608,37.890289],[-122.303731,37.89018],[-122.303748,37.890166],[-122.303899,37.890065],[-122.303948,37.890041],[-122.304141,37.889968],[-122.304412,37.889904],[-122.304574,37.889878],[-122.304658,37.889874],[-122.304928,37.889814],[-122.30574,37.889635],[-122.306013,37.889587],[-122.306058,37.889717],[-122.306123,37.889905],[-122.306193,37.89011],[-122.306238,37.890241],[-122.30627,37.890353],[-122.306369,37.89069],[-122.306402,37.890803],[-122.306688,37.891695],[-122.30671,37.891848],[-122.306693,37.891995],[-122.306661,37.892132],[-122.306645,37.892217],[-122.306636,37.892274],[-122.306634,37.89229],[-122.306624,37.892398],[-122.306639,37.892531],[-122.306669,37.892657],[-122.306745,37.892813],[-122.306895,37.893102],[-122.307218,37.893753],[-122.307868,37.89533],[-122.308155,37.896034],[-122.308363,37.896551],[-122.308476,37.896829],[-122.308584,37.897145],[-122.308915,37.897902],[-122.308946,37.89797]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3000","GEOID10":"060014203003000","NAME10":"Block 3000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":27350,"AWATER10":0,"INTPTLAT10":"+37.890773","INTPTLON10":"-122.306765"},"geometry":{"type":"Polygon","coordinates":[[[-122.306645,37.892217],[-122.306661,37.892132],[-122.306693,37.891995],[-122.30671,37.891848],[-122.306688,37.891695],[-122.306402,37.890803],[-122.306645,37.890753],[-122.306699,37.890733],[-122.306734,37.890722],[-122.306801,37.890682],[-122.306872,37.890585],[-122.307209,37.88999],[-122.307235,37.889945],[-122.307392,37.889746],[-122.307248,37.890123],[-122.307198,37.890282],[-122.307168,37.89038],[-122.307108,37.890625],[-122.307063,37.890866],[-122.307023,37.891219],[-122.307004,37.891586],[-122.307012,37.891922],[-122.307017,37.891973],[-122.307048,37.892278],[-122.307084,37.89254],[-122.307125,37.892734],[-122.307171,37.892889],[-122.307215,37.893037],[-122.307344,37.893366],[-122.307532,37.893809],[-122.307566,37.893897],[-122.307652,37.894118],[-122.307699,37.894233],[-122.308022,37.894958],[-122.308817,37.896731],[-122.308994,37.897137],[-122.309278,37.897782],[-122.309315,37.897867],[-122.30926,37.89788],[-122.309184,37.8979],[-122.309148,37.897908],[-122.30908,37.897925],[-122.309042,37.897937],[-122.309008,37.897949],[-122.308946,37.89797],[-122.308915,37.897902],[-122.308584,37.897145],[-122.308476,37.896829],[-122.308363,37.896551],[-122.308155,37.896034],[-122.307868,37.89533],[-122.307218,37.893753],[-122.306895,37.893102],[-122.306745,37.892813],[-122.306669,37.892657],[-122.306639,37.892531],[-122.306624,37.892398],[-122.306634,37.89229],[-122.306636,37.892274],[-122.306645,37.892217]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3001","GEOID10":"060014203003001","NAME10":"Block 3001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":24651,"AWATER10":0,"INTPTLAT10":"+37.892198","INTPTLON10":"-122.307551"},"geometry":{"type":"Polygon","coordinates":[[[-122.308278,37.895224],[-122.308486,37.895736],[-122.30881,37.896534],[-122.309021,37.897067],[-122.309105,37.897276],[-122.309311,37.89779],[-122.309339,37.89786],[-122.309315,37.897867],[-122.309278,37.897782],[-122.308994,37.897137],[-122.308817,37.896731],[-122.308022,37.894958],[-122.307699,37.894233],[-122.307652,37.894118],[-122.307566,37.893897],[-122.307532,37.893809],[-122.307344,37.893366],[-122.307215,37.893037],[-122.307171,37.892889],[-122.307125,37.892734],[-122.307084,37.89254],[-122.307048,37.892278],[-122.307017,37.891973],[-122.307012,37.891922],[-122.307004,37.891586],[-122.307023,37.891219],[-122.307063,37.890866],[-122.307108,37.890625],[-122.307168,37.89038],[-122.307198,37.890282],[-122.307248,37.890123],[-122.307392,37.889746],[-122.307401,37.889726],[-122.30743,37.889668],[-122.30744,37.889649],[-122.307457,37.889617],[-122.307508,37.889523],[-122.307526,37.889492],[-122.307599,37.889787],[-122.307818,37.890672],[-122.307892,37.890968],[-122.307799,37.891168],[-122.307748,37.891325],[-122.307655,37.89166],[-122.307626,37.89181],[-122.307602,37.891942],[-122.307553,37.892239],[-122.307526,37.892606],[-122.307533,37.892786],[-122.307561,37.893117],[-122.307582,37.893282],[-122.307691,37.893709],[-122.307773,37.893973],[-122.307946,37.894401],[-122.308278,37.895224]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3002","GEOID10":"060014203003002","NAME10":"Block 3002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":9773,"AWATER10":0,"INTPTLAT10":"+37.892031","INTPTLON10":"-122.307713"},"geometry":{"type":"Polygon","coordinates":[[[-122.307892,37.890968],[-122.307962,37.891208],[-122.30808,37.891615],[-122.308169,37.891932],[-122.308207,37.892067],[-122.308225,37.892177],[-122.308097,37.892154],[-122.30802,37.892156],[-122.307942,37.89218],[-122.307883,37.892218],[-122.307848,37.892279],[-122.307835,37.892371],[-122.307831,37.892454],[-122.307823,37.892534],[-122.3078,37.892781],[-122.307805,37.893022],[-122.307824,37.893232],[-122.30787,37.89364],[-122.307952,37.89401],[-122.308104,37.894559],[-122.308117,37.894606],[-122.308278,37.895224],[-122.307946,37.894401],[-122.307773,37.893973],[-122.307691,37.893709],[-122.307582,37.893282],[-122.307561,37.893117],[-122.307533,37.892786],[-122.307526,37.892606],[-122.307553,37.892239],[-122.307602,37.891942],[-122.307626,37.89181],[-122.307655,37.89166],[-122.307748,37.891325],[-122.307799,37.891168],[-122.307892,37.890968]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3003","GEOID10":"060014203003003","NAME10":"Block 3003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18792,"AWATER10":0,"INTPTLAT10":"+37.894669","INTPTLON10":"-122.308429"},"geometry":{"type":"Polygon","coordinates":[[[-122.309311,37.89779],[-122.309105,37.897276],[-122.309021,37.897067],[-122.30881,37.896534],[-122.308486,37.895736],[-122.308278,37.895224],[-122.308117,37.894606],[-122.308104,37.894559],[-122.307952,37.89401],[-122.30787,37.89364],[-122.307824,37.893232],[-122.307805,37.893022],[-122.3078,37.892781],[-122.307823,37.892534],[-122.307831,37.892454],[-122.307835,37.892371],[-122.307848,37.892279],[-122.307883,37.892218],[-122.307942,37.89218],[-122.30802,37.892156],[-122.308097,37.892154],[-122.308225,37.892177],[-122.308244,37.892297],[-122.308261,37.892455],[-122.308307,37.893167],[-122.308297,37.893346],[-122.308277,37.893764],[-122.308329,37.894318],[-122.308344,37.894409],[-122.308662,37.895298],[-122.309066,37.896481],[-122.309159,37.896725],[-122.309336,37.89719],[-122.309376,37.897308],[-122.309411,37.897469],[-122.309502,37.897789],[-122.309512,37.897825],[-122.309491,37.897825],[-122.309481,37.897825],[-122.309457,37.897831],[-122.309339,37.89786],[-122.309311,37.89779]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3004","GEOID10":"060014203003004","NAME10":"Block 3004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":59347,"AWATER10":0,"INTPTLAT10":"+37.895581","INTPTLON10":"-122.309453"},"geometry":{"type":"Polygon","coordinates":[[[-122.309376,37.897308],[-122.309336,37.89719],[-122.309159,37.896725],[-122.309066,37.896481],[-122.308662,37.895298],[-122.308344,37.894409],[-122.308329,37.894318],[-122.308277,37.893764],[-122.308297,37.893346],[-122.308307,37.893167],[-122.308261,37.892455],[-122.308244,37.892297],[-122.308225,37.892177],[-122.308207,37.892067],[-122.308169,37.891932],[-122.30808,37.891615],[-122.307962,37.891208],[-122.307892,37.890968],[-122.307927,37.890892],[-122.308033,37.890667],[-122.308069,37.890592],[-122.308211,37.891226],[-122.308372,37.891856],[-122.308438,37.892134],[-122.308495,37.892366],[-122.308649,37.892921],[-122.308903,37.893714],[-122.308987,37.89392],[-122.309086,37.894158],[-122.30927,37.894558],[-122.309462,37.8949],[-122.30958,37.895102],[-122.309727,37.89534],[-122.309925,37.895651],[-122.310267,37.896113],[-122.310484,37.896381],[-122.310534,37.896442],[-122.311026,37.897062],[-122.311236,37.897331],[-122.311468,37.897629],[-122.311134,37.89774],[-122.310881,37.897825],[-122.309965,37.897825],[-122.309571,37.897825],[-122.309512,37.897825],[-122.309502,37.897789],[-122.309411,37.897469],[-122.309376,37.897308]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3001","GEOID10":"060014203003001","NAME10":"Block 3001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":24651,"AWATER10":0,"INTPTLAT10":"+37.892198","INTPTLON10":"-122.307551"},"geometry":{"type":"Polygon","coordinates":[[[-122.308278,37.895224],[-122.308486,37.895736],[-122.30881,37.896534],[-122.309021,37.897067],[-122.309105,37.897276],[-122.309311,37.89779],[-122.309339,37.89786],[-122.309315,37.897867],[-122.309278,37.897782],[-122.308994,37.897137],[-122.308817,37.896731],[-122.308022,37.894958],[-122.307699,37.894233],[-122.307652,37.894118],[-122.307566,37.893897],[-122.307532,37.893809],[-122.307344,37.893366],[-122.307215,37.893037],[-122.307171,37.892889],[-122.307125,37.892734],[-122.307084,37.89254],[-122.307048,37.892278],[-122.307017,37.891973],[-122.307012,37.891922],[-122.307004,37.891586],[-122.307023,37.891219],[-122.307063,37.890866],[-122.307108,37.890625],[-122.307168,37.89038],[-122.307198,37.890282],[-122.307248,37.890123],[-122.307392,37.889746],[-122.307401,37.889726],[-122.30743,37.889668],[-122.30744,37.889649],[-122.307457,37.889617],[-122.307508,37.889523],[-122.307526,37.889492],[-122.307599,37.889787],[-122.307818,37.890672],[-122.307892,37.890968],[-122.307799,37.891168],[-122.307748,37.891325],[-122.307655,37.89166],[-122.307626,37.89181],[-122.307602,37.891942],[-122.307553,37.892238999999999],[-122.307526,37.892606],[-122.307533,37.892786],[-122.307561,37.893117],[-122.307582,37.893282],[-122.307691,37.893709],[-122.307773,37.893973],[-122.307946,37.894401],[-122.308278,37.895224]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3002","GEOID10":"060014203003002","NAME10":"Block 3002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":9773,"AWATER10":0,"INTPTLAT10":"+37.892031","INTPTLON10":"-122.307713"},"geometry":{"type":"Polygon","coordinates":[[[-122.307892,37.890968],[-122.307962,37.891208],[-122.30808,37.891615],[-122.308169,37.891932],[-122.308207,37.892067],[-122.308225,37.892177],[-122.308097,37.892154],[-122.30802,37.892156],[-122.307942,37.89218],[-122.307883,37.892218],[-122.307848,37.892279],[-122.307835,37.892371],[-122.307831,37.892454],[-122.307823,37.892534],[-122.3078,37.892781],[-122.307805,37.893022],[-122.307824,37.893232],[-122.30787,37.89364],[-122.307952,37.89401],[-122.308104,37.894559],[-122.308117,37.894606],[-122.308278,37.895224],[-122.307946,37.894401],[-122.307773,37.893973],[-122.307691,37.893709],[-122.307582,37.893282],[-122.307561,37.893117],[-122.307533,37.892786],[-122.307526,37.892606],[-122.307553,37.892238999999999],[-122.307602,37.891942],[-122.307626,37.89181],[-122.307655,37.89166],[-122.307748,37.891325],[-122.307799,37.891168],[-122.307892,37.890968]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3003","GEOID10":"060014203003003","NAME10":"Block 3003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18792,"AWATER10":0,"INTPTLAT10":"+37.894669","INTPTLON10":"-122.308429"},"geometry":{"type":"Polygon","coordinates":[[[-122.309311,37.89779],[-122.309105,37.897276],[-122.309021,37.897067],[-122.30881,37.896534],[-122.308486,37.895736],[-122.308278,37.895224],[-122.308117,37.894606],[-122.308104,37.894559],[-122.307952,37.89401],[-122.30787,37.89364],[-122.307824,37.893232],[-122.307805,37.893022],[-122.3078,37.892781],[-122.307823,37.892534],[-122.307831,37.892454],[-122.307835,37.892371],[-122.307848,37.892279],[-122.307883,37.892218],[-122.307942,37.89218],[-122.30802,37.892156],[-122.308097,37.892154],[-122.308225,37.892177],[-122.308244,37.892297],[-122.308261,37.892455],[-122.308307,37.893167],[-122.308297,37.893346],[-122.308277,37.893764],[-122.308329,37.894318],[-122.308344,37.894409],[-122.308662,37.895298],[-122.309066,37.896481],[-122.309159,37.896725000000007],[-122.309336,37.89719],[-122.309376,37.897308],[-122.309411,37.897469],[-122.309502,37.897789],[-122.309512,37.897825],[-122.309491,37.897825],[-122.309481,37.897825],[-122.309457,37.897831],[-122.309339,37.89786],[-122.309311,37.89779]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3004","GEOID10":"060014203003004","NAME10":"Block 3004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":59347,"AWATER10":0,"INTPTLAT10":"+37.895581","INTPTLON10":"-122.309453"},"geometry":{"type":"Polygon","coordinates":[[[-122.309376,37.897308],[-122.309336,37.89719],[-122.309159,37.896725000000007],[-122.309066,37.896481],[-122.308662,37.895298],[-122.308344,37.894409],[-122.308329,37.894318],[-122.308277,37.893764],[-122.308297,37.893346],[-122.308307,37.893167],[-122.308261,37.892455],[-122.308244,37.892297],[-122.308225,37.892177],[-122.308207,37.892067],[-122.308169,37.891932],[-122.30808,37.891615],[-122.307962,37.891208],[-122.307892,37.890968],[-122.307927,37.890892],[-122.308033,37.890667],[-122.308069,37.890592],[-122.308211,37.891226],[-122.308372,37.891856],[-122.308438,37.892134],[-122.308495,37.892366],[-122.308649,37.892921],[-122.308903,37.893714],[-122.308987,37.89392],[-122.309086,37.894158],[-122.30927,37.894558],[-122.309462,37.8949],[-122.30958,37.895102],[-122.309727,37.89534],[-122.309925,37.895651],[-122.310267,37.896113],[-122.310484,37.896381],[-122.310534,37.896442],[-122.311026,37.897062],[-122.311236,37.897331],[-122.311468,37.897629],[-122.311134,37.89774],[-122.310881,37.897825],[-122.309965,37.897825],[-122.309571,37.897825],[-122.309512,37.897825],[-122.309502,37.897789],[-122.309411,37.897469],[-122.309376,37.897308]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3005","GEOID10":"060014203003005","NAME10":"Block 3005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":30820,"AWATER10":0,"INTPTLAT10":"+37.891015","INTPTLON10":"-122.308540"},"geometry":{"type":"Polygon","coordinates":[[[-122.308069,37.890592],[-122.308123,37.890487],[-122.308286,37.890175],[-122.308341,37.890071],[-122.30839,37.890315],[-122.308405,37.890387],[-122.308495,37.890723],[-122.30857,37.891042],[-122.308628,37.891285],[-122.308707,37.891602],[-122.308766,37.891836],[-122.308965,37.892548],[-122.309054,37.892863],[-122.309128,37.893126],[-122.309284,37.893557],[-122.309414,37.893875],[-122.309421,37.893891],[-122.309529,37.894133],[-122.309682,37.894452],[-122.309874,37.894805],[-122.310186,37.895308],[-122.310342,37.895535],[-122.310502,37.895789],[-122.310635,37.895983],[-122.310941,37.896401],[-122.311153,37.896666],[-122.311388,37.89696],[-122.311568,37.897186],[-122.311622,37.897255],[-122.311826,37.897491],[-122.311845,37.897514],[-122.31181,37.89752],[-122.311781,37.897525],[-122.311583,37.89759],[-122.311508,37.897616],[-122.311468,37.897629],[-122.311236,37.897331],[-122.311026,37.897062],[-122.310534,37.896442],[-122.310484,37.896381],[-122.310267,37.896113],[-122.309925,37.895651],[-122.309727,37.89534],[-122.30958,37.895102],[-122.309462,37.8949],[-122.30927,37.894558],[-122.309086,37.894158],[-122.308987,37.89392],[-122.308903,37.893714],[-122.308649,37.892921],[-122.308495,37.892366],[-122.308438,37.892134],[-122.308372,37.891856],[-122.308211,37.891226],[-122.308069,37.890592]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3006","GEOID10":"060014203003006","NAME10":"Block 3006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19563,"AWATER10":24,"INTPTLAT10":"+37.890405","INTPTLON10":"-122.308694"},"geometry":{"type":"Polygon","coordinates":[[[-122.311538,37.896806],[-122.311565,37.896838],[-122.311758,37.897088],[-122.312009,37.897413],[-122.312063,37.897478],[-122.312004,37.897487],[-122.311889,37.897507],[-122.311845,37.897514],[-122.311826,37.897491],[-122.311622,37.897255],[-122.311568,37.897186],[-122.311388,37.89696],[-122.311153,37.896666],[-122.310941,37.896401],[-122.310635,37.895983],[-122.310502,37.895789],[-122.310342,37.895535],[-122.310186,37.895308],[-122.309874,37.894805],[-122.309682,37.894452],[-122.309529,37.894133],[-122.309421,37.893891],[-122.309414,37.893875],[-122.309284,37.893557],[-122.309128,37.893126],[-122.309054,37.892863],[-122.308965,37.892548],[-122.308766,37.891836],[-122.308707,37.891602],[-122.308628,37.891285],[-122.30857,37.891042],[-122.308495,37.890723],[-122.308405,37.890387],[-122.30839,37.890315],[-122.308341,37.890071],[-122.30847,37.889804],[-122.308738,37.889253],[-122.308805,37.88913],[-122.308964,37.888766],[-122.308925,37.88939],[-122.308887,37.890063],[-122.30888,37.890482],[-122.308925,37.890958],[-122.308979,37.891237],[-122.308948,37.891714],[-122.30899,37.892061],[-122.309093,37.892584],[-122.309151,37.892825],[-122.309223,37.893051],[-122.309413,37.893595],[-122.309515,37.893845],[-122.309641,37.894105],[-122.309978,37.894761],[-122.31028,37.895227],[-122.310482,37.895512],[-122.310654,37.895738],[-122.311505,37.896707],[-122.311591,37.896819],[-122.311538,37.896806]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3007","GEOID10":"060014203003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":3648,"AWATER10":0,"INTPTLAT10":"+37.897139","INTPTLON10":"-122.312126"},"geometry":{"type":"Polygon","coordinates":[[[-122.311565,37.896838],[-122.311538,37.896806],[-122.311591,37.896819],[-122.311959,37.8969],[-122.31214,37.896928],[-122.312424,37.896928],[-122.312521,37.89701],[-122.312542,37.89712],[-122.312466,37.897411],[-122.31235,37.89743],[-122.312171,37.89746],[-122.312063,37.897478],[-122.312009,37.897413],[-122.311758,37.897088],[-122.311565,37.896838]]]}}
@@ -159,7 +159,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1002","GEOID10":"060014205001002","NAME10":"Block 1002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":411,"AWATER10":0,"INTPTLAT10":"+37.890411","INTPTLON10":"-122.295818"},"geometry":{"type":"Polygon","coordinates":[[[-122.296247,37.890355],[-122.296262,37.890403],[-122.296087,37.890415],[-122.295564,37.890454],[-122.29539,37.890468],[-122.295376,37.89042],[-122.296247,37.890355]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1003","GEOID10":"060014205001003","NAME10":"Block 1003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":422,"AWATER10":0,"INTPTLAT10":"+37.890358","INTPTLON10":"-122.296696"},"geometry":{"type":"Polygon","coordinates":[[[-122.296247,37.890355],[-122.297123,37.890313],[-122.297139,37.890363],[-122.296963,37.890371],[-122.296437,37.890394],[-122.296262,37.890403],[-122.296247,37.890355]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1004","GEOID10":"060014205001004","NAME10":"Block 1004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":521,"AWATER10":0,"INTPTLAT10":"+37.890309","INTPTLON10":"-122.297598"},"geometry":{"type":"Polygon","coordinates":[[[-122.297123,37.890313],[-122.298005,37.890249],[-122.298027,37.890319],[-122.297849,37.890327],[-122.297316,37.890353],[-122.297139,37.890363],[-122.297123,37.890313]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1005","GEOID10":"060014205001005","NAME10":"Block 1005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":627,"AWATER10":0,"INTPTLAT10":"+37.890267","INTPTLON10":"-122.298466"},"geometry":{"type":"Polygon","coordinates":[[[-122.298027,37.890319],[-122.298005,37.890249],[-122.298509,37.890232],[-122.29891,37.890211],[-122.298929,37.890275],[-122.298846,37.890282],[-122.298724,37.890294],[-122.298514,37.890304],[-122.298232,37.890312],[-122.298027,37.890319]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1005","GEOID10":"060014205001005","NAME10":"Block 1005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":627,"AWATER10":0,"INTPTLAT10":"+37.890267","INTPTLON10":"-122.298466"},"geometry":{"type":"Polygon","coordinates":[[[-122.298027,37.890319],[-122.298005,37.890249],[-122.298509,37.890232],[-122.29891,37.890211],[-122.298929,37.890275],[-122.298846,37.890282],[-122.29872400000001,37.890294],[-122.298514,37.890304],[-122.298232,37.890312],[-122.298027,37.890319]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1006","GEOID10":"060014205001006","NAME10":"Block 1006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":25175,"AWATER10":0,"INTPTLAT10":"+37.889049","INTPTLON10":"-122.293592","population":49},"geometry":{"type":"Polygon","coordinates":[[[-122.29271,37.887727],[-122.292685,37.887655],[-122.29358,37.887625],[-122.293557,37.887489],[-122.29358,37.887559],[-122.293747,37.888094],[-122.294314,37.889913],[-122.294488,37.890471],[-122.294221,37.890483],[-122.29387,37.890502],[-122.293699,37.890506],[-122.293619,37.890403],[-122.293543,37.890307],[-122.293411,37.889872],[-122.293263,37.889429],[-122.293047,37.888782],[-122.292828,37.888098],[-122.29271,37.887727]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1007","GEOID10":"060014205001007","NAME10":"Block 1007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":32096,"AWATER10":0,"INTPTLAT10":"+37.888458","INTPTLON10":"-122.297915","population":70},"geometry":{"type":"Polygon","coordinates":[[[-122.297787,37.886735],[-122.297764,37.886665],[-122.297909,37.886679],[-122.297934,37.886756],[-122.298249,37.887758],[-122.298127,37.887769],[-122.29891,37.890211],[-122.298509,37.890232],[-122.298005,37.890249],[-122.297803,37.889617],[-122.297131,37.887512],[-122.296929,37.886878],[-122.297533,37.886751],[-122.297787,37.886735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1008","GEOID10":"060014205001008","NAME10":"Block 1008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":3061,"AWATER10":0,"INTPTLAT10":"+37.889016","INTPTLON10":"-122.298589"},"geometry":{"type":"Polygon","coordinates":[[[-122.298127,37.887769],[-122.298249,37.887758],[-122.298409,37.888259],[-122.298891,37.889762],[-122.299031,37.890196],[-122.299051,37.890264],[-122.298929,37.890275],[-122.29891,37.890211],[-122.298127,37.887769]]]}}
@@ -212,7 +212,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1020","GEOID10":"060014206001020","NAME10":"Block 1020","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":979,"AWATER10":0,"INTPTLAT10":"+37.883465","INTPTLON10":"-122.286818"},"geometry":{"type":"Polygon","coordinates":[[[-122.286667,37.883996],[-122.286575,37.883979],[-122.286937,37.883026],[-122.286955,37.882968],[-122.28707,37.882903],[-122.287024,37.883045],[-122.286994,37.883123],[-122.286748,37.883777],[-122.286667,37.883996]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1021","GEOID10":"060014206001021","NAME10":"Block 1021","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18586,"AWATER10":0,"INTPTLAT10":"+37.883462","INTPTLON10":"-122.287583","population":45},"geometry":{"type":"Polygon","coordinates":[[[-122.28707,37.882903],[-122.287096,37.882839],[-122.287175,37.88265],[-122.287202,37.882587],[-122.287302,37.882625],[-122.287602,37.882742],[-122.287702,37.882781],[-122.287934,37.882871],[-122.288512,37.883048],[-122.28805,37.884241],[-122.287809,37.884167],[-122.287601,37.884127],[-122.287462,37.88412],[-122.287183,37.884096],[-122.286667,37.883996],[-122.286748,37.883777],[-122.286994,37.883123],[-122.287024,37.883045],[-122.28707,37.882903]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1022","GEOID10":"060014206001022","NAME10":"Block 1022","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":12213,"AWATER10":0,"INTPTLAT10":"+37.883875","INTPTLON10":"-122.288628","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.287957,37.884501],[-122.28805,37.884241],[-122.288512,37.883048],[-122.288939,37.883179],[-122.289309,37.883284],[-122.28875,37.88468],[-122.287957,37.884501]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1023","GEOID10":"060014206001023","NAME10":"Block 1023","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15260,"AWATER10":0,"INTPTLAT10":"+37.884009","INTPTLON10":"-122.289530","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.290105,37.883155],[-122.290113,37.883156],[-122.290207,37.883163],[-122.290252,37.883174],[-122.29028,37.883025],[-122.290231,37.883308],[-122.290151,37.883572],[-122.289845,37.884492],[-122.289712,37.884893],[-122.289608,37.884874],[-122.289518,37.884853],[-122.288942,37.884723],[-122.28875,37.88468],[-122.289309,37.883284],[-122.289348,37.883295],[-122.28951,37.88326],[-122.289555,37.883251],[-122.289757,37.883179],[-122.289964,37.883146],[-122.290105,37.883155]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1023","GEOID10":"060014206001023","NAME10":"Block 1023","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15260,"AWATER10":0,"INTPTLAT10":"+37.884009","INTPTLON10":"-122.289530","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.290105,37.883155],[-122.290113,37.883156],[-122.290207,37.883163],[-122.290252,37.883174],[-122.29028,37.883025],[-122.290231,37.883308],[-122.290151,37.883572],[-122.289845,37.884492],[-122.289712,37.884893],[-122.289608,37.884874],[-122.289518,37.884853],[-122.288942,37.884723],[-122.28875,37.88468],[-122.289309,37.883284],[-122.289348,37.883295],[-122.28951,37.88326],[-122.28955499999999,37.883251],[-122.289757,37.883179],[-122.289964,37.883146],[-122.290105,37.883155]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1024","GEOID10":"060014206001024","NAME10":"Block 1024","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1201,"AWATER10":0,"INTPTLAT10":"+37.883224","INTPTLON10":"-122.286366","population":1},"geometry":{"type":"Polygon","coordinates":[[[-122.28707,37.882903],[-122.286955,37.882968],[-122.286792,37.883051],[-122.28595,37.883483],[-122.28567,37.883627],[-122.285686,37.883532],[-122.286997,37.882851],[-122.28707,37.882903]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1025","GEOID10":"060014206001025","NAME10":"Block 1025","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1018,"AWATER10":0,"INTPTLAT10":"+37.883871","INTPTLON10":"-122.285076"},"geometry":{"type":"Polygon","coordinates":[[[-122.284459,37.884129],[-122.285686,37.883532],[-122.28567,37.883627],[-122.285434,37.883741],[-122.284726,37.884086],[-122.284491,37.884201],[-122.284477,37.88416],[-122.284459,37.884129]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1026","GEOID10":"060014206001026","NAME10":"Block 1026","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":63728,"AWATER10":0,"INTPTLAT10":"+37.883493","INTPTLON10":"-122.283797","population":17},"geometry":{"type":"Polygon","coordinates":[[[-122.282764,37.882526],[-122.28279,37.882502],[-122.283012,37.882518],[-122.283671,37.882491],[-122.283757,37.882491],[-122.284107,37.882491],[-122.284953,37.882469],[-122.285078,37.88246],[-122.285271,37.882445],[-122.285376,37.882437],[-122.285853,37.88244],[-122.286048,37.882442],[-122.28596,37.882675],[-122.28583,37.883024],[-122.285729,37.883314],[-122.285715,37.883381],[-122.285686,37.883532],[-122.284459,37.884129],[-122.284156,37.884287],[-122.283797,37.884463],[-122.28334,37.884663],[-122.283126,37.884745],[-122.282866,37.884831],[-122.282557,37.884921],[-122.282408,37.884954],[-122.28226,37.884974],[-122.282104,37.884982],[-122.281994,37.884974],[-122.282288,37.884363],[-122.281902,37.884371],[-122.282009,37.884176],[-122.282569,37.882718],[-122.282764,37.882526]]]}}
@@ -224,7 +224,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2000","GEOID10":"060014206002000","NAME10":"Block 2000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":375,"AWATER10":0,"INTPTLAT10":"+37.890952","INTPTLON10":"-122.286179"},"geometry":{"type":"Polygon","coordinates":[[[-122.286644,37.890897],[-122.286648,37.89094],[-122.286458,37.890953],[-122.28589,37.890992],[-122.285701,37.891006],[-122.285677,37.89097],[-122.286644,37.890897]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2001","GEOID10":"060014206002001","NAME10":"Block 2001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14791,"AWATER10":0,"INTPTLAT10":"+37.890209","INTPTLON10":"-122.285901","population":18},"geometry":{"type":"Polygon","coordinates":[[[-122.286644,37.890897],[-122.285677,37.89097],[-122.285601,37.890875],[-122.285573,37.890832],[-122.285555,37.890791],[-122.285532,37.890718],[-122.285239,37.889751],[-122.285164,37.889502],[-122.285376,37.889508],[-122.285594,37.889494],[-122.285989,37.889444],[-122.286149,37.889409],[-122.286233,37.889659],[-122.286558,37.890616],[-122.286628,37.890823],[-122.286644,37.890897]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2002","GEOID10":"060014206002002","NAME10":"Block 2002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16691,"AWATER10":0,"INTPTLAT10":"+37.890058","INTPTLON10":"-122.286913","population":13},"geometry":{"type":"Polygon","coordinates":[[[-122.287518,37.890839],[-122.287159,37.890866],[-122.286644,37.890897],[-122.286628,37.890823],[-122.286558,37.890616],[-122.286233,37.889659],[-122.286149,37.889409],[-122.28645,37.889328],[-122.286696,37.889232],[-122.287095,37.889068],[-122.287194,37.889372],[-122.287397,37.889987],[-122.287574,37.890498],[-122.28769,37.890831],[-122.287706,37.890872],[-122.287668,37.890874],[-122.287553,37.890879],[-122.287516,37.890882],[-122.287518,37.890839]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2003","GEOID10":"060014206002003","NAME10":"Block 2003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":446,"AWATER10":0,"INTPTLAT10":"+37.890820","INTPTLON10":"-122.288237"},"geometry":{"type":"Polygon","coordinates":[[[-122.28769,37.890831],[-122.288768,37.890769],[-122.28877,37.890812],[-122.288767,37.890813],[-122.288618,37.890821],[-122.287934,37.890859],[-122.287706,37.890872],[-122.28769,37.890831]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2003","GEOID10":"060014206002003","NAME10":"Block 2003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":446,"AWATER10":0,"INTPTLAT10":"+37.890820","INTPTLON10":"-122.288237"},"geometry":{"type":"Polygon","coordinates":[[[-122.28769,37.890831],[-122.288768,37.890769],[-122.28877,37.890812],[-122.28876700000001,37.890813],[-122.288618,37.890821],[-122.287934,37.890859],[-122.287706,37.890872],[-122.28769,37.890831]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2004","GEOID10":"060014206002004","NAME10":"Block 2004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1970,"AWATER10":0,"INTPTLAT10":"+37.889680","INTPTLON10":"-122.288473"},"geometry":{"type":"Polygon","coordinates":[[[-122.28877,37.890812],[-122.288768,37.890769],[-122.288766,37.890714],[-122.288758,37.890664],[-122.288152,37.888874],[-122.288121,37.888768],[-122.288106,37.888677],[-122.288151,37.888594],[-122.288284,37.888561],[-122.288227,37.888644],[-122.288214,37.888732],[-122.288228,37.888845],[-122.288283,37.889006],[-122.288744,37.89035],[-122.288815,37.890556],[-122.288843,37.890672],[-122.288852,37.890762],[-122.288847,37.890809],[-122.28877,37.890812]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2005","GEOID10":"060014206002005","NAME10":"Block 2005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":21301,"AWATER10":0,"INTPTLAT10":"+37.889828","INTPTLON10":"-122.287926","population":54},"geometry":{"type":"Polygon","coordinates":[[[-122.28769,37.890831],[-122.287574,37.890498],[-122.287397,37.889987],[-122.287194,37.889372],[-122.287095,37.889068],[-122.287377,37.888939],[-122.287639,37.888837],[-122.288106,37.888677],[-122.288121,37.888768],[-122.288152,37.888874],[-122.288758,37.890664],[-122.288766,37.890714],[-122.288768,37.890769],[-122.28769,37.890831]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2006","GEOID10":"060014206002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":812,"AWATER10":0,"INTPTLAT10":"+37.888823","INTPTLON10":"-122.287591"},"geometry":{"type":"Polygon","coordinates":[[[-122.288151,37.888594],[-122.288106,37.888677],[-122.287639,37.888837],[-122.287377,37.888939],[-122.287095,37.889068],[-122.287071,37.888996],[-122.287305,37.888887],[-122.287338,37.888873],[-122.2876,37.888771],[-122.287865,37.888681],[-122.288035,37.888629],[-122.288151,37.888594]]]}}
@@ -2,7 +2,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1001","GEOID10":"060014201001001","NAME10":"Block 1001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":11297,"AWATER10":0,"INTPTLAT10":"+37.897321","INTPTLON10":"-122.291217","population":21},"geometry":{"type":"Polygon","coordinates":[[[-122.290726,37.897886],[-122.29074,37.897638],[-122.290787,37.896901],[-122.290805,37.896657],[-122.290984,37.896663],[-122.291521,37.896682],[-122.291701,37.896689],[-122.291678,37.89697],[-122.291634,37.897545],[-122.291618,37.897816],[-122.291605,37.8981],[-122.291468,37.898054],[-122.291079,37.897926],[-122.290938,37.89791],[-122.290756,37.897889],[-122.290726,37.897886]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1002","GEOID10":"060014201001002","NAME10":"Block 1002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14980,"AWATER10":0,"INTPTLAT10":"+37.897482","INTPTLON10":"-122.292153","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.291605,37.8981],[-122.291618,37.897816],[-122.291634,37.897545],[-122.291678,37.89697],[-122.291701,37.896689],[-122.291893,37.896692],[-122.292469,37.896704],[-122.292661,37.896708],[-122.292651,37.896903],[-122.292624,37.89749],[-122.292615,37.897686],[-122.292632,37.897815],[-122.292655,37.897974],[-122.292657,37.898134],[-122.292647,37.898178],[-122.292648,37.898205],[-122.292649,37.898267],[-122.292653,37.89833],[-122.292655,37.898338],[-122.292526,37.898316],[-122.292346,37.898286],[-122.291979,37.898225],[-122.291911,37.898202],[-122.291815,37.89817],[-122.291644,37.898113],[-122.291605,37.8981]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1003","GEOID10":"060014201001003","NAME10":"Block 1003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1246,"AWATER10":0,"INTPTLAT10":"+37.898006","INTPTLON10":"-122.292741"},"geometry":{"type":"Polygon","coordinates":[[[-122.292828,37.898367],[-122.29271,37.898347],[-122.292655,37.898338],[-122.292653,37.89833],[-122.292649,37.898267],[-122.292648,37.898205],[-122.292647,37.898178],[-122.292657,37.898134],[-122.292655,37.897974],[-122.292632,37.897815],[-122.292615,37.897686],[-122.292837,37.897691],[-122.292846,37.897692],[-122.292828,37.898367]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1004","GEOID10":"060014201001004","NAME10":"Block 1004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":6640,"AWATER10":0,"INTPTLAT10":"+37.898096","INTPTLON10":"-122.293296","population":9},"geometry":{"type":"Polygon","coordinates":[[[-122.293661,37.898516],[-122.293684,37.898637],[-122.293656,37.898634],[-122.293579,37.898625],[-122.293547,37.898608],[-122.29345,37.89856],[-122.29342,37.898545],[-122.293253,37.898461],[-122.29318,37.898425],[-122.29283,37.898368],[-122.292828,37.898367],[-122.292846,37.897692],[-122.293505,37.897709],[-122.293728,37.897715],[-122.29372,37.897876],[-122.293697,37.898359],[-122.293696,37.898391],[-122.293661,37.898516]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1004","GEOID10":"060014201001004","NAME10":"Block 1004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":6640,"AWATER10":0,"INTPTLAT10":"+37.898096","INTPTLON10":"-122.293296","population":9},"geometry":{"type":"Polygon","coordinates":[[[-122.293661,37.898516],[-122.293684,37.898637],[-122.293656,37.898634],[-122.293579,37.898625],[-122.293547,37.898608],[-122.29345000000001,37.89856],[-122.29342,37.898545],[-122.293253,37.898461],[-122.29318,37.898425],[-122.29283,37.898368],[-122.292828,37.898367],[-122.292846,37.897692],[-122.293505,37.897709],[-122.293728,37.897715],[-122.29372,37.897876],[-122.293697,37.898359],[-122.293696,37.898391],[-122.293661,37.898516]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1005","GEOID10":"060014201001005","NAME10":"Block 1005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":8083,"AWATER10":0,"INTPTLAT10":"+37.898210","INTPTLON10":"-122.294138"},"geometry":{"type":"Polygon","coordinates":[[[-122.294554,37.898735],[-122.29448,37.898725],[-122.294359,37.898711],[-122.293774,37.898647],[-122.293684,37.898637],[-122.293661,37.898516],[-122.293696,37.898391],[-122.293697,37.898359],[-122.29372,37.897876],[-122.293728,37.897715],[-122.293898,37.89772],[-122.294408,37.897737],[-122.294579,37.897743],[-122.294573,37.897941],[-122.294558,37.898536],[-122.294555,37.898689],[-122.294554,37.898735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1006","GEOID10":"060014201001006","NAME10":"Block 1006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14453,"AWATER10":0,"INTPTLAT10":"+37.898332","INTPTLON10":"-122.295280"},"geometry":{"type":"Polygon","coordinates":[[[-122.294554,37.898735],[-122.294555,37.898689],[-122.294558,37.898536],[-122.294573,37.897941],[-122.294579,37.897743],[-122.294803,37.897747],[-122.295478,37.897759],[-122.295703,37.897763],[-122.295794,37.897999],[-122.295882,37.898223],[-122.2961,37.898695],[-122.296207,37.898925],[-122.29598,37.898925],[-122.295874,37.898911],[-122.295176,37.898818],[-122.294884,37.898779],[-122.294554,37.898735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"1007","GEOID10":"060014201001007","NAME10":"Block 1007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":17265,"AWATER10":0,"INTPTLAT10":"+37.896623","INTPTLON10":"-122.294972","population":87},"geometry":{"type":"Polygon","coordinates":[[[-122.294579,37.897743],[-122.294615,37.897096],[-122.294631,37.896828],[-122.294639,37.896549],[-122.294709,37.895468],[-122.2947,37.895378],[-122.294677,37.895296],[-122.294628,37.895169],[-122.294395,37.894565],[-122.294444,37.894555],[-122.294591,37.894529],[-122.294641,37.894521],[-122.294853,37.895169],[-122.295037,37.895732],[-122.295218,37.896312],[-122.295397,37.896857],[-122.295482,37.897117],[-122.295557,37.897346],[-122.295703,37.897763],[-122.295478,37.897759],[-122.294803,37.897747],[-122.294579,37.897743]]]}}
@@ -24,16 +24,16 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2003","GEOID10":"060014201002003","NAME10":"Block 2003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1027,"AWATER10":0,"INTPTLAT10":"+37.897345","INTPTLON10":"-122.288150"},"geometry":{"type":"Polygon","coordinates":[[[-122.288161,37.898102],[-122.288092,37.89814],[-122.288099,37.89793],[-122.28814,37.896582],[-122.288211,37.896582],[-122.2882,37.896885],[-122.28817,37.897797],[-122.288168,37.897886],[-122.288161,37.898102]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2004","GEOID10":"060014201002004","NAME10":"Block 2004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":11206,"AWATER10":0,"INTPTLAT10":"+37.897263","INTPTLON10":"-122.288602","population":16},"geometry":{"type":"Polygon","coordinates":[[[-122.288161,37.898102],[-122.288168,37.897886],[-122.28817,37.897797],[-122.2882,37.896885],[-122.288211,37.896582],[-122.288386,37.896587],[-122.288914,37.896604],[-122.28909,37.89661],[-122.28907,37.896861],[-122.289013,37.897619],[-122.289008,37.897701],[-122.288996,37.897874],[-122.288869,37.897886],[-122.28848,37.897925],[-122.288326,37.89801],[-122.288161,37.898102]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2005","GEOID10":"060014201002005","NAME10":"Block 2005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":10320,"AWATER10":0,"INTPTLAT10":"+37.897228","INTPTLON10":"-122.289472","population":17},"geometry":{"type":"Polygon","coordinates":[[[-122.288996,37.897874],[-122.289008,37.897701],[-122.289013,37.897619],[-122.28907,37.896861],[-122.28909,37.89661],[-122.289264,37.896614],[-122.289788,37.896629],[-122.289963,37.896634],[-122.289941,37.896871],[-122.289881,37.897585],[-122.289872,37.897693],[-122.289862,37.897825],[-122.289722,37.897825],[-122.28948,37.897825],[-122.289223,37.897851],[-122.289058,37.897868],[-122.288996,37.897874]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2006","GEOID10":"060014201002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15730,"AWATER10":0,"INTPTLAT10":"+37.895696","INTPTLON10":"-122.289570","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.289184,37.894754],[-122.289358,37.89476],[-122.289881,37.894779],[-122.290056,37.894786],[-122.290045,37.894895],[-122.290039,37.894995],[-122.290012,37.895525],[-122.290007,37.895625],[-122.289998,37.895835],[-122.28999,37.895994],[-122.28997,37.896474],[-122.289963,37.896634],[-122.289788,37.896629],[-122.289264,37.896614],[-122.28909,37.89661],[-122.289108,37.896238],[-122.289164,37.895125],[-122.289184,37.894754]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2006","GEOID10":"060014201002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15730,"AWATER10":0,"INTPTLAT10":"+37.895696","INTPTLON10":"-122.289570","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.289184,37.894754],[-122.28935799999999,37.89476],[-122.289881,37.894779],[-122.290056,37.894786],[-122.290045,37.894895],[-122.290039,37.894995],[-122.290012,37.895525],[-122.290007,37.895625],[-122.289998,37.895835],[-122.28999,37.895994],[-122.28997,37.896474],[-122.289963,37.896634],[-122.289788,37.896629],[-122.289264,37.896614],[-122.28909,37.89661],[-122.289108,37.896238],[-122.289164,37.895125],[-122.289184,37.894754]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2007","GEOID10":"060014201002007","NAME10":"Block 2007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15930,"AWATER10":0,"INTPTLAT10":"+37.895669","INTPTLON10":"-122.288696","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.28909,37.89661],[-122.288914,37.896604],[-122.288386,37.896587],[-122.288211,37.896582],[-122.288229,37.896212],[-122.288283,37.895104],[-122.288302,37.894735],[-122.288478,37.894738],[-122.289007,37.89475],[-122.289184,37.894754],[-122.289164,37.895125],[-122.289108,37.896238],[-122.28909,37.89661]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2008","GEOID10":"060014201002008","NAME10":"Block 2008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1214,"AWATER10":0,"INTPTLAT10":"+37.895673","INTPTLON10":"-122.288221"},"geometry":{"type":"Polygon","coordinates":[[[-122.288211,37.896582],[-122.28814,37.896582],[-122.288238,37.89473],[-122.288302,37.894735],[-122.288283,37.895104],[-122.288229,37.896212],[-122.288211,37.896582]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2009","GEOID10":"060014201002009","NAME10":"Block 2009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15974,"AWATER10":0,"INTPTLAT10":"+37.895646","INTPTLON10":"-122.287747","population":33},"geometry":{"type":"Polygon","coordinates":[[[-122.28814,37.896582],[-122.28802,37.896579],[-122.28745,37.896567],[-122.28726,37.896563],[-122.287278,37.896193],[-122.287332,37.895085],[-122.287351,37.894716],[-122.287541,37.894719],[-122.288111,37.894728],[-122.288238,37.89473],[-122.28814,37.896582]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2010","GEOID10":"060014201002010","NAME10":"Block 2010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":3628,"AWATER10":0,"INTPTLAT10":"+37.895607","INTPTLON10":"-122.287205","population":10},"geometry":{"type":"Polygon","coordinates":[[[-122.287078,37.896557],[-122.287088,37.896187],[-122.28712,37.895078],[-122.287132,37.894709],[-122.287175,37.89471],[-122.287307,37.894714],[-122.287351,37.894716],[-122.287332,37.895085],[-122.287278,37.896193],[-122.28726,37.896563],[-122.287223,37.896561],[-122.287114,37.896558],[-122.287078,37.896557]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2011","GEOID10":"060014201002011","NAME10":"Block 2011","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":4556,"AWATER10":0,"INTPTLAT10":"+37.893731","INTPTLON10":"-122.287275","population":11},"geometry":{"type":"Polygon","coordinates":[[[-122.287132,37.894709],[-122.28714,37.894329],[-122.287163,37.893189],[-122.287172,37.89281],[-122.287224,37.89281],[-122.28738,37.89281],[-122.287432,37.89281],[-122.287422,37.893191],[-122.287416,37.89345],[-122.28737,37.894334],[-122.287351,37.894716],[-122.287307,37.894714],[-122.287175,37.89471],[-122.287132,37.894709]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2012","GEOID10":"060014201002012","NAME10":"Block 2012","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16253,"AWATER10":0,"INTPTLAT10":"+37.893780","INTPTLON10":"-122.287836","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.288317,37.892856],[-122.288238,37.89473],[-122.288111,37.894728],[-122.287541,37.894719],[-122.287351,37.894716],[-122.28737,37.894334],[-122.287416,37.89345],[-122.287422,37.893191],[-122.287432,37.89281],[-122.287609,37.892825],[-122.287623,37.892825],[-122.2882,37.89285],[-122.288317,37.892856]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2013","GEOID10":"060014201002013","NAME10":"Block 2013","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1269,"AWATER10":0,"INTPTLAT10":"+37.893772","INTPTLON10":"-122.288313"},"geometry":{"type":"Polygon","coordinates":[[[-122.288238,37.89473],[-122.288317,37.892856],[-122.28835,37.892856],[-122.288392,37.892863],[-122.288373,37.893237],[-122.28832,37.89436],[-122.288302,37.894735],[-122.288238,37.89473]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2014","GEOID10":"060014201002014","NAME10":"Block 2014","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16117,"AWATER10":0,"INTPTLAT10":"+37.893809","INTPTLON10":"-122.288787","population":32},"geometry":{"type":"Polygon","coordinates":[[[-122.288302,37.894735],[-122.28832,37.89436],[-122.288373,37.893237],[-122.288392,37.892863],[-122.288568,37.892867],[-122.289097,37.892882],[-122.289274,37.892887],[-122.289255,37.89326],[-122.289202,37.89438],[-122.289184,37.894754],[-122.289007,37.89475],[-122.288478,37.894738],[-122.288302,37.894735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2015","GEOID10":"060014201002015","NAME10":"Block 2015","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15921,"AWATER10":0,"INTPTLAT10":"+37.893833","INTPTLON10":"-122.289663","population":35},"geometry":{"type":"Polygon","coordinates":[[[-122.289274,37.892887],[-122.289447,37.89289],[-122.289966,37.892899],[-122.29014,37.892903],[-122.290122,37.893279],[-122.290072,37.894409],[-122.290056,37.894786],[-122.289881,37.894779],[-122.289358,37.89476],[-122.289184,37.894754],[-122.289202,37.89438],[-122.289255,37.89326],[-122.289274,37.892887]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2013","GEOID10":"060014201002013","NAME10":"Block 2013","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1269,"AWATER10":0,"INTPTLAT10":"+37.893772","INTPTLON10":"-122.288313"},"geometry":{"type":"Polygon","coordinates":[[[-122.288238,37.89473],[-122.288317,37.892856],[-122.28835,37.892856],[-122.288392,37.892863],[-122.28837300000001,37.893237],[-122.28832,37.89436],[-122.288302,37.894735],[-122.288238,37.89473]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2014","GEOID10":"060014201002014","NAME10":"Block 2014","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16117,"AWATER10":0,"INTPTLAT10":"+37.893809","INTPTLON10":"-122.288787","population":32},"geometry":{"type":"Polygon","coordinates":[[[-122.288302,37.894735],[-122.28832,37.89436],[-122.28837300000001,37.893237],[-122.288392,37.892863],[-122.288568,37.892867],[-122.289097,37.892882],[-122.289274,37.892887],[-122.289255,37.89326],[-122.289202,37.89438],[-122.289184,37.894754],[-122.289007,37.89475],[-122.288478,37.894738],[-122.288302,37.894735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"2015","GEOID10":"060014201002015","NAME10":"Block 2015","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15921,"AWATER10":0,"INTPTLAT10":"+37.893833","INTPTLON10":"-122.289663","population":35},"geometry":{"type":"Polygon","coordinates":[[[-122.289274,37.892887],[-122.289447,37.89289],[-122.289966,37.892899],[-122.29014,37.892903],[-122.290122,37.893279],[-122.290072,37.894409],[-122.290056,37.894786],[-122.289881,37.894779],[-122.28935799999999,37.89476],[-122.289184,37.894754],[-122.289202,37.89438],[-122.289255,37.89326],[-122.289274,37.892887]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3000","GEOID10":"060014201003000","NAME10":"Block 3000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15665,"AWATER10":0,"INTPTLAT10":"+37.893860","INTPTLON10":"-122.290522","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.290056,37.894786],[-122.290072,37.894409],[-122.290122,37.893279],[-122.29014,37.892903],[-122.290308,37.892908],[-122.290813,37.892925],[-122.290982,37.892931],[-122.290968,37.893306],[-122.29093,37.894434],[-122.290918,37.89481],[-122.290745,37.894805],[-122.290228,37.89479],[-122.290056,37.894786]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3001","GEOID10":"060014201003001","NAME10":"Block 3001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16246,"AWATER10":0,"INTPTLAT10":"+37.893883","INTPTLON10":"-122.291391","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.291796,37.894851],[-122.29162,37.894834],[-122.291598,37.894832],[-122.291093,37.894815],[-122.290918,37.89481],[-122.29093,37.894434],[-122.290968,37.893306],[-122.290982,37.892931],[-122.29116,37.892937],[-122.291698,37.892955],[-122.291877,37.892961],[-122.291858,37.893285],[-122.291855,37.893338],[-122.29181,37.894472],[-122.291796,37.894851]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3002","GEOID10":"060014201003002","NAME10":"Block 3002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19544,"AWATER10":0,"INTPTLAT10":"+37.891804","INTPTLON10":"-122.291474","population":38},"geometry":{"type":"Polygon","coordinates":[[[-122.291921,37.890645],[-122.291943,37.890729],[-122.291946,37.890796],[-122.291936,37.891075],[-122.291892,37.892376],[-122.291878,37.89281],[-122.291877,37.89284],[-122.291877,37.89293],[-122.291877,37.892961],[-122.291698,37.892955],[-122.29116,37.892937],[-122.290982,37.892931],[-122.29102,37.892483],[-122.291024,37.89244],[-122.29105,37.891137],[-122.29106,37.890689],[-122.291232,37.890679],[-122.291748,37.890653],[-122.291921,37.890645]]]}}
@@ -41,7 +41,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3004","GEOID10":"060014201003004","NAME10":"Block 3004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18095,"AWATER10":0,"INTPTLAT10":"+37.891824","INTPTLON10":"-122.289764","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.29014,37.892903],[-122.289966,37.892899],[-122.289447,37.89289],[-122.289274,37.892887],[-122.289296,37.892464],[-122.289362,37.891196],[-122.289385,37.890774],[-122.289485,37.890769],[-122.289786,37.890756],[-122.289887,37.890752],[-122.289959,37.890746],[-122.290178,37.89073],[-122.290251,37.890725],[-122.290228,37.89116],[-122.290162,37.892467],[-122.29014,37.892903]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3005","GEOID10":"060014201003005","NAME10":"Block 3005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16537,"AWATER10":0,"INTPTLAT10":"+37.891906","INTPTLON10":"-122.288910","population":29},"geometry":{"type":"Polygon","coordinates":[[[-122.288392,37.892863],[-122.28841,37.892428],[-122.288448,37.891575],[-122.288456,37.891528],[-122.288475,37.891476],[-122.288517,37.891402],[-122.288685,37.891199],[-122.288694,37.891189],[-122.288746,37.891135],[-122.288786,37.891077],[-122.288809,37.891023],[-122.288829,37.890933],[-122.288847,37.890809],[-122.288954,37.890801],[-122.289277,37.890781],[-122.289385,37.890774],[-122.289362,37.891196],[-122.289296,37.892464],[-122.289274,37.892887],[-122.289097,37.892882],[-122.288568,37.892867],[-122.288392,37.892863]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3006","GEOID10":"060014201003006","NAME10":"Block 3006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1509,"AWATER10":0,"INTPTLAT10":"+37.892606","INTPTLON10":"-122.288382"},"geometry":{"type":"Polygon","coordinates":[[[-122.288317,37.892856],[-122.28838,37.891572],[-122.288401,37.891473],[-122.288438,37.891395],[-122.288481,37.891327],[-122.288619,37.891164],[-122.28871,37.891072],[-122.288738,37.89102],[-122.288751,37.890966],[-122.28877,37.890812],[-122.288847,37.890809],[-122.288829,37.890933],[-122.288809,37.891023],[-122.288786,37.891077],[-122.288746,37.891135],[-122.288694,37.891189],[-122.288685,37.891199],[-122.288517,37.891402],[-122.288475,37.891476],[-122.288456,37.891528],[-122.288448,37.891575],[-122.28841,37.892428],[-122.288392,37.892863],[-122.28835,37.892856],[-122.288317,37.892856]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3007","GEOID10":"060014201003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18637,"AWATER10":0,"INTPTLAT10":"+37.891785","INTPTLON10":"-122.287969","population":28},"geometry":{"type":"Polygon","coordinates":[[[-122.28877,37.890812],[-122.288751,37.890966],[-122.288738,37.89102],[-122.28871,37.891072],[-122.288619,37.891164],[-122.288481,37.891327],[-122.288438,37.891395],[-122.288401,37.891473],[-122.28838,37.891572],[-122.288317,37.892856],[-122.2882,37.89285],[-122.287623,37.892825],[-122.287609,37.892825],[-122.287432,37.89281],[-122.287448,37.892424],[-122.287498,37.891267],[-122.287516,37.890882],[-122.287553,37.890879],[-122.287668,37.890874],[-122.287706,37.890872],[-122.287934,37.890859],[-122.288618,37.890821],[-122.288767,37.890813],[-122.28877,37.890812]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3007","GEOID10":"060014201003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18637,"AWATER10":0,"INTPTLAT10":"+37.891785","INTPTLON10":"-122.287969","population":28},"geometry":{"type":"Polygon","coordinates":[[[-122.28877,37.890812],[-122.288751,37.890966],[-122.288738,37.89102],[-122.28871,37.891072],[-122.288619,37.891164],[-122.288481,37.891327],[-122.288438,37.891395],[-122.288401,37.891473],[-122.28838,37.891572],[-122.288317,37.892856],[-122.2882,37.89285],[-122.287623,37.892825],[-122.287609,37.892825],[-122.287432,37.89281],[-122.287448,37.892424],[-122.287498,37.891267],[-122.287516,37.890882],[-122.287553,37.890879],[-122.287668,37.890874],[-122.287706,37.890872],[-122.287934,37.890859],[-122.288618,37.890821],[-122.28876700000001,37.890813],[-122.28877,37.890812]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420100","BLOCKCE10":"3008","GEOID10":"060014201003008","NAME10":"Block 3008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":5620,"AWATER10":0,"INTPTLAT10":"+37.891809","INTPTLON10":"-122.287323","population":12},"geometry":{"type":"Polygon","coordinates":[[[-122.287432,37.89281],[-122.28738,37.89281],[-122.287224,37.89281],[-122.287172,37.89281],[-122.287172,37.89243],[-122.287172,37.891291],[-122.287172,37.890912],[-122.28724,37.890905],[-122.287447,37.890888],[-122.287516,37.890882],[-122.287498,37.891267],[-122.287448,37.892424],[-122.287432,37.89281]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"1000","GEOID10":"060014202001000","NAME10":"Block 1000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":13452,"AWATER10":0,"INTPTLAT10":"+37.898271","INTPTLON10":"-122.296474","population":113},"geometry":{"type":"Polygon","coordinates":[[[-122.295703,37.897763],[-122.295745,37.897753],[-122.295873,37.897727],[-122.295916,37.897719],[-122.296087,37.897683],[-122.296603,37.897579],[-122.296775,37.897544],[-122.296859,37.897814],[-122.297113,37.898626],[-122.297144,37.898723],[-122.297162,37.898783],[-122.297197,37.898898],[-122.297,37.898922],[-122.29698,37.898925],[-122.296405,37.898925],[-122.296338,37.898925],[-122.296207,37.898925],[-122.2961,37.898695],[-122.295882,37.898223],[-122.295794,37.897999],[-122.295703,37.897763]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"1001","GEOID10":"060014202001001","NAME10":"Block 1001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":11928,"AWATER10":0,"INTPTLAT10":"+37.898151","INTPTLON10":"-122.297410","population":49},"geometry":{"type":"Polygon","coordinates":[[[-122.297197,37.898898],[-122.297162,37.898783],[-122.297144,37.898723],[-122.297113,37.898626],[-122.296859,37.897814],[-122.296775,37.897544],[-122.296942,37.897512],[-122.297443,37.897418],[-122.297611,37.897387],[-122.297697,37.897656],[-122.297958,37.898466],[-122.298008,37.89862],[-122.298024,37.898671],[-122.298044,37.898737],[-122.297879,37.898791],[-122.29778,37.898825],[-122.297368,37.898876],[-122.297197,37.898898]]]}}
@@ -66,8 +66,8 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2005","GEOID10":"060014202002005","NAME10":"Block 2005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14270,"AWATER10":0,"INTPTLAT10":"+37.894854","INTPTLON10":"-122.297242","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.297079,37.895752],[-122.296974,37.895424],[-122.296662,37.89444],[-122.296559,37.894113],[-122.29668,37.894103],[-122.296731,37.894094],[-122.296759,37.89409],[-122.297241,37.89399],[-122.297411,37.893956],[-122.297512,37.894282],[-122.297819,37.89526],[-122.297921,37.895586],[-122.297752,37.895619],[-122.297247,37.895718],[-122.297079,37.895752]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2006","GEOID10":"060014202002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14158,"AWATER10":0,"INTPTLAT10":"+37.893232","INTPTLON10":"-122.296730","population":32},"geometry":{"type":"Polygon","coordinates":[[[-122.296056,37.892502],[-122.296222,37.892468],[-122.296721,37.892368],[-122.296888,37.892335],[-122.296992,37.892659],[-122.297306,37.893631],[-122.297411,37.893956],[-122.297241,37.89399],[-122.296759,37.89409],[-122.296731,37.894094],[-122.29668,37.894103],[-122.296559,37.894113],[-122.296458,37.89379],[-122.296156,37.892824],[-122.296056,37.892502]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2007","GEOID10":"060014202002007","NAME10":"Block 2007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14053,"AWATER10":0,"INTPTLAT10":"+37.893393","INTPTLON10":"-122.295888","population":33},"geometry":{"type":"Polygon","coordinates":[[[-122.296056,37.892502],[-122.296156,37.892824],[-122.296458,37.89379],[-122.296559,37.894113],[-122.29647,37.894126],[-122.296394,37.894149],[-122.295895,37.894257],[-122.295729,37.894293],[-122.295626,37.893968],[-122.295317,37.892994],[-122.295215,37.89267],[-122.295383,37.892636],[-122.295887,37.892535],[-122.296056,37.892502]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2008","GEOID10":"060014202002008","NAME10":"Block 2008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18377,"AWATER10":0,"INTPTLAT10":"+37.891538","INTPTLON10":"-122.295286","population":50},"geometry":{"type":"Polygon","coordinates":[[[-122.294504,37.890519],[-122.294681,37.890508],[-122.295212,37.890478],[-122.29539,37.890468],[-122.295523,37.890874],[-122.295922,37.892095],[-122.296056,37.892502],[-122.295887,37.892535],[-122.295383,37.892636],[-122.295215,37.89267],[-122.295072,37.892239],[-122.294646,37.890949],[-122.294504,37.890519]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2009","GEOID10":"060014202002009","NAME10":"Block 2009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19818,"AWATER10":0,"INTPTLAT10":"+37.891658","INTPTLON10":"-122.294418","population":57},"geometry":{"type":"Polygon","coordinates":[[[-122.293622,37.890561],[-122.293645,37.890559],[-122.293714,37.890556],[-122.293738,37.890555],[-122.29377,37.890552],[-122.293869,37.890547],[-122.293902,37.890546],[-122.294022,37.890541],[-122.294243,37.890533],[-122.294383,37.890525],[-122.294504,37.890519],[-122.294646,37.890949],[-122.295072,37.892239],[-122.295215,37.89267],[-122.29504,37.892706],[-122.294515,37.892817],[-122.294476,37.892826],[-122.294338,37.892841],[-122.294194,37.892385],[-122.293765,37.891017],[-122.293622,37.890561]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2008","GEOID10":"060014202002008","NAME10":"Block 2008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18377,"AWATER10":0,"INTPTLAT10":"+37.891538","INTPTLON10":"-122.295286","population":50},"geometry":{"type":"Polygon","coordinates":[[[-122.294504,37.890519],[-122.294681,37.890508],[-122.295212,37.890478],[-122.29539,37.890468],[-122.295523,37.890874],[-122.295922,37.892095],[-122.296056,37.892502],[-122.295887,37.892535],[-122.295383,37.892636],[-122.295215,37.89267],[-122.295072,37.892238999999999],[-122.294646,37.890949],[-122.294504,37.890519]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2009","GEOID10":"060014202002009","NAME10":"Block 2009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19818,"AWATER10":0,"INTPTLAT10":"+37.891658","INTPTLON10":"-122.294418","population":57},"geometry":{"type":"Polygon","coordinates":[[[-122.293622,37.890561],[-122.293645,37.890559],[-122.293714,37.890556],[-122.293738,37.890555],[-122.29377,37.890552],[-122.293869,37.890547],[-122.293902,37.890546],[-122.294022,37.890541],[-122.294243,37.890533],[-122.294383,37.890525],[-122.294504,37.890519],[-122.294646,37.890949],[-122.295072,37.892238999999999],[-122.295215,37.89267],[-122.29504,37.892706],[-122.294515,37.892817],[-122.294476,37.892826],[-122.294338,37.892841],[-122.294194,37.892385],[-122.293765,37.891017],[-122.293622,37.890561]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2010","GEOID10":"060014202002010","NAME10":"Block 2010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":8445,"AWATER10":0,"INTPTLAT10":"+37.891485","INTPTLON10":"-122.293695"},"geometry":{"type":"Polygon","coordinates":[[[-122.293139,37.891024],[-122.293159,37.890585],[-122.293288,37.890575],[-122.293302,37.890574],[-122.293364,37.890568],[-122.293387,37.890567],[-122.293622,37.890561],[-122.293765,37.891017],[-122.294194,37.892385],[-122.294338,37.892841],[-122.29429,37.892845],[-122.294234,37.892851],[-122.294147,37.89285],[-122.2941,37.89285],[-122.293834,37.891979],[-122.293649,37.891725],[-122.293139,37.891024]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2011","GEOID10":"060014202002011","NAME10":"Block 2011","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":700,"AWATER10":0,"INTPTLAT10":"+37.890745","INTPTLON10":"-122.293047"},"geometry":{"type":"Polygon","coordinates":[[[-122.293159,37.890585],[-122.293139,37.891024],[-122.293092,37.890965],[-122.292898,37.890719],[-122.292897,37.890695],[-122.292894,37.890624],[-122.292894,37.890601],[-122.292992,37.890595],[-122.293159,37.890585]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"2012","GEOID10":"060014202002012","NAME10":"Block 2012","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":17230,"AWATER10":0,"INTPTLAT10":"+37.891425","INTPTLON10":"-122.296144","population":51},"geometry":{"type":"Polygon","coordinates":[[[-122.296056,37.892502],[-122.295922,37.892095],[-122.295523,37.890874],[-122.29539,37.890468],[-122.295564,37.890454],[-122.296087,37.890415],[-122.296262,37.890403],[-122.296387,37.890789],[-122.296762,37.891948],[-122.296888,37.892335],[-122.296721,37.892368],[-122.296222,37.892468],[-122.296056,37.892502]]]}}
@@ -81,7 +81,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3007","GEOID10":"060014202003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14185,"AWATER10":0,"INTPTLAT10":"+37.893063","INTPTLON10":"-122.297570","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.297411,37.893956],[-122.297306,37.893631],[-122.296992,37.892659],[-122.296888,37.892335],[-122.297057,37.892301],[-122.297566,37.892203],[-122.297736,37.892171],[-122.297838,37.892498],[-122.298145,37.893479],[-122.298248,37.893806],[-122.29808,37.893836],[-122.297578,37.893925],[-122.297411,37.893956]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3008","GEOID10":"060014202003008","NAME10":"Block 3008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16353,"AWATER10":0,"INTPTLAT10":"+37.891320","INTPTLON10":"-122.297001","population":51},"geometry":{"type":"Polygon","coordinates":[[[-122.296888,37.892335],[-122.296762,37.891948],[-122.296387,37.890789],[-122.296262,37.890403],[-122.296437,37.890394],[-122.296963,37.890371],[-122.297139,37.890363],[-122.297258,37.890724],[-122.297616,37.891809],[-122.297736,37.892171],[-122.297566,37.892203],[-122.297057,37.892301],[-122.296888,37.892335]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3009","GEOID10":"060014202003009","NAME10":"Block 3009","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15100,"AWATER10":0,"INTPTLAT10":"+37.891205","INTPTLON10":"-122.297856","population":84},"geometry":{"type":"Polygon","coordinates":[[[-122.297736,37.892171],[-122.297616,37.891809],[-122.297258,37.890724],[-122.297139,37.890363],[-122.297316,37.890353],[-122.297849,37.890327],[-122.298027,37.890319],[-122.298132,37.890652],[-122.298448,37.891651],[-122.298554,37.891985],[-122.29839,37.892022],[-122.297899,37.892133],[-122.297736,37.892171]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3010","GEOID10":"060014202003010","NAME10":"Block 3010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14291,"AWATER10":0,"INTPTLAT10":"+37.891101","INTPTLON10":"-122.298726","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.298929,37.890275],[-122.299416,37.891816],[-122.299342,37.89183],[-122.298751,37.891946],[-122.298554,37.891985],[-122.298448,37.891651],[-122.298132,37.890652],[-122.298027,37.890319],[-122.298232,37.890312],[-122.298514,37.890304],[-122.298724,37.890294],[-122.298846,37.890282],[-122.298929,37.890275]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3010","GEOID10":"060014202003010","NAME10":"Block 3010","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14291,"AWATER10":0,"INTPTLAT10":"+37.891101","INTPTLON10":"-122.298726","population":30},"geometry":{"type":"Polygon","coordinates":[[[-122.298929,37.890275],[-122.299416,37.891816],[-122.299342,37.89183],[-122.298751,37.891946],[-122.298554,37.891985],[-122.298448,37.891651],[-122.298132,37.890652],[-122.298027,37.890319],[-122.298232,37.890312],[-122.298514,37.890304],[-122.29872400000001,37.890294],[-122.298846,37.890282],[-122.298929,37.890275]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3011","GEOID10":"060014202003011","NAME10":"Block 3011","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1922,"AWATER10":0,"INTPTLAT10":"+37.891043","INTPTLON10":"-122.299235"},"geometry":{"type":"Polygon","coordinates":[[[-122.299416,37.891816],[-122.298929,37.890275],[-122.299051,37.890264],[-122.299148,37.890569],[-122.299442,37.891486],[-122.29954,37.891792],[-122.299416,37.891816]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420200","BLOCKCE10":"3012","GEOID10":"060014202003012","NAME10":"Block 3012","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":636,"AWATER10":0,"INTPTLAT10":"+37.892051","INTPTLON10":"-122.299561"},"geometry":{"type":"Polygon","coordinates":[[[-122.299706,37.892285],[-122.299584,37.892313],[-122.299416,37.891816],[-122.29954,37.891792],[-122.299573,37.89189],[-122.299672,37.892186],[-122.299706,37.892285]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"1000","GEOID10":"060014203001000","NAME10":"Block 1000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16605,"AWATER10":0,"INTPTLAT10":"+37.895003","INTPTLON10":"-122.301039","population":42},"geometry":{"type":"Polygon","coordinates":[[[-122.300593,37.895043],[-122.300538,37.894865],[-122.300374,37.894333],[-122.30032,37.894156],[-122.300487,37.89412],[-122.300989,37.894014],[-122.301157,37.893979],[-122.30128,37.89435],[-122.301651,37.895463],[-122.301775,37.895834],[-122.3016,37.895871],[-122.301077,37.895981],[-122.300903,37.896019],[-122.300841,37.895823],[-122.300655,37.895238],[-122.300593,37.895043]]]}}
@@ -102,10 +102,10 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"1015","GEOID10":"060014203001015","NAME10":"Block 1015","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19773,"AWATER10":0,"INTPTLAT10":"+37.888859","INTPTLON10":"-122.299964","population":70},"geometry":{"type":"Polygon","coordinates":[[[-122.300752,37.889909],[-122.299902,37.890073],[-122.299766,37.889637],[-122.299319,37.888203],[-122.299171,37.887725],[-122.300045,37.88771],[-122.300752,37.889909]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"2000","GEOID10":"060014203002000","NAME10":"Block 2000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":412555,"AWATER10":0,"INTPTLAT10":"+37.894918","INTPTLON10":"-122.304889","population":1118},"geometry":{"type":"Polygon","coordinates":[[[-122.308946,37.89797],[-122.30878,37.898025],[-122.308634,37.898036],[-122.308451,37.89805],[-122.307352,37.898134],[-122.307065,37.898157],[-122.306747,37.898181],[-122.30618,37.898225],[-122.306,37.898264],[-122.30546,37.898385],[-122.305336,37.898413],[-122.30528,37.898425],[-122.305184,37.898425],[-122.304896,37.898425],[-122.304801,37.898425],[-122.304756,37.898425],[-122.304629,37.898425],[-122.304624,37.898425],[-122.30458,37.898425],[-122.30438,37.898445],[-122.30378,37.898505],[-122.30371,37.898512],[-122.30358,37.898525],[-122.303513,37.898525],[-122.303314,37.898525],[-122.303248,37.898525],[-122.303194,37.898525],[-122.303033,37.898525],[-122.30298,37.898525],[-122.30282,37.898525],[-122.30234,37.898525],[-122.30218,37.898525],[-122.302095,37.898525],[-122.301841,37.898525],[-122.301757,37.898525],[-122.301625,37.898525],[-122.301572,37.898423],[-122.301527,37.898252],[-122.301503,37.898162],[-122.30121,37.897048],[-122.301114,37.896678],[-122.301071,37.896546],[-122.300945,37.89615],[-122.300903,37.896019],[-122.301077,37.895981],[-122.3016,37.895871],[-122.301775,37.895834],[-122.301939,37.895799],[-122.302434,37.895697],[-122.302599,37.895664],[-122.302481,37.895293],[-122.302127,37.894182],[-122.30201,37.893812],[-122.302175,37.893776],[-122.302673,37.893671],[-122.30284,37.893637],[-122.302889,37.893812],[-122.303039,37.894337],[-122.303089,37.894513],[-122.303117,37.894247],[-122.303106,37.894159],[-122.303093,37.89404],[-122.303084,37.893855],[-122.3031,37.893715],[-122.303128,37.893528],[-122.303181,37.893366],[-122.303254,37.893216],[-122.303298,37.893132],[-122.303335,37.893065],[-122.303492,37.892834],[-122.30341,37.892587],[-122.303167,37.891846],[-122.303086,37.891599],[-122.303167,37.891344],[-122.303231,37.891145],[-122.303317,37.890839],[-122.303426,37.890586],[-122.303452,37.890527],[-122.303489,37.890457],[-122.30355,37.890349],[-122.303608,37.890289],[-122.303731,37.89018],[-122.303748,37.890166],[-122.303899,37.890065],[-122.303948,37.890041],[-122.304141,37.889968],[-122.304412,37.889904],[-122.304574,37.889878],[-122.304658,37.889874],[-122.304928,37.889814],[-122.30574,37.889635],[-122.306013,37.889587],[-122.306058,37.889717],[-122.306123,37.889905],[-122.306193,37.89011],[-122.306238,37.890241],[-122.30627,37.890353],[-122.306369,37.89069],[-122.306402,37.890803],[-122.306688,37.891695],[-122.30671,37.891848],[-122.306693,37.891995],[-122.306661,37.892132],[-122.306645,37.892217],[-122.306636,37.892274],[-122.306634,37.89229],[-122.306624,37.892398],[-122.306639,37.892531],[-122.306669,37.892657],[-122.306745,37.892813],[-122.306895,37.893102],[-122.307218,37.893753],[-122.307868,37.89533],[-122.308155,37.896034],[-122.308363,37.896551],[-122.308476,37.896829],[-122.308584,37.897145],[-122.308915,37.897902],[-122.308946,37.89797]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3000","GEOID10":"060014203003000","NAME10":"Block 3000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":27350,"AWATER10":0,"INTPTLAT10":"+37.890773","INTPTLON10":"-122.306765"},"geometry":{"type":"Polygon","coordinates":[[[-122.306645,37.892217],[-122.306661,37.892132],[-122.306693,37.891995],[-122.30671,37.891848],[-122.306688,37.891695],[-122.306402,37.890803],[-122.306645,37.890753],[-122.306699,37.890733],[-122.306734,37.890722],[-122.306801,37.890682],[-122.306872,37.890585],[-122.307209,37.88999],[-122.307235,37.889945],[-122.307392,37.889746],[-122.307248,37.890123],[-122.307198,37.890282],[-122.307168,37.89038],[-122.307108,37.890625],[-122.307063,37.890866],[-122.307023,37.891219],[-122.307004,37.891586],[-122.307012,37.891922],[-122.307017,37.891973],[-122.307048,37.892278],[-122.307084,37.89254],[-122.307125,37.892734],[-122.307171,37.892889],[-122.307215,37.893037],[-122.307344,37.893366],[-122.307532,37.893809],[-122.307566,37.893897],[-122.307652,37.894118],[-122.307699,37.894233],[-122.308022,37.894958],[-122.308817,37.896731],[-122.308994,37.897137],[-122.309278,37.897782],[-122.309315,37.897867],[-122.30926,37.89788],[-122.309184,37.8979],[-122.309148,37.897908],[-122.30908,37.897925],[-122.309042,37.897937],[-122.309008,37.897949],[-122.308946,37.89797],[-122.308915,37.897902],[-122.308584,37.897145],[-122.308476,37.896829],[-122.308363,37.896551],[-122.308155,37.896034],[-122.307868,37.89533],[-122.307218,37.893753],[-122.306895,37.893102],[-122.306745,37.892813],[-122.306669,37.892657],[-122.306639,37.892531],[-122.306624,37.892398],[-122.306634,37.89229],[-122.306636,37.892274],[-122.306645,37.892217]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3001","GEOID10":"060014203003001","NAME10":"Block 3001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":24651,"AWATER10":0,"INTPTLAT10":"+37.892198","INTPTLON10":"-122.307551"},"geometry":{"type":"Polygon","coordinates":[[[-122.308278,37.895224],[-122.308486,37.895736],[-122.30881,37.896534],[-122.309021,37.897067],[-122.309105,37.897276],[-122.309311,37.89779],[-122.309339,37.89786],[-122.309315,37.897867],[-122.309278,37.897782],[-122.308994,37.897137],[-122.308817,37.896731],[-122.308022,37.894958],[-122.307699,37.894233],[-122.307652,37.894118],[-122.307566,37.893897],[-122.307532,37.893809],[-122.307344,37.893366],[-122.307215,37.893037],[-122.307171,37.892889],[-122.307125,37.892734],[-122.307084,37.89254],[-122.307048,37.892278],[-122.307017,37.891973],[-122.307012,37.891922],[-122.307004,37.891586],[-122.307023,37.891219],[-122.307063,37.890866],[-122.307108,37.890625],[-122.307168,37.89038],[-122.307198,37.890282],[-122.307248,37.890123],[-122.307392,37.889746],[-122.307401,37.889726],[-122.30743,37.889668],[-122.30744,37.889649],[-122.307457,37.889617],[-122.307508,37.889523],[-122.307526,37.889492],[-122.307599,37.889787],[-122.307818,37.890672],[-122.307892,37.890968],[-122.307799,37.891168],[-122.307748,37.891325],[-122.307655,37.89166],[-122.307626,37.89181],[-122.307602,37.891942],[-122.307553,37.892239],[-122.307526,37.892606],[-122.307533,37.892786],[-122.307561,37.893117],[-122.307582,37.893282],[-122.307691,37.893709],[-122.307773,37.893973],[-122.307946,37.894401],[-122.308278,37.895224]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3002","GEOID10":"060014203003002","NAME10":"Block 3002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":9773,"AWATER10":0,"INTPTLAT10":"+37.892031","INTPTLON10":"-122.307713"},"geometry":{"type":"Polygon","coordinates":[[[-122.307892,37.890968],[-122.307962,37.891208],[-122.30808,37.891615],[-122.308169,37.891932],[-122.308207,37.892067],[-122.308225,37.892177],[-122.308097,37.892154],[-122.30802,37.892156],[-122.307942,37.89218],[-122.307883,37.892218],[-122.307848,37.892279],[-122.307835,37.892371],[-122.307831,37.892454],[-122.307823,37.892534],[-122.3078,37.892781],[-122.307805,37.893022],[-122.307824,37.893232],[-122.30787,37.89364],[-122.307952,37.89401],[-122.308104,37.894559],[-122.308117,37.894606],[-122.308278,37.895224],[-122.307946,37.894401],[-122.307773,37.893973],[-122.307691,37.893709],[-122.307582,37.893282],[-122.307561,37.893117],[-122.307533,37.892786],[-122.307526,37.892606],[-122.307553,37.892239],[-122.307602,37.891942],[-122.307626,37.89181],[-122.307655,37.89166],[-122.307748,37.891325],[-122.307799,37.891168],[-122.307892,37.890968]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3003","GEOID10":"060014203003003","NAME10":"Block 3003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18792,"AWATER10":0,"INTPTLAT10":"+37.894669","INTPTLON10":"-122.308429"},"geometry":{"type":"Polygon","coordinates":[[[-122.309311,37.89779],[-122.309105,37.897276],[-122.309021,37.897067],[-122.30881,37.896534],[-122.308486,37.895736],[-122.308278,37.895224],[-122.308117,37.894606],[-122.308104,37.894559],[-122.307952,37.89401],[-122.30787,37.89364],[-122.307824,37.893232],[-122.307805,37.893022],[-122.3078,37.892781],[-122.307823,37.892534],[-122.307831,37.892454],[-122.307835,37.892371],[-122.307848,37.892279],[-122.307883,37.892218],[-122.307942,37.89218],[-122.30802,37.892156],[-122.308097,37.892154],[-122.308225,37.892177],[-122.308244,37.892297],[-122.308261,37.892455],[-122.308307,37.893167],[-122.308297,37.893346],[-122.308277,37.893764],[-122.308329,37.894318],[-122.308344,37.894409],[-122.308662,37.895298],[-122.309066,37.896481],[-122.309159,37.896725],[-122.309336,37.89719],[-122.309376,37.897308],[-122.309411,37.897469],[-122.309502,37.897789],[-122.309512,37.897825],[-122.309491,37.897825],[-122.309481,37.897825],[-122.309457,37.897831],[-122.309339,37.89786],[-122.309311,37.89779]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3004","GEOID10":"060014203003004","NAME10":"Block 3004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":59347,"AWATER10":0,"INTPTLAT10":"+37.895581","INTPTLON10":"-122.309453"},"geometry":{"type":"Polygon","coordinates":[[[-122.309376,37.897308],[-122.309336,37.89719],[-122.309159,37.896725],[-122.309066,37.896481],[-122.308662,37.895298],[-122.308344,37.894409],[-122.308329,37.894318],[-122.308277,37.893764],[-122.308297,37.893346],[-122.308307,37.893167],[-122.308261,37.892455],[-122.308244,37.892297],[-122.308225,37.892177],[-122.308207,37.892067],[-122.308169,37.891932],[-122.30808,37.891615],[-122.307962,37.891208],[-122.307892,37.890968],[-122.307927,37.890892],[-122.308033,37.890667],[-122.308069,37.890592],[-122.308211,37.891226],[-122.308372,37.891856],[-122.308438,37.892134],[-122.308495,37.892366],[-122.308649,37.892921],[-122.308903,37.893714],[-122.308987,37.89392],[-122.309086,37.894158],[-122.30927,37.894558],[-122.309462,37.8949],[-122.30958,37.895102],[-122.309727,37.89534],[-122.309925,37.895651],[-122.310267,37.896113],[-122.310484,37.896381],[-122.310534,37.896442],[-122.311026,37.897062],[-122.311236,37.897331],[-122.311468,37.897629],[-122.311134,37.89774],[-122.310881,37.897825],[-122.309965,37.897825],[-122.309571,37.897825],[-122.309512,37.897825],[-122.309502,37.897789],[-122.309411,37.897469],[-122.309376,37.897308]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3001","GEOID10":"060014203003001","NAME10":"Block 3001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":24651,"AWATER10":0,"INTPTLAT10":"+37.892198","INTPTLON10":"-122.307551"},"geometry":{"type":"Polygon","coordinates":[[[-122.308278,37.895224],[-122.308486,37.895736],[-122.30881,37.896534],[-122.309021,37.897067],[-122.309105,37.897276],[-122.309311,37.89779],[-122.309339,37.89786],[-122.309315,37.897867],[-122.309278,37.897782],[-122.308994,37.897137],[-122.308817,37.896731],[-122.308022,37.894958],[-122.307699,37.894233],[-122.307652,37.894118],[-122.307566,37.893897],[-122.307532,37.893809],[-122.307344,37.893366],[-122.307215,37.893037],[-122.307171,37.892889],[-122.307125,37.892734],[-122.307084,37.89254],[-122.307048,37.892278],[-122.307017,37.891973],[-122.307012,37.891922],[-122.307004,37.891586],[-122.307023,37.891219],[-122.307063,37.890866],[-122.307108,37.890625],[-122.307168,37.89038],[-122.307198,37.890282],[-122.307248,37.890123],[-122.307392,37.889746],[-122.307401,37.889726],[-122.30743,37.889668],[-122.30744,37.889649],[-122.307457,37.889617],[-122.307508,37.889523],[-122.307526,37.889492],[-122.307599,37.889787],[-122.307818,37.890672],[-122.307892,37.890968],[-122.307799,37.891168],[-122.307748,37.891325],[-122.307655,37.89166],[-122.307626,37.89181],[-122.307602,37.891942],[-122.307553,37.892238999999999],[-122.307526,37.892606],[-122.307533,37.892786],[-122.307561,37.893117],[-122.307582,37.893282],[-122.307691,37.893709],[-122.307773,37.893973],[-122.307946,37.894401],[-122.308278,37.895224]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3002","GEOID10":"060014203003002","NAME10":"Block 3002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":9773,"AWATER10":0,"INTPTLAT10":"+37.892031","INTPTLON10":"-122.307713"},"geometry":{"type":"Polygon","coordinates":[[[-122.307892,37.890968],[-122.307962,37.891208],[-122.30808,37.891615],[-122.308169,37.891932],[-122.308207,37.892067],[-122.308225,37.892177],[-122.308097,37.892154],[-122.30802,37.892156],[-122.307942,37.89218],[-122.307883,37.892218],[-122.307848,37.892279],[-122.307835,37.892371],[-122.307831,37.892454],[-122.307823,37.892534],[-122.3078,37.892781],[-122.307805,37.893022],[-122.307824,37.893232],[-122.30787,37.89364],[-122.307952,37.89401],[-122.308104,37.894559],[-122.308117,37.894606],[-122.308278,37.895224],[-122.307946,37.894401],[-122.307773,37.893973],[-122.307691,37.893709],[-122.307582,37.893282],[-122.307561,37.893117],[-122.307533,37.892786],[-122.307526,37.892606],[-122.307553,37.892238999999999],[-122.307602,37.891942],[-122.307626,37.89181],[-122.307655,37.89166],[-122.307748,37.891325],[-122.307799,37.891168],[-122.307892,37.890968]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3003","GEOID10":"060014203003003","NAME10":"Block 3003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18792,"AWATER10":0,"INTPTLAT10":"+37.894669","INTPTLON10":"-122.308429"},"geometry":{"type":"Polygon","coordinates":[[[-122.309311,37.89779],[-122.309105,37.897276],[-122.309021,37.897067],[-122.30881,37.896534],[-122.308486,37.895736],[-122.308278,37.895224],[-122.308117,37.894606],[-122.308104,37.894559],[-122.307952,37.89401],[-122.30787,37.89364],[-122.307824,37.893232],[-122.307805,37.893022],[-122.3078,37.892781],[-122.307823,37.892534],[-122.307831,37.892454],[-122.307835,37.892371],[-122.307848,37.892279],[-122.307883,37.892218],[-122.307942,37.89218],[-122.30802,37.892156],[-122.308097,37.892154],[-122.308225,37.892177],[-122.308244,37.892297],[-122.308261,37.892455],[-122.308307,37.893167],[-122.308297,37.893346],[-122.308277,37.893764],[-122.308329,37.894318],[-122.308344,37.894409],[-122.308662,37.895298],[-122.309066,37.896481],[-122.309159,37.896725000000007],[-122.309336,37.89719],[-122.309376,37.897308],[-122.309411,37.897469],[-122.309502,37.897789],[-122.309512,37.897825],[-122.309491,37.897825],[-122.309481,37.897825],[-122.309457,37.897831],[-122.309339,37.89786],[-122.309311,37.89779]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3004","GEOID10":"060014203003004","NAME10":"Block 3004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":59347,"AWATER10":0,"INTPTLAT10":"+37.895581","INTPTLON10":"-122.309453"},"geometry":{"type":"Polygon","coordinates":[[[-122.309376,37.897308],[-122.309336,37.89719],[-122.309159,37.896725000000007],[-122.309066,37.896481],[-122.308662,37.895298],[-122.308344,37.894409],[-122.308329,37.894318],[-122.308277,37.893764],[-122.308297,37.893346],[-122.308307,37.893167],[-122.308261,37.892455],[-122.308244,37.892297],[-122.308225,37.892177],[-122.308207,37.892067],[-122.308169,37.891932],[-122.30808,37.891615],[-122.307962,37.891208],[-122.307892,37.890968],[-122.307927,37.890892],[-122.308033,37.890667],[-122.308069,37.890592],[-122.308211,37.891226],[-122.308372,37.891856],[-122.308438,37.892134],[-122.308495,37.892366],[-122.308649,37.892921],[-122.308903,37.893714],[-122.308987,37.89392],[-122.309086,37.894158],[-122.30927,37.894558],[-122.309462,37.8949],[-122.30958,37.895102],[-122.309727,37.89534],[-122.309925,37.895651],[-122.310267,37.896113],[-122.310484,37.896381],[-122.310534,37.896442],[-122.311026,37.897062],[-122.311236,37.897331],[-122.311468,37.897629],[-122.311134,37.89774],[-122.310881,37.897825],[-122.309965,37.897825],[-122.309571,37.897825],[-122.309512,37.897825],[-122.309502,37.897789],[-122.309411,37.897469],[-122.309376,37.897308]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3005","GEOID10":"060014203003005","NAME10":"Block 3005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":30820,"AWATER10":0,"INTPTLAT10":"+37.891015","INTPTLON10":"-122.308540"},"geometry":{"type":"Polygon","coordinates":[[[-122.308069,37.890592],[-122.308123,37.890487],[-122.308286,37.890175],[-122.308341,37.890071],[-122.30839,37.890315],[-122.308405,37.890387],[-122.308495,37.890723],[-122.30857,37.891042],[-122.308628,37.891285],[-122.308707,37.891602],[-122.308766,37.891836],[-122.308965,37.892548],[-122.309054,37.892863],[-122.309128,37.893126],[-122.309284,37.893557],[-122.309414,37.893875],[-122.309421,37.893891],[-122.309529,37.894133],[-122.309682,37.894452],[-122.309874,37.894805],[-122.310186,37.895308],[-122.310342,37.895535],[-122.310502,37.895789],[-122.310635,37.895983],[-122.310941,37.896401],[-122.311153,37.896666],[-122.311388,37.89696],[-122.311568,37.897186],[-122.311622,37.897255],[-122.311826,37.897491],[-122.311845,37.897514],[-122.31181,37.89752],[-122.311781,37.897525],[-122.311583,37.89759],[-122.311508,37.897616],[-122.311468,37.897629],[-122.311236,37.897331],[-122.311026,37.897062],[-122.310534,37.896442],[-122.310484,37.896381],[-122.310267,37.896113],[-122.309925,37.895651],[-122.309727,37.89534],[-122.30958,37.895102],[-122.309462,37.8949],[-122.30927,37.894558],[-122.309086,37.894158],[-122.308987,37.89392],[-122.308903,37.893714],[-122.308649,37.892921],[-122.308495,37.892366],[-122.308438,37.892134],[-122.308372,37.891856],[-122.308211,37.891226],[-122.308069,37.890592]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3006","GEOID10":"060014203003006","NAME10":"Block 3006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":19563,"AWATER10":24,"INTPTLAT10":"+37.890405","INTPTLON10":"-122.308694"},"geometry":{"type":"Polygon","coordinates":[[[-122.311538,37.896806],[-122.311565,37.896838],[-122.311758,37.897088],[-122.312009,37.897413],[-122.312063,37.897478],[-122.312004,37.897487],[-122.311889,37.897507],[-122.311845,37.897514],[-122.311826,37.897491],[-122.311622,37.897255],[-122.311568,37.897186],[-122.311388,37.89696],[-122.311153,37.896666],[-122.310941,37.896401],[-122.310635,37.895983],[-122.310502,37.895789],[-122.310342,37.895535],[-122.310186,37.895308],[-122.309874,37.894805],[-122.309682,37.894452],[-122.309529,37.894133],[-122.309421,37.893891],[-122.309414,37.893875],[-122.309284,37.893557],[-122.309128,37.893126],[-122.309054,37.892863],[-122.308965,37.892548],[-122.308766,37.891836],[-122.308707,37.891602],[-122.308628,37.891285],[-122.30857,37.891042],[-122.308495,37.890723],[-122.308405,37.890387],[-122.30839,37.890315],[-122.308341,37.890071],[-122.30847,37.889804],[-122.308738,37.889253],[-122.308805,37.88913],[-122.308964,37.888766],[-122.308925,37.88939],[-122.308887,37.890063],[-122.30888,37.890482],[-122.308925,37.890958],[-122.308979,37.891237],[-122.308948,37.891714],[-122.30899,37.892061],[-122.309093,37.892584],[-122.309151,37.892825],[-122.309223,37.893051],[-122.309413,37.893595],[-122.309515,37.893845],[-122.309641,37.894105],[-122.309978,37.894761],[-122.31028,37.895227],[-122.310482,37.895512],[-122.310654,37.895738],[-122.311505,37.896707],[-122.311591,37.896819],[-122.311538,37.896806]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420300","BLOCKCE10":"3007","GEOID10":"060014203003007","NAME10":"Block 3007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":3648,"AWATER10":0,"INTPTLAT10":"+37.897139","INTPTLON10":"-122.312126"},"geometry":{"type":"Polygon","coordinates":[[[-122.311565,37.896838],[-122.311538,37.896806],[-122.311591,37.896819],[-122.311959,37.8969],[-122.31214,37.896928],[-122.312424,37.896928],[-122.312521,37.89701],[-122.312542,37.89712],[-122.312466,37.897411],[-122.31235,37.89743],[-122.312171,37.89746],[-122.312063,37.897478],[-122.312009,37.897413],[-122.311758,37.897088],[-122.311565,37.896838]]]}}
@@ -159,7 +159,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1002","GEOID10":"060014205001002","NAME10":"Block 1002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":411,"AWATER10":0,"INTPTLAT10":"+37.890411","INTPTLON10":"-122.295818"},"geometry":{"type":"Polygon","coordinates":[[[-122.296247,37.890355],[-122.296262,37.890403],[-122.296087,37.890415],[-122.295564,37.890454],[-122.29539,37.890468],[-122.295376,37.89042],[-122.296247,37.890355]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1003","GEOID10":"060014205001003","NAME10":"Block 1003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":422,"AWATER10":0,"INTPTLAT10":"+37.890358","INTPTLON10":"-122.296696"},"geometry":{"type":"Polygon","coordinates":[[[-122.296247,37.890355],[-122.297123,37.890313],[-122.297139,37.890363],[-122.296963,37.890371],[-122.296437,37.890394],[-122.296262,37.890403],[-122.296247,37.890355]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1004","GEOID10":"060014205001004","NAME10":"Block 1004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":521,"AWATER10":0,"INTPTLAT10":"+37.890309","INTPTLON10":"-122.297598"},"geometry":{"type":"Polygon","coordinates":[[[-122.297123,37.890313],[-122.298005,37.890249],[-122.298027,37.890319],[-122.297849,37.890327],[-122.297316,37.890353],[-122.297139,37.890363],[-122.297123,37.890313]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1005","GEOID10":"060014205001005","NAME10":"Block 1005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":627,"AWATER10":0,"INTPTLAT10":"+37.890267","INTPTLON10":"-122.298466"},"geometry":{"type":"Polygon","coordinates":[[[-122.298027,37.890319],[-122.298005,37.890249],[-122.298509,37.890232],[-122.29891,37.890211],[-122.298929,37.890275],[-122.298846,37.890282],[-122.298724,37.890294],[-122.298514,37.890304],[-122.298232,37.890312],[-122.298027,37.890319]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1005","GEOID10":"060014205001005","NAME10":"Block 1005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":627,"AWATER10":0,"INTPTLAT10":"+37.890267","INTPTLON10":"-122.298466"},"geometry":{"type":"Polygon","coordinates":[[[-122.298027,37.890319],[-122.298005,37.890249],[-122.298509,37.890232],[-122.29891,37.890211],[-122.298929,37.890275],[-122.298846,37.890282],[-122.29872400000001,37.890294],[-122.298514,37.890304],[-122.298232,37.890312],[-122.298027,37.890319]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1006","GEOID10":"060014205001006","NAME10":"Block 1006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":25175,"AWATER10":0,"INTPTLAT10":"+37.889049","INTPTLON10":"-122.293592","population":49},"geometry":{"type":"Polygon","coordinates":[[[-122.29271,37.887727],[-122.292685,37.887655],[-122.29358,37.887625],[-122.293557,37.887489],[-122.29358,37.887559],[-122.293747,37.888094],[-122.294314,37.889913],[-122.294488,37.890471],[-122.294221,37.890483],[-122.29387,37.890502],[-122.293699,37.890506],[-122.293619,37.890403],[-122.293543,37.890307],[-122.293411,37.889872],[-122.293263,37.889429],[-122.293047,37.888782],[-122.292828,37.888098],[-122.29271,37.887727]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1007","GEOID10":"060014205001007","NAME10":"Block 1007","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":32096,"AWATER10":0,"INTPTLAT10":"+37.888458","INTPTLON10":"-122.297915","population":70},"geometry":{"type":"Polygon","coordinates":[[[-122.297787,37.886735],[-122.297764,37.886665],[-122.297909,37.886679],[-122.297934,37.886756],[-122.298249,37.887758],[-122.298127,37.887769],[-122.29891,37.890211],[-122.298509,37.890232],[-122.298005,37.890249],[-122.297803,37.889617],[-122.297131,37.887512],[-122.296929,37.886878],[-122.297533,37.886751],[-122.297787,37.886735]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420500","BLOCKCE10":"1008","GEOID10":"060014205001008","NAME10":"Block 1008","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":3061,"AWATER10":0,"INTPTLAT10":"+37.889016","INTPTLON10":"-122.298589"},"geometry":{"type":"Polygon","coordinates":[[[-122.298127,37.887769],[-122.298249,37.887758],[-122.298409,37.888259],[-122.298891,37.889762],[-122.299031,37.890196],[-122.299051,37.890264],[-122.298929,37.890275],[-122.29891,37.890211],[-122.298127,37.887769]]]}}
@@ -212,7 +212,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1020","GEOID10":"060014206001020","NAME10":"Block 1020","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":979,"AWATER10":0,"INTPTLAT10":"+37.883465","INTPTLON10":"-122.286818"},"geometry":{"type":"Polygon","coordinates":[[[-122.286667,37.883996],[-122.286575,37.883979],[-122.286937,37.883026],[-122.286955,37.882968],[-122.28707,37.882903],[-122.287024,37.883045],[-122.286994,37.883123],[-122.286748,37.883777],[-122.286667,37.883996]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1021","GEOID10":"060014206001021","NAME10":"Block 1021","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":18586,"AWATER10":0,"INTPTLAT10":"+37.883462","INTPTLON10":"-122.287583","population":45},"geometry":{"type":"Polygon","coordinates":[[[-122.28707,37.882903],[-122.287096,37.882839],[-122.287175,37.88265],[-122.287202,37.882587],[-122.287302,37.882625],[-122.287602,37.882742],[-122.287702,37.882781],[-122.287934,37.882871],[-122.288512,37.883048],[-122.28805,37.884241],[-122.287809,37.884167],[-122.287601,37.884127],[-122.287462,37.88412],[-122.287183,37.884096],[-122.286667,37.883996],[-122.286748,37.883777],[-122.286994,37.883123],[-122.287024,37.883045],[-122.28707,37.882903]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1022","GEOID10":"060014206001022","NAME10":"Block 1022","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":12213,"AWATER10":0,"INTPTLAT10":"+37.883875","INTPTLON10":"-122.288628","population":31},"geometry":{"type":"Polygon","coordinates":[[[-122.287957,37.884501],[-122.28805,37.884241],[-122.288512,37.883048],[-122.288939,37.883179],[-122.289309,37.883284],[-122.28875,37.88468],[-122.287957,37.884501]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1023","GEOID10":"060014206001023","NAME10":"Block 1023","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15260,"AWATER10":0,"INTPTLAT10":"+37.884009","INTPTLON10":"-122.289530","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.290105,37.883155],[-122.290113,37.883156],[-122.290207,37.883163],[-122.290252,37.883174],[-122.29028,37.883025],[-122.290231,37.883308],[-122.290151,37.883572],[-122.289845,37.884492],[-122.289712,37.884893],[-122.289608,37.884874],[-122.289518,37.884853],[-122.288942,37.884723],[-122.28875,37.88468],[-122.289309,37.883284],[-122.289348,37.883295],[-122.28951,37.88326],[-122.289555,37.883251],[-122.289757,37.883179],[-122.289964,37.883146],[-122.290105,37.883155]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1023","GEOID10":"060014206001023","NAME10":"Block 1023","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":15260,"AWATER10":0,"INTPTLAT10":"+37.884009","INTPTLON10":"-122.289530","population":41},"geometry":{"type":"Polygon","coordinates":[[[-122.290105,37.883155],[-122.290113,37.883156],[-122.290207,37.883163],[-122.290252,37.883174],[-122.29028,37.883025],[-122.290231,37.883308],[-122.290151,37.883572],[-122.289845,37.884492],[-122.289712,37.884893],[-122.289608,37.884874],[-122.289518,37.884853],[-122.288942,37.884723],[-122.28875,37.88468],[-122.289309,37.883284],[-122.289348,37.883295],[-122.28951,37.88326],[-122.28955499999999,37.883251],[-122.289757,37.883179],[-122.289964,37.883146],[-122.290105,37.883155]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1024","GEOID10":"060014206001024","NAME10":"Block 1024","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1201,"AWATER10":0,"INTPTLAT10":"+37.883224","INTPTLON10":"-122.286366","population":1},"geometry":{"type":"Polygon","coordinates":[[[-122.28707,37.882903],[-122.286955,37.882968],[-122.286792,37.883051],[-122.28595,37.883483],[-122.28567,37.883627],[-122.285686,37.883532],[-122.286997,37.882851],[-122.28707,37.882903]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1025","GEOID10":"060014206001025","NAME10":"Block 1025","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1018,"AWATER10":0,"INTPTLAT10":"+37.883871","INTPTLON10":"-122.285076"},"geometry":{"type":"Polygon","coordinates":[[[-122.284459,37.884129],[-122.285686,37.883532],[-122.28567,37.883627],[-122.285434,37.883741],[-122.284726,37.884086],[-122.284491,37.884201],[-122.284477,37.88416],[-122.284459,37.884129]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"1026","GEOID10":"060014206001026","NAME10":"Block 1026","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":63728,"AWATER10":0,"INTPTLAT10":"+37.883493","INTPTLON10":"-122.283797","population":17},"geometry":{"type":"Polygon","coordinates":[[[-122.282764,37.882526],[-122.28279,37.882502],[-122.283012,37.882518],[-122.283671,37.882491],[-122.283757,37.882491],[-122.284107,37.882491],[-122.284953,37.882469],[-122.285078,37.88246],[-122.285271,37.882445],[-122.285376,37.882437],[-122.285853,37.88244],[-122.286048,37.882442],[-122.28596,37.882675],[-122.28583,37.883024],[-122.285729,37.883314],[-122.285715,37.883381],[-122.285686,37.883532],[-122.284459,37.884129],[-122.284156,37.884287],[-122.283797,37.884463],[-122.28334,37.884663],[-122.283126,37.884745],[-122.282866,37.884831],[-122.282557,37.884921],[-122.282408,37.884954],[-122.28226,37.884974],[-122.282104,37.884982],[-122.281994,37.884974],[-122.282288,37.884363],[-122.281902,37.884371],[-122.282009,37.884176],[-122.282569,37.882718],[-122.282764,37.882526]]]}}
@@ -224,7 +224,7 @@
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2000","GEOID10":"060014206002000","NAME10":"Block 2000","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":375,"AWATER10":0,"INTPTLAT10":"+37.890952","INTPTLON10":"-122.286179"},"geometry":{"type":"Polygon","coordinates":[[[-122.286644,37.890897],[-122.286648,37.89094],[-122.286458,37.890953],[-122.28589,37.890992],[-122.285701,37.891006],[-122.285677,37.89097],[-122.286644,37.890897]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2001","GEOID10":"060014206002001","NAME10":"Block 2001","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":14791,"AWATER10":0,"INTPTLAT10":"+37.890209","INTPTLON10":"-122.285901","population":18},"geometry":{"type":"Polygon","coordinates":[[[-122.286644,37.890897],[-122.285677,37.89097],[-122.285601,37.890875],[-122.285573,37.890832],[-122.285555,37.890791],[-122.285532,37.890718],[-122.285239,37.889751],[-122.285164,37.889502],[-122.285376,37.889508],[-122.285594,37.889494],[-122.285989,37.889444],[-122.286149,37.889409],[-122.286233,37.889659],[-122.286558,37.890616],[-122.286628,37.890823],[-122.286644,37.890897]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2002","GEOID10":"060014206002002","NAME10":"Block 2002","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":16691,"AWATER10":0,"INTPTLAT10":"+37.890058","INTPTLON10":"-122.286913","population":13},"geometry":{"type":"Polygon","coordinates":[[[-122.287518,37.890839],[-122.287159,37.890866],[-122.286644,37.890897],[-122.286628,37.890823],[-122.286558,37.890616],[-122.286233,37.889659],[-122.286149,37.889409],[-122.28645,37.889328],[-122.286696,37.889232],[-122.287095,37.889068],[-122.287194,37.889372],[-122.287397,37.889987],[-122.287574,37.890498],[-122.28769,37.890831],[-122.287706,37.890872],[-122.287668,37.890874],[-122.287553,37.890879],[-122.287516,37.890882],[-122.287518,37.890839]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2003","GEOID10":"060014206002003","NAME10":"Block 2003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":446,"AWATER10":0,"INTPTLAT10":"+37.890820","INTPTLON10":"-122.288237"},"geometry":{"type":"Polygon","coordinates":[[[-122.28769,37.890831],[-122.288768,37.890769],[-122.28877,37.890812],[-122.288767,37.890813],[-122.288618,37.890821],[-122.287934,37.890859],[-122.287706,37.890872],[-122.28769,37.890831]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2003","GEOID10":"060014206002003","NAME10":"Block 2003","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":446,"AWATER10":0,"INTPTLAT10":"+37.890820","INTPTLON10":"-122.288237"},"geometry":{"type":"Polygon","coordinates":[[[-122.28769,37.890831],[-122.288768,37.890769],[-122.28877,37.890812],[-122.28876700000001,37.890813],[-122.288618,37.890821],[-122.287934,37.890859],[-122.287706,37.890872],[-122.28769,37.890831]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2004","GEOID10":"060014206002004","NAME10":"Block 2004","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":1970,"AWATER10":0,"INTPTLAT10":"+37.889680","INTPTLON10":"-122.288473"},"geometry":{"type":"Polygon","coordinates":[[[-122.28877,37.890812],[-122.288768,37.890769],[-122.288766,37.890714],[-122.288758,37.890664],[-122.288152,37.888874],[-122.288121,37.888768],[-122.288106,37.888677],[-122.288151,37.888594],[-122.288284,37.888561],[-122.288227,37.888644],[-122.288214,37.888732],[-122.288228,37.888845],[-122.288283,37.889006],[-122.288744,37.89035],[-122.288815,37.890556],[-122.288843,37.890672],[-122.288852,37.890762],[-122.288847,37.890809],[-122.28877,37.890812]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2005","GEOID10":"060014206002005","NAME10":"Block 2005","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":21301,"AWATER10":0,"INTPTLAT10":"+37.889828","INTPTLON10":"-122.287926","population":54},"geometry":{"type":"Polygon","coordinates":[[[-122.28769,37.890831],[-122.287574,37.890498],[-122.287397,37.889987],[-122.287194,37.889372],[-122.287095,37.889068],[-122.287377,37.888939],[-122.287639,37.888837],[-122.288106,37.888677],[-122.288121,37.888768],[-122.288152,37.888874],[-122.288758,37.890664],[-122.288766,37.890714],[-122.288768,37.890769],[-122.28769,37.890831]]]}}
{"type":"Feature","properties":{"STATEFP10":"06","COUNTYFP10":"001","TRACTCE10":"420600","BLOCKCE10":"2006","GEOID10":"060014206002006","NAME10":"Block 2006","MTFCC10":"G5040","UR10":"U","UACE10":"78904","UATYP10":"U","FUNCSTAT10":"S","ALAND10":812,"AWATER10":0,"INTPTLAT10":"+37.888823","INTPTLON10":"-122.287591"},"geometry":{"type":"Polygon","coordinates":[[[-122.288151,37.888594],[-122.288106,37.888677],[-122.287639,37.888837],[-122.287377,37.888939],[-122.287095,37.889068],[-122.287071,37.888996],[-122.287305,37.888887],[-122.287338,37.888873],[-122.2876,37.888771],[-122.287865,37.888681],[-122.288035,37.888629],[-122.288151,37.888594]]]}}
+104
View File
@@ -0,0 +1,104 @@
{ "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
@@ -0,0 +1,104 @@
{ "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
@@ -0,0 +1,13 @@
{ "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
@@ -0,0 +1,5 @@
{"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
@@ -0,0 +1,104 @@
{ "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
@@ -0,0 +1,9 @@
{"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
@@ -0,0 +1,104 @@
{ "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 ] ] ] ] } }
] }
] }
] }
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -352,7 +352,7 @@
,
{ "type": "Feature", "properties": { "SCALERANK": 3, "NATSCALE": 110, "LABELRANK": 2, "FEATURECLA": "Admin-0 capital", "NAME": "Islamabad", "DIFFASCII": 0, "NAMEASCII": "Islamabad", "ADM0CAP": 1, "CAPALT": 0, "WORLDCITY": 0, "MEGACITY": 1, "SOV0NAME": "Pakistan", "SOV_A3": "PAK", "ADM0NAME": "Pakistan", "ADM0_A3": "PAK", "ADM1NAME": "F.C.T.", "ISO_A2": "PK", "LATITUDE": 33.699996, "LONGITUDE": 73.166634, "CHANGED": 0, "NAMEDIFF": 0, "POP_MAX": 780000, "POP_MIN": 601600, "POP_OTHER": 893673, "RANK_MAX": 11, "RANK_MIN": 11, "GEONAMEID": 1176615, "MEGANAME": "Islamabad", "LS_NAME": "Islamabad", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 742356, "MAX_POP20": 742356, "MAX_POP50": 7482035, "MAX_POP300": 7482969, "MAX_POP310": 0, "MAX_NATSCA": 100, "MIN_AREAKM": 772, "MAX_AREAKM": 5463, "MIN_AREAMI": 298, "MAX_AREAMI": 2109, "MIN_PERKM": 545, "MAX_PERKM": 4154, "MIN_PERMI": 339, "MAX_PERMI": 2581, "MIN_BBXMIN": 72.286464, "MAX_BBXMIN": 73.033333, "MIN_BBXMAX": 73.516667, "MAX_BBXMAX": 73.816667, "MIN_BBYMIN": 32.7, "MAX_BBYMIN": 33.258333, "MIN_BBYMAX": 33.766667, "MAX_BBYMAX": 34.533333, "MEAN_BBXC": 73.182617, "MEAN_BBYC": 33.557939, "COMPARE": 0, "GN_ASCII": "Islamabad", "FEATURE_CL": "P", "FEATURE_CO": "PPLC", "ADMIN1_COD": 8, "GN_POP": 601600, "ELEVATION": 0, "GTOPO30": 497, "TIMEZONE": "Asia/Karachi", "GEONAMESNO": "GeoNames match general.", "UN_FID": 401, "UN_ADM0": "Pakistan", "UN_LAT": 33.71, "UN_LONG": 73.06, "POP1950": 36, "POP1955": 41, "POP1960": 45, "POP1965": 56, "POP1970": 70, "POP1975": 107, "POP1980": 189, "POP1985": 260, "POP1990": 343, "POP1995": 452, "POP2000": 594, "POP2005": 732, "POP2010": 780, "POP2015": 851, "POP2020": 988, "POP2025": 1148, "POP2050": 1320 }, "geometry": { "type": "Point", "coordinates": [ 73.125000, 33.724340 ] } }
,
{ "type": "Feature", "properties": { "SCALERANK": 1, "NATSCALE": 300, "LABELRANK": 1, "FEATURECLA": "Admin-0 capital", "NAME": "New Delhi", "DIFFASCII": 0, "NAMEASCII": "New Delhi", "ADM0CAP": 1, "CAPALT": 0, "WORLDCITY": 1, "MEGACITY": 0, "SOV0NAME": "India", "SOV_A3": "IND", "ADM0NAME": "India", "ADM0_A3": "IND", "ADM1NAME": "Delhi", "ISO_A2": "IN", "LATITUDE": 28.600023, "LONGITUDE": 77.19998, "CHANGED": 0, "NAMEDIFF": 0, "POP_MAX": 317797, "POP_MIN": 317797, "POP_OTHER": 8060107, "RANK_MAX": 10, "RANK_MIN": 10, "GEONAMEID": 1261481, "LS_NAME": "New Delhi", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 8761047, "MAX_POP20": 13414375, "MAX_POP50": 32426336, "MAX_POP300": 32424761, "MAX_POP310": 224908923, "MAX_NATSCA": 300, "MIN_AREAKM": 864, "MAX_AREAKM": 186559, "MIN_AREAMI": 334, "MAX_AREAMI": 72030, "MIN_PERKM": 244, "MAX_PERKM": 130296, "MIN_PERMI": 152, "MAX_PERMI": 80962, "MIN_BBXMIN": 71.033333, "MAX_BBXMIN": 76.943289, "MIN_BBXMAX": 77.43183, "MAX_BBXMAX": 82.566667, "MIN_BBYMIN": 24, "MAX_BBYMIN": 28.152007, "MIN_BBYMAX": 28.738629, "MAX_BBYMAX": 33.466667, "MEAN_BBXC": 77.272945, "MEAN_BBYC": 28.382537, "COMPARE": 0, "GN_ASCII": "New Delhi", "FEATURE_CL": "P", "FEATURE_CO": "PPLC", "ADMIN1_COD": 7, "GN_POP": 317797, "ELEVATION": 0, "GTOPO30": 205, "TIMEZONE": "Asia/Kolkata", "GEONAMESNO": "GeoNames match general.", "UN_FID": 0, "UN_LAT": 0, "UN_LONG": 0, "POP1950": 0, "POP1955": 0, "POP1960": 0, "POP1965": 0, "POP1970": 0, "POP1975": 0, "POP1980": 0, "POP1985": 0, "POP1990": 0, "POP1995": 0, "POP2000": 0, "POP2005": 0, "POP2010": 0, "POP2015": 0, "POP2020": 0, "POP2025": 0, "POP2050": 0 }, "geometry": { "type": "Point", "coordinates": [ 77.167969, 28.613459 ] } }
{ "type": "Feature", "properties": { "SCALERANK": 1, "NATSCALE": 300, "LABELRANK": 1, "FEATURECLA": "Admin-0 capital", "NAME": "New Delhi", "DIFFASCII": 0, "NAMEASCII": "New Delhi", "ADM0CAP": 1, "CAPALT": 0, "WORLDCITY": 1, "MEGACITY": 0, "SOV0NAME": "India", "SOV_A3": "IND", "ADM0NAME": "India", "ADM0_A3": "IND", "ADM1NAME": "Delhi", "ISO_A2": "IN", "LATITUDE": 28.600023, "LONGITUDE": 77.19998, "CHANGED": 0, "NAMEDIFF": 0, "POP_MAX": 317797, "POP_MIN": 317797, "POP_OTHER": 8060107, "RANK_MAX": 10, "RANK_MIN": 10, "GEONAMEID": 1261481, "LS_NAME": "New Delhi", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 8761047, "MAX_POP20": 13414375, "MAX_POP50": 32426336, "MAX_POP300": 32424761, "MAX_POP310": 224908923, "MAX_NATSCA": 300, "MIN_AREAKM": 864, "MAX_AREAKM": 186559, "MIN_AREAMI": 334, "MAX_AREAMI": 72030, "MIN_PERKM": 244, "MAX_PERKM": 130296, "MIN_PERMI": 152, "MAX_PERMI": 80962, "MIN_BBXMIN": 71.033333, "MAX_BBXMIN": 76.943289, "MIN_BBXMAX": 77.43183, "MAX_BBXMAX": 82.566667, "MIN_BBYMIN": 24, "MAX_BBYMIN": 28.152007, "MIN_BBYMAX": 28.738629, "MAX_BBYMAX": 33.466667, "MEAN_BBXC": 77.27294500000001, "MEAN_BBYC": 28.382537, "COMPARE": 0, "GN_ASCII": "New Delhi", "FEATURE_CL": "P", "FEATURE_CO": "PPLC", "ADMIN1_COD": 7, "GN_POP": 317797, "ELEVATION": 0, "GTOPO30": 205, "TIMEZONE": "Asia/Kolkata", "GEONAMESNO": "GeoNames match general.", "UN_FID": 0, "UN_LAT": 0, "UN_LONG": 0, "POP1950": 0, "POP1955": 0, "POP1960": 0, "POP1965": 0, "POP1970": 0, "POP1975": 0, "POP1980": 0, "POP1985": 0, "POP1990": 0, "POP1995": 0, "POP2000": 0, "POP2005": 0, "POP2010": 0, "POP2015": 0, "POP2020": 0, "POP2025": 0, "POP2050": 0 }, "geometry": { "type": "Point", "coordinates": [ 77.167969, 28.613459 ] } }
,
{ "type": "Feature", "properties": { "SCALERANK": 3, "NATSCALE": 110, "LABELRANK": 6, "FEATURECLA": "Admin-0 capital", "NAME": "Kathmandu", "DIFFASCII": 0, "NAMEASCII": "Kathmandu", "ADM0CAP": 1, "CAPALT": 0, "WORLDCITY": 0, "MEGACITY": 1, "SOV0NAME": "Nepal", "SOV_A3": "NPL", "ADM0NAME": "Nepal", "ADM0_A3": "NPL", "ADM1NAME": "Bhaktapur", "ISO_A2": "NP", "LATITUDE": 27.716692, "LONGITUDE": 85.316642, "CHANGED": 0, "NAMEDIFF": 0, "POP_MAX": 895000, "POP_MIN": 895000, "POP_OTHER": 1099610, "RANK_MAX": 11, "RANK_MIN": 11, "GEONAMEID": 1283240, "MEGANAME": "Kathmandu", "LS_NAME": "Kathmandu", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 1154222, "MAX_POP20": 2297630, "MAX_POP50": 2297630, "MAX_POP300": 2297630, "MAX_POP310": 0, "MAX_NATSCA": 100, "MIN_AREAKM": 233, "MAX_AREAKM": 580, "MIN_AREAMI": 90, "MAX_AREAMI": 224, "MIN_PERKM": 228, "MAX_PERKM": 511, "MIN_PERMI": 142, "MAX_PERMI": 318, "MIN_BBXMIN": 85.108333, "MAX_BBXMIN": 85.108333, "MIN_BBXMAX": 85.450066, "MAX_BBXMAX": 85.675, "MIN_BBYMIN": 27.541667, "MAX_BBYMIN": 27.669456, "MIN_BBYMAX": 27.85, "MAX_BBYMAX": 27.85, "MEAN_BBXC": 85.356097, "MEAN_BBYC": 27.697735, "COMPARE": 0, "GN_ASCII": "Kathmandu", "FEATURE_CL": "P", "FEATURE_CO": "PPLC", "ADMIN1_COD": 0, "GN_POP": 1442271, "ELEVATION": 1317, "GTOPO30": 1304, "TIMEZONE": "Asia/Kathmandu", "GEONAMESNO": "GeoNames match general.", "UN_FID": 378, "UN_ADM0": "Nepal", "UN_LAT": 27.71, "UN_LONG": 85.31, "POP1950": 104, "POP1955": 110, "POP1960": 119, "POP1965": 132, "POP1970": 147, "POP1975": 180, "POP1980": 225, "POP1985": 297, "POP1990": 398, "POP1995": 509, "POP2000": 644, "POP2005": 815, "POP2010": 895, "POP2015": 1029, "POP2020": 1284, "POP2025": 1578, "POP2050": 1907 }, "geometry": { "type": "Point", "coordinates": [ 85.341797, 27.683528 ] } }
,
@@ -456,7 +456,7 @@
,
{ "type": "Feature", "properties": { "SCALERANK": 3, "NATSCALE": 110, "LABELRANK": 7, "FEATURECLA": "Admin-0 capital", "NAME": "Gaborone", "DIFFASCII": 0, "NAMEASCII": "Gaborone", "ADM0CAP": 1, "CAPALT": 0, "WORLDCITY": 0, "MEGACITY": 0, "SOV0NAME": "Botswana", "SOV_A3": "BWA", "ADM0NAME": "Botswana", "ADM0_A3": "BWA", "ADM1NAME": "South-East", "ISO_A2": "BW", "LATITUDE": -24.646313, "LONGITUDE": 25.911948, "CHANGED": 0, "NAMEDIFF": 0, "POP_MAX": 208411, "POP_MIN": 159243, "POP_OTHER": 158896, "RANK_MAX": 10, "RANK_MIN": 9, "GEONAMEID": 933773, "LS_NAME": "Gaborone", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 159243, "MAX_POP20": 159243, "MAX_POP50": 159243, "MAX_POP300": 159243, "MAX_POP310": 0, "MAX_NATSCA": 100, "MIN_AREAKM": 72, "MAX_AREAKM": 72, "MIN_AREAMI": 28, "MAX_AREAMI": 28, "MIN_PERKM": 59, "MAX_PERKM": 59, "MIN_PERMI": 37, "MAX_PERMI": 37, "MIN_BBXMIN": 25.858333, "MAX_BBXMIN": 25.858333, "MIN_BBXMAX": 25.991667, "MAX_BBXMAX": 25.991667, "MIN_BBYMIN": -24.7, "MAX_BBYMIN": -24.7, "MIN_BBYMAX": -24.6, "MAX_BBYMAX": -24.6, "MEAN_BBXC": 25.925091, "MEAN_BBYC": -24.656793, "COMPARE": 0, "GN_ASCII": "Gaborone", "FEATURE_CL": "P", "FEATURE_CO": "PPLC", "ADMIN1_COD": 9, "GN_POP": 208411, "ELEVATION": 0, "GTOPO30": 1006, "TIMEZONE": "Africa/Gaborone", "GEONAMESNO": "GeoNames match general.", "UN_FID": 0, "UN_LAT": 0, "UN_LONG": 0, "POP1950": 0, "POP1955": 0, "POP1960": 0, "POP1965": 0, "POP1970": 0, "POP1975": 0, "POP1980": 0, "POP1985": 0, "POP1990": 0, "POP1995": 0, "POP2000": 0, "POP2005": 0, "POP2010": 0, "POP2015": 0, "POP2020": 0, "POP2025": 0, "POP2050": 0 }, "geometry": { "type": "Point", "coordinates": [ 25.927734, -24.607069 ] } }
,
{ "type": "Feature", "properties": { "SCALERANK": 1, "NATSCALE": 300, "LABELRANK": 3, "FEATURECLA": "Admin-0 capital", "NAME": "Johannesburg", "DIFFASCII": 0, "NAMEASCII": "Johannesburg", "ADM0CAP": 0, "CAPALT": 0, "WORLDCITY": 1, "MEGACITY": 1, "SOV0NAME": "South Africa", "SOV_A3": "ZAF", "ADM0NAME": "South Africa", "ADM0_A3": "ZAF", "ADM1NAME": "Gauteng", "ISO_A2": "ZA", "LATITUDE": -26.170045, "LONGITUDE": 28.03001, "CHANGED": 4, "NAMEDIFF": 0, "DIFFNOTE": "Changed feature class.", "POP_MAX": 3435000, "POP_MIN": 2026469, "POP_OTHER": 3852246, "RANK_MAX": 12, "RANK_MIN": 12, "GEONAMEID": 993800, "MEGANAME": "Johannesburg", "LS_NAME": "Johannesburg", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 3887168, "MAX_POP20": 5413549, "MAX_POP50": 5413549, "MAX_POP300": 5413549, "MAX_POP310": 5451385, "MAX_NATSCA": 300, "MIN_AREAKM": 1124, "MAX_AREAKM": 1614, "MIN_AREAMI": 434, "MAX_AREAMI": 623, "MIN_PERKM": 497, "MAX_PERKM": 828, "MIN_PERMI": 309, "MAX_PERMI": 514, "MIN_BBXMIN": 27.733333, "MAX_BBXMIN": 27.733333, "MIN_BBXMAX": 28.193693, "MAX_BBXMAX": 28.491667, "MIN_BBYMIN": -26.4, "MAX_BBYMIN": -26.4, "MIN_BBYMAX": -25.991667, "MAX_BBYMAX": -25.941667, "MEAN_BBXC": 28.063712, "MEAN_BBYC": -26.187259, "COMPARE": 0, "GN_ASCII": "Johannesburg", "FEATURE_CL": "P", "FEATURE_CO": "PPLA", "ADMIN1_COD": 6, "GN_POP": 2026469, "ELEVATION": 0, "GTOPO30": 1775, "TIMEZONE": "Africa/Johannesburg", "GEONAMESNO": "GeoNames match general.", "UN_FID": 458, "UN_ADM0": "South Africa", "UN_LAT": -26.17, "UN_LONG": 28, "POP1950": 900, "POP1955": 1016, "POP1960": 1147, "POP1965": 1288, "POP1970": 1444, "POP1975": 1547, "POP1980": 1656, "POP1985": 1773, "POP1990": 1898, "POP1995": 2265, "POP2000": 2732, "POP2005": 3258, "POP2010": 3435, "POP2015": 3618, "POP2020": 3785, "POP2025": 3916, "POP2050": 4041 }, "geometry": { "type": "Point", "coordinates": [ 28.037109, -26.194877 ] } }
{ "type": "Feature", "properties": { "SCALERANK": 1, "NATSCALE": 300, "LABELRANK": 3, "FEATURECLA": "Admin-0 capital", "NAME": "Johannesburg", "DIFFASCII": 0, "NAMEASCII": "Johannesburg", "ADM0CAP": 0, "CAPALT": 0, "WORLDCITY": 1, "MEGACITY": 1, "SOV0NAME": "South Africa", "SOV_A3": "ZAF", "ADM0NAME": "South Africa", "ADM0_A3": "ZAF", "ADM1NAME": "Gauteng", "ISO_A2": "ZA", "LATITUDE": -26.170044999999999, "LONGITUDE": 28.03001, "CHANGED": 4, "NAMEDIFF": 0, "DIFFNOTE": "Changed feature class.", "POP_MAX": 3435000, "POP_MIN": 2026469, "POP_OTHER": 3852246, "RANK_MAX": 12, "RANK_MIN": 12, "GEONAMEID": 993800, "MEGANAME": "Johannesburg", "LS_NAME": "Johannesburg", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 3887168, "MAX_POP20": 5413549, "MAX_POP50": 5413549, "MAX_POP300": 5413549, "MAX_POP310": 5451385, "MAX_NATSCA": 300, "MIN_AREAKM": 1124, "MAX_AREAKM": 1614, "MIN_AREAMI": 434, "MAX_AREAMI": 623, "MIN_PERKM": 497, "MAX_PERKM": 828, "MIN_PERMI": 309, "MAX_PERMI": 514, "MIN_BBXMIN": 27.733333, "MAX_BBXMIN": 27.733333, "MIN_BBXMAX": 28.193693, "MAX_BBXMAX": 28.491667, "MIN_BBYMIN": -26.4, "MAX_BBYMIN": -26.4, "MIN_BBYMAX": -25.991667, "MAX_BBYMAX": -25.941667, "MEAN_BBXC": 28.063712, "MEAN_BBYC": -26.187259, "COMPARE": 0, "GN_ASCII": "Johannesburg", "FEATURE_CL": "P", "FEATURE_CO": "PPLA", "ADMIN1_COD": 6, "GN_POP": 2026469, "ELEVATION": 0, "GTOPO30": 1775, "TIMEZONE": "Africa/Johannesburg", "GEONAMESNO": "GeoNames match general.", "UN_FID": 458, "UN_ADM0": "South Africa", "UN_LAT": -26.17, "UN_LONG": 28, "POP1950": 900, "POP1955": 1016, "POP1960": 1147, "POP1965": 1288, "POP1970": 1444, "POP1975": 1547, "POP1980": 1656, "POP1985": 1773, "POP1990": 1898, "POP1995": 2265, "POP2000": 2732, "POP2005": 3258, "POP2010": 3435, "POP2015": 3618, "POP2020": 3785, "POP2025": 3916, "POP2050": 4041 }, "geometry": { "type": "Point", "coordinates": [ 28.037109, -26.194877 ] } }
,
{ "type": "Feature", "properties": { "SCALERANK": 3, "NATSCALE": 110, "LABELRANK": 3, "FEATURECLA": "Admin-0 capital", "NAME": "Bloemfontein", "DIFFASCII": 0, "NAMEASCII": "Bloemfontein", "ADM0CAP": 1, "CAPALT": 0, "CAPIN": "Judicial capita", "WORLDCITY": 0, "MEGACITY": 0, "SOV0NAME": "South Africa", "SOV_A3": "ZAF", "ADM0NAME": "South Africa", "ADM0_A3": "ZAF", "ADM1NAME": "Orange Free State", "ISO_A2": "ZA", "LATITUDE": -29.119994, "LONGITUDE": 26.229913, "CHANGED": 4, "NAMEDIFF": 0, "DIFFNOTE": "Changed scale rank.", "POP_MAX": 463064, "POP_MIN": 456669, "POP_OTHER": 456513, "RANK_MAX": 10, "RANK_MIN": 10, "GEONAMEID": 1018725, "LS_NAME": "Bloemfontein", "LS_MATCH": 1, "CHECKME": 0, "MAX_POP10": 456669, "MAX_POP20": 456669, "MAX_POP50": 456669, "MAX_POP300": 0, "MAX_POP310": 0, "MAX_NATSCA": 50, "MIN_AREAKM": 105, "MAX_AREAKM": 105, "MIN_AREAMI": 40, "MAX_AREAMI": 40, "MIN_PERKM": 78, "MAX_PERKM": 78, "MIN_PERMI": 48, "MAX_PERMI": 48, "MIN_BBXMIN": 26.166667, "MAX_BBXMIN": 26.166667, "MIN_BBXMAX": 26.3, "MAX_BBXMAX": 26.3, "MIN_BBYMIN": -29.2, "MAX_BBYMIN": -29.2, "MIN_BBYMAX": -29.058333, "MAX_BBYMAX": -29.058333, "MEAN_BBXC": 26.225714, "MEAN_BBYC": -29.128155, "COMPARE": 0, "GN_ASCII": "Bloemfontein", "FEATURE_CL": "P", "FEATURE_CO": "PPLA", "ADMIN1_COD": 3, "GN_POP": 463064, "ELEVATION": 0, "GTOPO30": 1398, "TIMEZONE": "Africa/Johannesburg", "GEONAMESNO": "GeoNames match general.", "UN_FID": 0, "UN_LAT": 0, "UN_LONG": 0, "POP1950": 0, "POP1955": 0, "POP1960": 0, "POP1965": 0, "POP1970": 0, "POP1975": 0, "POP1980": 0, "POP1985": 0, "POP1990": 0, "POP1995": 0, "POP2000": 0, "POP2005": 0, "POP2010": 0, "POP2015": 0, "POP2020": 0, "POP2025": 0, "POP2050": 0 }, "geometry": { "type": "Point", "coordinates": [ 26.191406, -29.152161 ] } }
,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
"description": "tests/ne_110m_populated_places_nulls/out/-z1_--accumulate-attribute_POP2000%3amean_-yNAME_-yPOP2000.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/ne_110m_populated_places_nulls/out/-z1_--accumulate-attribute_POP2000%3amean_-yNAME_-yPOP2000.json.check.mbtiles -z1 --accumulate-attribute POP2000:mean -yNAME -yPOP2000 tests/ne_110m_populated_places_nulls/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":1,\"fields\":{\"NAME\":\"String\",\"POP2000\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":243,\"geometry\":\"Point\",\"attributeCount\":2,\"attributes\":[{\"attribute\":\"NAME\",\"count\":243,\"type\":\"string\",\"values\":[\"Abidjan\",\"Abu Dhabi\",\"Abuja\",\"Accra\",\"Addis Ababa\",\"Algiers\",\"Amman\",\"Amsterdam\",\"Andorra\",\"Ankara\",\"Antananarivo\",\"Apia\",\"Ashgabat\",\"Asmara\",\"Astana\",\"Asuncion\",\"Athens\",\"Atlanta\",\"Auckland\",\"Baghdad\",\"Baguio City\",\"Baku\",\"Bamako\",\"Bandar Seri Begawan\",\"Bangalore\",\"Bangkok\",\"Bangui\",\"Banjul\",\"Basseterre\",\"Beijing\",\"Beirut\",\"Belgrade\",\"Belmopan\",\"Berlin\",\"Bern\",\"Bir Lehlou\",\"Bishkek\",\"Bissau\",\"Bloemfontein\",\"Bogota\",\"Brasilia\",\"Bratislava\",\"Brazzaville\",\"Bridgetown\",\"Brussels\",\"Bucharest\",\"Budapest\",\"Buenos Aires\",\"Bujumbura\",\"Cairo\",\"Canberra\",\"Cape Town\",\"Caracas\",\"Casablanca\",\"Castries\",\"Chengdu\",\"Chicago\",\"Chisinau\",\"Colombo\",\"Conakry\",\"Cotonou\",\"Dakar\",\"Damascus\",\"Dar es Salaam\",\"Denver\",\"Dhaka\",\"Dili\",\"Djibouti\",\"Dodoma\",\"Doha\",\"Dubai\",\"Dublin\",\"Dushanbe\",\"Freetown\",\"Funafuti\",\"Gaborone\",\"Geneva\",\"Georgetown\",\"Guatemala\",\"Hanoi\",\"Harare\",\"Hargeysa\",\"Havana\",\"Helsinki\",\"Hong Kong\",\"Honiara\",\"Houston\",\"Islamabad\",\"Istanbul\",\"Jakarta\",\"Jerusalem\",\"Johannesburg\",\"Juba\",\"Kabul\",\"Kampala\",\"Kathmandu\",\"Khartoum\",\"Kiev\",\"Kigali\",\"Kingston\"]},{\"attribute\":\"POP2000\",\"count\":185,\"type\":\"number\",\"values\":[10016,1005,1007,10151,1019,1023,10285,1032,1050.6666666666667,10534,1063,1072,1073,1077,1079,10803,1084,10897.5,1096,1097,1100,1110,1111,11165,1127,1128,1160,1172,11814,11847,1192,1201,1206,1219,1233,1278.5,13058,1306,13243,1357,1361,1365,1369,1379,1390,1452.5,14572,1487,1499,1507,1561,1606,16086,1653,1666,1674,1700,17099,1730,1733,1765.5,17846,1787,18022,1806,1854,1877,1894.3333333333333,1912,1949,1959,1963,1998,2029,2044,2116,2135,2158,2187,2233,2278,2456,2478,2489.3333333333335,2493,2533,2591,2597.5,2606,2640,2672,2715,2732,2746,2752,2754,2864,3032,3043,3076],\"min\":497,\"max\":34450}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":1,\"fields\":{\"NAME\":\"String\",\"POP2000\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":243,\"geometry\":\"Point\",\"attributeCount\":2,\"attributes\":[{\"attribute\":\"NAME\",\"count\":243,\"type\":\"string\",\"values\":[\"Abidjan\",\"Abu Dhabi\",\"Abuja\",\"Accra\",\"Addis Ababa\",\"Algiers\",\"Amman\",\"Amsterdam\",\"Andorra\",\"Ankara\",\"Antananarivo\",\"Apia\",\"Ashgabat\",\"Asmara\",\"Astana\",\"Asuncion\",\"Athens\",\"Atlanta\",\"Auckland\",\"Baghdad\",\"Baguio City\",\"Baku\",\"Bamako\",\"Bandar Seri Begawan\",\"Bangalore\",\"Bangkok\",\"Bangui\",\"Banjul\",\"Basseterre\",\"Beijing\",\"Beirut\",\"Belgrade\",\"Belmopan\",\"Berlin\",\"Bern\",\"Bir Lehlou\",\"Bishkek\",\"Bissau\",\"Bloemfontein\",\"Bogota\",\"Brasilia\",\"Bratislava\",\"Brazzaville\",\"Bridgetown\",\"Brussels\",\"Bucharest\",\"Budapest\",\"Buenos Aires\",\"Bujumbura\",\"Cairo\",\"Canberra\",\"Cape Town\",\"Caracas\",\"Casablanca\",\"Castries\",\"Chengdu\",\"Chicago\",\"Chisinau\",\"Colombo\",\"Conakry\",\"Cotonou\",\"Dakar\",\"Damascus\",\"Dar es Salaam\",\"Denver\",\"Dhaka\",\"Dili\",\"Djibouti\",\"Dodoma\",\"Doha\",\"Dubai\",\"Dublin\",\"Dushanbe\",\"Freetown\",\"Funafuti\",\"Gaborone\",\"Geneva\",\"Georgetown\",\"Guatemala\",\"Hanoi\",\"Harare\",\"Hargeysa\",\"Havana\",\"Helsinki\",\"Hong Kong\",\"Honiara\",\"Houston\",\"Islamabad\",\"Istanbul\",\"Jakarta\",\"Jerusalem\",\"Johannesburg\",\"Juba\",\"Kabul\",\"Kampala\",\"Kathmandu\",\"Khartoum\",\"Kiev\",\"Kigali\",\"Kingston\"]},{\"attribute\":\"POP2000\",\"count\":185,\"type\":\"number\",\"values\":[10016,1005,1007,10151,1019,1023,10285,1032,1050.6666666666668,10534,1063,1072,1073,1077,1079,10803,1084,10897.5,1096,1097,1100,1110,1111,11165,1127,1128,1160,1172,11814,11847,1192,1201,1206,1219,1233,1278.5,13058,1306,13243,1357,1361,1365,1369,1379,1390,1452.5,14572,1487,1499,1507,1561,1606,16086,1653,1666,1674,1700,17099,1730,1733,1765.5,17846,1787,18022,1806,1854,1877,1894.3333333333333,1912,1949,1959,1963,1998,2029,2044,2116,2135,2158,2187,2233,2278,2456,2478,2489.3333333333337,2493,2533,2591,2597.5,2606,2640,2672,2715,2732,2746,2752,2754,2864,3032,3043,3076],\"min\":497,\"max\":34450}]}]}}",
"maxzoom": "1",
"minzoom": "0",
"name": "tests/ne_110m_populated_places_nulls/out/-z1_--accumulate-attribute_POP2000%3amean_-yNAME_-yPOP2000.json.check.mbtiles",
@@ -31,11 +31,11 @@
,
{ "type": "Feature", "properties": { "NAME": "Belmopan", "POP2000": 793 }, "geometry": { "type": "Point", "coordinates": [ -88.769531, 17.224758 ] } }
,
{ "type": "Feature", "properties": { "NAME": "San Salvador", "POP2000": 1050.6666666666667 }, "geometry": { "type": "Point", "coordinates": [ -89.208984, 13.667338 ] } }
{ "type": "Feature", "properties": { "NAME": "San Salvador", "POP2000": 1050.6666666666668 }, "geometry": { "type": "Point", "coordinates": [ -89.208984, 13.667338 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Panama City", "POP2000": 1072 }, "geometry": { "type": "Point", "coordinates": [ -79.541016, 8.928487 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Port-au-Prince", "POP2000": 3287.6666666666665 }, "geometry": { "type": "Point", "coordinates": [ -72.333984, 18.562947 ] } }
{ "type": "Feature", "properties": { "NAME": "Port-au-Prince", "POP2000": 3287.6666666666667 }, "geometry": { "type": "Point", "coordinates": [ -72.333984, 18.562947 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Basseterre" }, "geometry": { "type": "Point", "coordinates": [ -62.666016, 17.308688 ] } }
,
@@ -51,7 +51,7 @@
,
{ "type": "Feature", "properties": { "NAME": "Laayoune", "POP2000": 2672 }, "geometry": { "type": "Point", "coordinates": [ -13.183594, 27.137368 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Casablanca", "POP2000": 3198.3333333333335 }, "geometry": { "type": "Point", "coordinates": [ -7.558594, 33.578015 ] } }
{ "type": "Feature", "properties": { "NAME": "Casablanca", "POP2000": 3198.3333333333337 }, "geometry": { "type": "Point", "coordinates": [ -7.558594, 33.578015 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Bir Lehlou", "POP2000": 2029 }, "geometry": { "type": "Point", "coordinates": [ -9.667969, 26.115986 ] } }
,
@@ -67,7 +67,7 @@
,
{ "type": "Feature", "properties": { "NAME": "Quito", "POP2000": 4236.5 }, "geometry": { "type": "Point", "coordinates": [ -78.486328, -0.263671 ] } }
,
{ "type": "Feature", "properties": { "NAME": "La Paz", "POP2000": 2489.3333333333335 }, "geometry": { "type": "Point", "coordinates": [ -68.115234, -16.551962 ] } }
{ "type": "Feature", "properties": { "NAME": "La Paz", "POP2000": 2489.3333333333337 }, "geometry": { "type": "Point", "coordinates": [ -68.115234, -16.551962 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Sucre", "POP2000": 2746 }, "geometry": { "type": "Point", "coordinates": [ -65.214844, -19.062118 ] } }
,
@@ -139,7 +139,7 @@
,
{ "type": "Feature", "properties": { "NAME": "Tashkent", "POP2000": 1452.5 }, "geometry": { "type": "Point", "coordinates": [ 69.345703, 41.310824 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Urumqi", "POP2000": 3554.6666666666665 }, "geometry": { "type": "Point", "coordinates": [ 87.626953, 43.771094 ] } }
{ "type": "Feature", "properties": { "NAME": "Urumqi", "POP2000": 3554.6666666666667 }, "geometry": { "type": "Point", "coordinates": [ 87.626953, 43.771094 ] } }
,
{ "type": "Feature", "properties": { "NAME": "Kuwait", "POP2000": 2533 }, "geometry": { "type": "Point", "coordinates": [ 47.988281, 29.382175 ] } }
,
+5 -5
View File
@@ -5,7 +5,7 @@
"description": "tests/overflow/out/-z0.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/overflow/out/-z0.json.check.mbtiles -z0 tests/overflow/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"excess\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":15,\"geometry\":\"Point\",\"attributeCount\":1,\"attributes\":[{\"attribute\":\"excess\",\"count\":14,\"type\":\"number\",\"values\":[-18446744073709552000,-2147483647,-2147483648,-9223372036854775807,-9223372036854775808,18446744073709551615,18446744073709552000,2.2222222222222222e+291,2.2e+292,2.5,2147483647,2147483648,9223372036854775807,9223372036854775808],\"min\":-18446744073709552000,\"max\":2.2e+292}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"excess\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":15,\"geometry\":\"Point\",\"attributeCount\":1,\"attributes\":[{\"attribute\":\"excess\",\"count\":14,\"type\":\"number\",\"values\":[-18446744073709553000,-2147483647,-2147483648,-9223372036854775807,-9223372036854775808,18446744073709551615,18446744073709553000,2.2222222222222223e+291,2.2e+292,2.5,2147483647,2147483648,9223372036854775807,9223372036854775808],\"min\":-18446744073709553000,\"max\":2.2e+292}]}]}}",
"maxzoom": "0",
"minzoom": "0",
"name": "tests/overflow/out/-z0.json.check.mbtiles",
@@ -14,7 +14,7 @@
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "excess": 2.2222222222222222e+291 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
{ "type": "Feature", "properties": { "excess": 2.2222222222222223e+291 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
{ "type": "Feature", "properties": { "excess": 2.2e+292 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
@@ -28,13 +28,13 @@
,
{ "type": "Feature", "properties": { "excess": -2147483647 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
{ "type": "Feature", "properties": { "excess": 18446744073709552000 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
{ "type": "Feature", "properties": { "excess": 18446744073709553000 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
{ "type": "Feature", "properties": { "excess": -18446744073709552000 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
{ "type": "Feature", "properties": { "excess": -18446744073709553000 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
{ "type": "Feature", "id": 18446744073709551615, "properties": { "excess": 18446744073709551615 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
{ "type": "Feature", "properties": { "excess": -18446744073709552000 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
{ "type": "Feature", "properties": { "excess": -18446744073709553000 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
{ "type": "Feature", "id": 9223372036854775808, "properties": { "excess": 9223372036854775808 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
,
+2 -2
View File
@@ -5,7 +5,7 @@
"description": "tests/stringid/out/-z0.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/stringid/out/-z0.json.check.mbtiles -z0 tests/stringid/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":5,\"type\":\"mixed\",\"values\":[\"01005\",\"27\",27,27.5,9.823748927348928e+55],\"min\":27,\"max\":9.823748927348928e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":5,\"type\":\"mixed\",\"values\":[\"01005\",\"27\",27,27.5,9.823748927348929e+55],\"min\":27,\"max\":9.823748927348929e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"maxzoom": "0",
"minzoom": "0",
"name": "tests/stringid/out/-z0.json.check.mbtiles",
@@ -32,7 +32,7 @@
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27.5, "something": false }, "geometry": { "type": "Point", "coordinates": [ 8.964844, 0.966751 ] } }
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348928e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348929e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
,
{ "type": "Feature", "properties": { "yes": "no", "special": 27, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 0.966751 ] } }
,
@@ -5,7 +5,7 @@
"description": "tests/stringid/out/-z0_--use-attribute-for-id_special.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/stringid/out/-z0_--use-attribute-for-id_special.json.check.mbtiles -z0 --use-attribute-for-id special tests/stringid/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":4,\"type\":\"mixed\",\"values\":[\"01005\",\"27\",27.5,9.823748927348928e+55],\"min\":27.5,\"max\":9.823748927348928e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":4,\"type\":\"mixed\",\"values\":[\"01005\",\"27\",27.5,9.823748927348929e+55],\"min\":27.5,\"max\":9.823748927348929e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"maxzoom": "0",
"minzoom": "0",
"name": "tests/stringid/out/-z0_--use-attribute-for-id_special.json.check.mbtiles",
@@ -32,7 +32,7 @@
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27.5, "something": false }, "geometry": { "type": "Point", "coordinates": [ 8.964844, 0.966751 ] } }
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348928e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348929e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
,
{ "type": "Feature", "id": 27, "properties": { "yes": "no", "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 0.966751 ] } }
,
+2 -2
View File
@@ -5,7 +5,7 @@
"description": "tests/stringid/out/-z0_-aI.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/stringid/out/-z0_-aI.json.check.mbtiles -z0 -aI tests/stringid/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":5,\"type\":\"mixed\",\"values\":[\"01005\",\"27\",27,27.5,9.823748927348928e+55],\"min\":27,\"max\":9.823748927348928e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":5,\"type\":\"mixed\",\"values\":[\"01005\",\"27\",27,27.5,9.823748927348929e+55],\"min\":27,\"max\":9.823748927348929e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"maxzoom": "0",
"minzoom": "0",
"name": "tests/stringid/out/-z0_-aI.json.check.mbtiles",
@@ -32,7 +32,7 @@
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27.5, "something": false }, "geometry": { "type": "Point", "coordinates": [ 8.964844, 0.966751 ] } }
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348928e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348929e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
,
{ "type": "Feature", "properties": { "yes": "no", "special": 27, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 0.966751 ] } }
,
@@ -5,7 +5,7 @@
"description": "tests/stringid/out/-z0_-aI_--use-attribute-for-id_special.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/stringid/out/-z0_-aI_--use-attribute-for-id_special.json.check.mbtiles -z0 -aI --use-attribute-for-id special tests/stringid/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Number\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":2,\"type\":\"number\",\"values\":[27.5,9.823748927348928e+55],\"min\":27.5,\"max\":9.823748927348928e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Number\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":12,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":2,\"type\":\"number\",\"values\":[27.5,9.823748927348929e+55],\"min\":27.5,\"max\":9.823748927348929e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
"maxzoom": "0",
"minzoom": "0",
"name": "tests/stringid/out/-z0_-aI_--use-attribute-for-id_special.json.check.mbtiles",
@@ -32,7 +32,7 @@
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27.5, "something": false }, "geometry": { "type": "Point", "coordinates": [ 8.964844, 0.966751 ] } }
,
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348928e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348929e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
,
{ "type": "Feature", "id": 27, "properties": { "yes": "no", "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 0.966751 ] } }
,
+13 -1
View File
@@ -5,7 +5,8 @@
#include <ctype.h>
#include <vector>
#include "text.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "milo/milo.h"
#include "errors.hpp"
/**
@@ -175,6 +176,17 @@ std::string format_commandline(int argc, char **argv) {
return out;
}
// for jsonpull to call from C
char *dtoa_milo(double val) {
std::string s = milo::dtoa_milo(val);
char *dup = strdup(s.c_str());
if (dup == NULL) {
perror("strdup");
exit(EXIT_MEMORY);
}
return dup;
}
// to work with data from https://github.com/kmike/text-unidecode
std::vector<std::string> read_unidecode(const char *fname) {
std::string data;
+75 -58
View File
@@ -24,6 +24,7 @@
#include <math.h>
#include <pthread.h>
#include "mvt.hpp"
#include "mlt.hpp"
#include "projection.hpp"
#include "mbtiles.hpp"
#include "geometry.hpp"
@@ -39,7 +40,7 @@
#include <algorithm>
#include <functional>
#include "jsonpull/jsonpull.h"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
#include "geometry.hpp"
#include "thread.hpp"
@@ -336,7 +337,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) {
@@ -872,7 +873,7 @@ void *join_worker(void *v) {
}
if (anything) {
std::string pbf = outtile.encode();
std::string pbf = encode_tile(outtile, output_format);
std::string compressed;
if (!pC) {
@@ -959,51 +960,51 @@ 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);
dir_write_tile(outdir, ai->first.z, ai->first.x, ai->first.y, ai->second, tile_format_extension(output_format));
}
}
}
}
void handle_strategies(const unsigned char *s, std::vector<strategy> *st) {
json_pull_ptr jp = json_begin_string((const char *) s);
json_object_ptr o = json_read_tree(jp);
json_pull *jp = json_begin_string((const char *) s);
json_object *o = json_read_tree(jp);
if (o != nullptr && o->type == JSON_ARRAY) {
for (size_t i = 0; i < o->array().size(); i++) {
const json_object_ptr &h = o->array()[i];
if (o != NULL && o->type == JSON_ARRAY) {
for (size_t i = 0; i < o->value.array.length; i++) {
json_object *h = o->value.array.array[i];
if (h->type == JSON_HASH) {
for (size_t j = 0; j < h->entries().size(); j++) {
const auto &kv = h->entries()[j];
for (size_t j = 0; j < h->value.object.length; j++) {
json_object *k = h->value.object.keys[j];
json_object *v = h->value.object.values[j];
if (kv.key->type != JSON_STRING) {
if (k->type != JSON_STRING) {
fprintf(stderr, "Key %zu of %zu is not a string: %s\n", j, i, s);
} else if (kv.value->type != JSON_NUMBER) {
} else if (v->type != JSON_NUMBER) {
fprintf(stderr, "Value %zu of %zu is not a number: %s\n", j, i, s);
} else {
if (i >= st->size()) {
st->resize(i + 1);
}
const std::string &key = kv.key->string();
if (key == "dropped_by_rate") {
(*st)[i].dropped_by_rate += kv.value->number();
} else if (key == "dropped_by_gamma") {
(*st)[i].dropped_by_gamma += kv.value->number();
} else if (key == "dropped_as_needed") {
(*st)[i].dropped_as_needed += kv.value->number();
} else if (key == "coalesced_as_needed") {
(*st)[i].coalesced_as_needed += kv.value->number();
} else if (key == "truncated_zooms") {
(*st)[i].truncated_zooms += kv.value->number();
} else if (key == "detail_reduced") {
(*st)[i].detail_reduced += kv.value->number();
} else if (key == "tiny_polygons") {
(*st)[i].tiny_polygons += kv.value->number();
} else if (key == "tile_size_desired") {
(*st)[i].tile_size += kv.value->number();
} else if (key == "feature_count_desired") {
(*st)[i].feature_count += kv.value->number();
if (strcmp(k->value.string.string, "dropped_by_rate") == 0) {
(*st)[i].dropped_by_rate += v->value.number.number;
} else if (strcmp(k->value.string.string, "dropped_by_gamma") == 0) {
(*st)[i].dropped_by_gamma += v->value.number.number;
} else if (strcmp(k->value.string.string, "dropped_as_needed") == 0) {
(*st)[i].dropped_as_needed += v->value.number.number;
} else if (strcmp(k->value.string.string, "coalesced_as_needed") == 0) {
(*st)[i].coalesced_as_needed += v->value.number.number;
} else if (strcmp(k->value.string.string, "truncated_zooms") == 0) {
(*st)[i].truncated_zooms += v->value.number.number;
} else if (strcmp(k->value.string.string, "detail_reduced") == 0) {
(*st)[i].detail_reduced += v->value.number.number;
} else if (strcmp(k->value.string.string, "tiny_polygons") == 0) {
(*st)[i].tiny_polygons += v->value.number.number;
} else if (strcmp(k->value.string.string, "tile_size_desired") == 0) {
(*st)[i].tile_size += v->value.number.number;
} else if (strcmp(k->value.string.string, "feature_count_desired") == 0) {
(*st)[i].feature_count += v->value.number.number;
}
}
}
@@ -1011,19 +1012,22 @@ void handle_strategies(const unsigned char *s, std::vector<strategy> *st) {
fprintf(stderr, "Element %zu is not a hash: %s\n", i, s);
}
}
json_free(o);
}
json_end(jp);
}
void handle_vector_layers(json_object *vector_layers, std::map<std::string, layermap_entry> &layermap, std::map<std::string, std::string> &attribute_descriptions) {
if (vector_layers != nullptr && vector_layers->type == JSON_ARRAY) {
for (size_t i = 0; i < vector_layers->array().size(); i++) {
if (vector_layers->array()[i]->type == JSON_HASH) {
json_object *id = json_hash_get(vector_layers->array()[i].get(), "id");
json_object *desc = json_hash_get(vector_layers->array()[i].get(), "description");
if (vector_layers != NULL && vector_layers->type == JSON_ARRAY) {
for (size_t i = 0; i < vector_layers->value.array.length; i++) {
if (vector_layers->value.array.array[i]->type == JSON_HASH) {
json_object *id = json_hash_get(vector_layers->value.array.array[i], "id");
json_object *desc = json_hash_get(vector_layers->value.array.array[i], "description");
if (id != nullptr && desc != nullptr && id->type == JSON_STRING && desc->type == JSON_STRING) {
const std::string &sid = id->string();
const std::string &sdesc = desc->string();
if (id != NULL && desc != NULL && id->type == JSON_STRING && desc->type == JSON_STRING) {
std::string sid = id->value.string.string;
std::string sdesc = desc->value.string.string;
if (sdesc.size() != 0) {
auto f = layermap.find(sid);
@@ -1033,18 +1037,17 @@ void handle_vector_layers(json_object *vector_layers, std::map<std::string, laye
}
}
json_object *fields = json_hash_get(vector_layers->array()[i].get(), "fields");
if (fields != nullptr && fields->type == JSON_HASH) {
for (const auto &e : fields->entries()) {
if (e.key != nullptr && e.key->type == JSON_STRING &&
e.value != nullptr && e.value->type == JSON_STRING) {
const std::string &desc2 = e.value->string();
json_object *fields = json_hash_get(vector_layers->value.array.array[i], "fields");
if (fields != NULL && fields->type == JSON_HASH) {
for (size_t j = 0; j < fields->value.object.length; j++) {
if (fields->value.object.keys[j]->type == JSON_STRING && fields->value.object.values[j]->type) {
const char *desc2 = fields->value.object.values[j]->value.string.string;
if (desc2 != "Number" &&
desc2 != "String" &&
desc2 != "Boolean" &&
desc2 != "Mixed") {
attribute_descriptions.insert(std::pair<std::string, std::string>(e.key->string(), desc2));
if (strcmp(desc2, "Number") != 0 &&
strcmp(desc2, "String") != 0 &&
strcmp(desc2, "Boolean") != 0 &&
strcmp(desc2, "Mixed") != 0) {
attribute_descriptions.insert(std::pair<std::string, std::string>(fields->value.object.keys[j]->value.string.string, desc2));
}
}
}
@@ -1204,14 +1207,17 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
const unsigned char *s = sqlite3_column_text(stmt, 0);
if (s != NULL) {
json_pull_ptr jp = json_begin_string((const char *) s);
json_object_ptr o = json_read_tree(jp);
json_pull *jp = json_begin_string((const char *) s);
json_object *o = json_read_tree(jp);
if (o != nullptr && o->type == JSON_HASH) {
if (o != NULL && o->type == JSON_HASH) {
json_object *vector_layers = json_hash_get(o, "vector_layers");
handle_vector_layers(vector_layers, layermap, attribute_descriptions);
json_free(o);
}
json_end(jp);
}
}
@@ -1293,6 +1299,9 @@ 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, '~'},
@@ -1335,7 +1344,7 @@ int main(int argc, char **argv) {
int force = 0;
int ifmatched = 0;
int filearg = 0;
json_object_ptr filter;
json_object *filter = NULL;
std::string join_sqlite_fname;
@@ -1535,6 +1544,12 @@ 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);
@@ -1616,7 +1631,7 @@ int main(int argc, char **argv) {
std::string generator_options;
std::vector<strategy> strategies;
decode(readers, layermap, outdb, out_dir, &st, header, mapping, db, exclude, include, ifmatched, attribution, description, keep_layers, remove_layers, name, filter.get(), attribute_descriptions, generator_options, &strategies);
decode(readers, layermap, outdb, out_dir, &st, header, mapping, db, exclude, include, ifmatched, attribution, description, keep_layers, remove_layers, name, filter, attribute_descriptions, generator_options, &strategies);
if (set_attribution.size() != 0) {
attribution = set_attribution;
@@ -1656,7 +1671,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, true, 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, tile_format_name(output_format), 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);
@@ -1668,7 +1683,9 @@ int main(int argc, char **argv) {
mbtiles_close(outdb, argv[0]);
}
filter.reset();
if (filter != NULL) {
json_free(filter);
}
if (pmtiles_has_suffix(out_mbtiles)) {
mbtiles_map_image_to_pmtiles(out_mbtiles, m, !pC, quiet, false);
+44 -100
View File
@@ -39,8 +39,9 @@
#include "serial.hpp"
#include "options.hpp"
#include "main.hpp"
#include "mlt.hpp"
#include "write_json.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "evaluator.hpp"
#include "errors.hpp"
#include "compression.hpp"
@@ -48,7 +49,11 @@
#include "attribute.hpp"
#include "thread.hpp"
#include "shared_borders.hpp"
extern "C" {
#include "jsonpull/jsonpull.h"
}
#include "plugin.hpp"
#define CMD_BITS 3
@@ -534,6 +539,7 @@ struct simplification_worker_arg {
std::vector<std::shared_ptr<serial_feature>> *features = NULL;
int task = 0;
int tasks = 0;
bool trying_to_stop_early = false;
drawvec *shared_nodes;
node *shared_nodes_map;
@@ -668,7 +674,9 @@ static void *simplification_worker(void *v) {
for (size_t i = a->task; i < (*features).size(); i += a->tasks) {
double area = 0;
area = simplify_feature(&*((*features)[i]), *(a->shared_nodes), a->shared_nodes_map, a->nodepos, *(a->shared_nodes_bloom));
if (!a->trying_to_stop_early) {
area = simplify_feature(&*((*features)[i]), *(a->shared_nodes), a->shared_nodes_map, a->nodepos, *(a->shared_nodes_bloom));
}
signed char t = (*features)[i]->t;
int z = (*features)[i]->z;
@@ -683,18 +691,20 @@ static void *simplification_worker(void *v) {
{
drawvec before = geom;
// we can try scaling up because this is now tile scale
coalesce_polygon(geom, true);
if (additional[A_DEBUG_POLYGON]) {
check_polygon(geom);
}
if (!a->trying_to_stop_early) {
// we can try scaling up because this is now tile scale
coalesce_polygon(geom, true);
if (additional[A_DEBUG_POLYGON]) {
check_polygon(geom);
}
if (geom.size() < 3) {
if (area > 0) {
// area is in world coordinates, calculated before scaling down
geom = revive_polygon(before, area, z, out_detail);
} else {
geom.clear();
if (geom.size() < 3) {
if (area > 0) {
// area is in world coordinates, calculated before scaling down
geom = revive_polygon(before, area, z, out_detail);
} else {
geom.clear();
}
}
}
}
@@ -823,7 +833,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--;
}
@@ -836,7 +846,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;
}
@@ -917,12 +927,8 @@ struct write_tile_args {
long long minextent_out = 0;
unsigned long long mindrop_sequence = 0;
unsigned long long mindrop_sequence_out = 0;
// the infinity that excludes nothing, for the ascending order that
// drop_by_attribute_descending also defaults to. dropping_features()
// reads these, so they must not start out at a value that looks like
// a threshold that has already been chosen.
double minattribute = -HUGE_VAL;
double minattribute_out = -HUGE_VAL;
double minattribute = 0;
double minattribute_out = 0;
std::string const *drop_by_attribute_as_needed_attribute = NULL;
bool drop_by_attribute_descending = false;
size_t tile_size_out = 0;
@@ -944,26 +950,8 @@ struct write_tile_args {
std::string const *shared_nodes_bloom;
std::set<zxy> const *skip_children; // what is being skipped at this zoom
std::set<zxy> skip_children_out; // what will be skipped in the next zoom
bool first_dropping_pass = false; // is this the first pass of this zoom that is dropping features?
};
// Is this zoom level discarding features to make its tiles fit? The thresholds
// start out excluding nothing, and only move inward once some tile in the zoom
// fails to fit and the whole zoom is retried with a threshold for discarding
// features. For mingap, minextent, and mindrop_sequence that starting point is
// zero; for minattribute it is the infinity on whichever side is being kept.
//
// Pyramid truncation is disabled while this is true, so that every tile in the
// zoom is reduced consistently, and tiles that were skipped because an ancestor
// truncated its pyramid are revived.
static bool dropping_features(unsigned long long mingap, long long minextent, unsigned long long mindrop_sequence, double minattribute, bool drop_by_attribute_descending) {
bool dropping_by_attribute = drop_by_attribute_descending
? minattribute != HUGE_VAL
: minattribute != -HUGE_VAL;
return mingap != 0 || minextent != 0 || mindrop_sequence != 0 || dropping_by_attribute;
}
// Clips a feature's geometry to the tile bounds at the specified zoom level
// with the specified buffer. Returns true if the feature was entirely clipped away
// by bounding box alone; otherwise returns false.
@@ -1115,7 +1103,7 @@ struct next_feature_state {
// This function is called repeatedly from write_tile() to retrieve the next feature
// from the input stream. If the stream is at an end, it returns a feature with the
// geometry type set to -2.
static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *geompos_in, int z, unsigned tx, unsigned ty, unsigned *initial_x, unsigned *initial_y, long long *original_features, long long *unclipped_features, int nextzoom, int maxzoom, int minzoom, int max_zoom_increment, size_t pass, std::atomic<long long> *along, long long alongminus, int buffer, std::atomic<bool> *within, compressor **geomfile, std::atomic<long long> *geompos, long long start_geompos[], std::atomic<double> *oprogress, double todo, const char *fname, int child_shards, json_object *filter, const char *global_stringpool, long long *pool_off, std::vector<std::vector<std::string>> *layer_unmaps, bool first_time, bool write_children, bool compressed, multiplier_state *multiplier_state, std::shared_ptr<std::string> &tile_stringpool, std::vector<std::string> const &unidecode_data, next_feature_state &next_feature_state, double droprate) {
static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *geompos_in, int z, unsigned tx, unsigned ty, unsigned *initial_x, unsigned *initial_y, long long *original_features, long long *unclipped_features, int nextzoom, int maxzoom, int minzoom, int max_zoom_increment, size_t pass, std::atomic<long long> *along, long long alongminus, int buffer, std::atomic<bool> *within, compressor **geomfile, std::atomic<long long> *geompos, long long start_geompos[], std::atomic<double> *oprogress, double todo, const char *fname, int child_shards, json_object *filter, const char *global_stringpool, long long *pool_off, std::vector<std::vector<std::string>> *layer_unmaps, bool first_time, bool compressed, multiplier_state *multiplier_state, std::shared_ptr<std::string> &tile_stringpool, std::vector<std::string> const &unidecode_data, next_feature_state &next_feature_state, double droprate) {
double extra_multiplier_zooms = log(retain_points_multiplier) / log(droprate);
while (1) {
@@ -1204,7 +1192,7 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
// XXX should continue, but affects test outputs
}
if (first_time && write_children) { /* only write out the next zoom once, even if we retry */
if (first_time && pass == 0) { /* only write out the next zoom once, even if we retry */
if (sf.tippecanoe_maxzoom == -1 || sf.tippecanoe_maxzoom >= nextzoom) {
rewrite(sf, z, nextzoom, maxzoom, tx, ty, buffer, within, geompos, start_geompos, geomfile, fname, child_shards, max_zoom_increment, sf.segment, initial_x, initial_y);
}
@@ -1369,7 +1357,6 @@ struct run_prefilter_args {
json_object *filter = NULL;
std::vector<std::string> const *unidecode_data;
bool first_time = false;
bool write_children = false;
bool compressed = false;
double droprate = 1;
};
@@ -1382,7 +1369,7 @@ void *run_prefilter(void *v) {
next_feature_state next_feature_state;
while (1) {
serial_feature sf = next_feature(rpa->geoms, rpa->geompos_in, rpa->z, rpa->tx, rpa->ty, rpa->initial_x, rpa->initial_y, rpa->original_features, rpa->unclipped_features, rpa->nextzoom, rpa->maxzoom, rpa->minzoom, rpa->max_zoom_increment, rpa->pass, rpa->along, rpa->alongminus, rpa->buffer, rpa->within, rpa->geomfile, rpa->geompos, rpa->start_geompos, rpa->oprogress, rpa->todo, rpa->fname, rpa->child_shards, rpa->filter, rpa->global_stringpool, rpa->pool_off, rpa->layer_unmaps, rpa->first_time, rpa->write_children, rpa->compressed, &multiplier_state, tile_stringpool, *(rpa->unidecode_data), next_feature_state, rpa->droprate);
serial_feature sf = next_feature(rpa->geoms, rpa->geompos_in, rpa->z, rpa->tx, rpa->ty, rpa->initial_x, rpa->initial_y, rpa->original_features, rpa->unclipped_features, rpa->nextzoom, rpa->maxzoom, rpa->minzoom, rpa->max_zoom_increment, rpa->pass, rpa->along, rpa->alongminus, rpa->buffer, rpa->within, rpa->geomfile, rpa->geompos, rpa->start_geompos, rpa->oprogress, rpa->todo, rpa->fname, rpa->child_shards, rpa->filter, rpa->global_stringpool, rpa->pool_off, rpa->layer_unmaps, rpa->first_time, rpa->compressed, &multiplier_state, tile_stringpool, *(rpa->unidecode_data), next_feature_state, rpa->droprate);
if (sf.t < 0) {
break;
}
@@ -1658,7 +1645,7 @@ void skip_tile(decompressor *geoms, std::atomic<long long> *geompos_in, bool com
}
}
long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, char *global_stringpool, int z, const unsigned tx, const unsigned ty, const int detail, int min_detail, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, compressor **geomfile, std::atomic<long long> *geompos, int minzoom, int maxzoom, double todo, std::atomic<long long> *along, long long alongminus, double gamma, int child_shards, long long *pool_off, unsigned *initial_x, unsigned *initial_y, std::atomic<int> *running, double simplification, std::vector<std::map<std::string, layermap_entry>> *layermaps, std::vector<std::vector<std::string>> *layer_unmaps, size_t tiling_seg, size_t pass, unsigned long long mingap, long long minextent, unsigned long long mindrop_sequence, double minattribute, const char *prefilter, const char *postfilter, json_object *filter, write_tile_args *arg, atomic_strategy *strategy_out, bool compressed_input, node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, std::vector<std::string> const &unidecode_data, long long estimated_complexity, bool write_children, std::set<zxy> &skip_children_out) {
long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, char *global_stringpool, int z, const unsigned tx, const unsigned ty, const int detail, int min_detail, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, compressor **geomfile, std::atomic<long long> *geompos, int minzoom, int maxzoom, double todo, std::atomic<long long> *along, long long alongminus, double gamma, int child_shards, long long *pool_off, unsigned *initial_x, unsigned *initial_y, std::atomic<int> *running, double simplification, std::vector<std::map<std::string, layermap_entry>> *layermaps, std::vector<std::vector<std::string>> *layer_unmaps, size_t tiling_seg, size_t pass, unsigned long long mingap, long long minextent, unsigned long long mindrop_sequence, double minattribute, const char *prefilter, const char *postfilter, json_object *filter, write_tile_args *arg, atomic_strategy *strategy_out, bool compressed_input, node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, std::vector<std::string> const &unidecode_data, long long estimated_complexity, std::set<zxy> &skip_children_out) {
double merge_fraction = 1;
double mingap_fraction = 1;
double minextent_fraction = 1;
@@ -1694,7 +1681,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
int first_detail = detail, second_detail = detail - 1;
bool trying_to_stop_early = false;
bool can_stop_early = true;
if (additional[A_VARIABLE_DEPTH_PYRAMID] && !dropping_features(mingap, minextent, mindrop_sequence, minattribute, arg->drop_by_attribute_descending)) {
if (additional[A_VARIABLE_DEPTH_PYRAMID]) {
// If we are trying to stop early, there is an extra first pass with full+extra detail,
// and which loops if everything doesn't fit rather than trying to drop or union features.
@@ -1792,7 +1779,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
pthread_t prefilter_writer;
run_prefilter_args rpa; // here so it stays in scope until joined
FILE *prefilter_read_fp = NULL;
json_pull_ptr prefilter_jp;
json_pull *prefilter_jp = NULL;
if (z < minzoom) {
prefilter = NULL;
@@ -1839,7 +1826,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
rpa.filter = filter;
rpa.unidecode_data = &unidecode_data;
rpa.first_time = first_time;
rpa.write_children = write_children;
rpa.compressed = compressed_input;
rpa.droprate = arg->droprate;
@@ -1873,7 +1859,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
ssize_t which_serial_feature = -1;
if (prefilter == NULL) {
sf = next_feature(geoms, geompos_in, z, tx, ty, initial_x, initial_y, &original_features, &unclipped_features, nextzoom, maxzoom, minzoom, max_zoom_increment, pass, along, alongminus, buffer, within.data(), geomfile, geompos, start_geompos.data(), &oprogress, todo, fname, child_shards, filter, global_stringpool, pool_off, layer_unmaps, first_time, write_children, compressed_input, &multiplier_state, tile_stringpool, unidecode_data, next_feature_state, arg->droprate);
sf = next_feature(geoms, geompos_in, z, tx, ty, initial_x, initial_y, &original_features, &unclipped_features, nextzoom, maxzoom, minzoom, max_zoom_increment, pass, along, alongminus, buffer, within.data(), geomfile, geompos, start_geompos.data(), &oprogress, todo, fname, child_shards, filter, global_stringpool, pool_off, layer_unmaps, first_time, compressed_input, &multiplier_state, tile_stringpool, unidecode_data, next_feature_state, arg->droprate);
} else {
sf = parse_feature(prefilter_jp, z, tx, ty, layermaps, tiling_seg, layer_unmaps, postfilter != NULL, key_pool);
}
@@ -2128,8 +2114,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)) {
@@ -2263,12 +2249,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
sf.clustered = 0;
sf.tile_stringpool = tile_stringpool;
if (trying_to_stop_early && line_detail == first_detail) {
// only remove collinearities;
// leave all other vertices for extreme overzooming
sf.simplification = 0;
}
if (line_detail == detail && extra_detail >= 0 && z == maxzoom) {
sf.extra_detail = extra_detail;
// maximum allowed coordinate delta in geometries is 2^31 - 1
@@ -2477,6 +2457,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
args[i].shared_nodes_map = shared_nodes_map;
args[i].nodepos = nodepos;
args[i].shared_nodes_bloom = &shared_nodes_bloom;
args[i].trying_to_stop_early = trying_to_stop_early;
if (tasks > 1) {
if (thread_create(&pthreads[i], NULL, simplification_worker, &args[i]) != 0) {
@@ -2797,7 +2778,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,
@@ -2870,7 +2851,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
}
std::string compressed;
std::string pbf = tile.encode();
std::string pbf = encode_tile(tile, output_format);
tile.layers.clear();
@@ -2903,6 +2884,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
if (trying_to_stop_early && line_detail == first_detail) {
// didn't work, try a lower detail
detail_reduced++;
continue;
}
@@ -3044,7 +3026,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);
dir_write_tile(outdir, z, tx, ty, compressed, tile_format_extension(output_format));
}
if (pthread_mutex_unlock(&db_lock) != 0) {
@@ -3165,41 +3147,12 @@ exit(EXIT_IMPOSSIBLE);
long long len;
struct zxy parent(z - 1, x / 2, y / 2);
bool skip = false;
// Normally a tile writes the geometry for its children on pass 0, and the
// later passes of the same zoom, which are only retries with new thresholds,
// must not write it again.
bool write_children = (arg->pass == 0);
if (arg->skip_children->count(parent) > 0) {
if (dropping_features(arg->mingap, arg->minextent, arg->mindrop_sequence, arg->minattribute, arg->drop_by_attribute_descending)) {
// The parent truncated its pyramid here, but the zoom has since had to
// start dropping features, so the truncation no longer holds and this
// tile has to be written after all. Its geometry is still in the stream.
skip = false;
// It was skipped on every earlier pass of this zoom, so its children
// have never been written out. Write them on the first pass that
// actually tiles it, rather than on pass 0 as usual. The thresholds
// only ever increase within a zoom, so that is exactly the pass on
// which this zoom started dropping.
write_children = arg->first_dropping_pass;
} else {
// skip if the parent tile finished at the last zoom level and we aren't trying to drop
skip = true;
}
} else {
// do the tile if the parent didn't finish early
skip = false;
}
if (skip) {
skip_tile(&dc, &geompos, arg->compressed);
len = 1;
} else {
arg->wrote_zoom = z;
len = write_tile(&dc, &geompos, arg->global_stringpool, z, x, y, z == arg->maxzoom ? arg->full_detail : arg->low_detail, arg->min_detail, arg->outdb, arg->outdir, arg->buffer, arg->fname, arg->geomfile, arg->geompos, arg->minzoom, arg->maxzoom, arg->todo, arg->along, geompos, arg->gamma, arg->child_shards, arg->pool_off, arg->initial_x, arg->initial_y, arg->running, arg->simplification, arg->layermaps, arg->layer_unmaps, arg->tiling_seg, arg->pass, arg->mingap, arg->minextent, arg->mindrop_sequence, arg->minattribute, arg->prefilter, arg->postfilter, arg->filter, arg, arg->strategy, arg->compressed, arg->shared_nodes_map, arg->nodepos, *(arg->shared_nodes_bloom), (*arg->unidecode_data), estimated_complexity, write_children, arg->skip_children_out);
len = write_tile(&dc, &geompos, arg->global_stringpool, z, x, y, z == arg->maxzoom ? arg->full_detail : arg->low_detail, arg->min_detail, arg->outdb, arg->outdir, arg->buffer, arg->fname, arg->geomfile, arg->geompos, arg->minzoom, arg->maxzoom, arg->todo, arg->along, geompos, arg->gamma, arg->child_shards, arg->pool_off, arg->initial_x, arg->initial_y, arg->running, arg->simplification, arg->layermaps, arg->layer_unmaps, arg->tiling_seg, arg->pass, arg->mingap, arg->minextent, arg->mindrop_sequence, arg->minattribute, arg->prefilter, arg->postfilter, arg->filter, arg, arg->strategy, arg->compressed, arg->shared_nodes_map, arg->nodepos, *(arg->shared_nodes_bloom), (*arg->unidecode_data), estimated_complexity, arg->skip_children_out);
}
if (pthread_mutex_lock(&var_lock) != 0) {
@@ -3383,16 +3336,8 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
size_t zoom_tile_size = 0;
size_t zoom_feature_count = 0;
std::set<zxy> skip_children_out;
bool was_dropping = false;
for (size_t pass = 0;; pass++) {
// Tiles that were skipped because an ancestor truncated its pyramid are
// revived on the pass where this zoom starts dropping features, and that
// is the pass on which they have to write out their children.
bool is_dropping = dropping_features(zoom_mingap, zoom_minextent, zoom_mindrop_sequence, zoom_minattribute, drop_by_attribute_descending);
bool first_dropping_pass = is_dropping && !was_dropping;
was_dropping = is_dropping;
std::vector<pthread_t> pthreads(threads);
std::vector<write_tile_args> args;
args.resize(threads);
@@ -3474,7 +3419,6 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
args[thread].shared_nodes_bloom = &shared_nodes_bloom;
args[thread].skip_children = &skip_children;
args[thread].skip_children_out.clear();
args[thread].first_dropping_pass = first_dropping_pass;
if (thread_create(&pthreads[thread], NULL, run_thread, &args[thread]) != 0) {
perror("pthread_create");
@@ -3516,8 +3460,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;
+1 -1
View File
@@ -62,7 +62,7 @@ struct strategy {
// long long write_tile(char **geom, char *stringpool, unsigned *file_bbox, int z, unsigned x, unsigned y, int detail, int min_detail, int basezoom, sqlite3 *outdb, const char *outdir, double droprate, int buffer, const char *fname, FILE **geomfile, int file_minzoom, int file_maxzoom, double todo, char *geomstart, long long along, double gamma, int nlayers, std::atomic<strategy> *strategy);
int traverse_zooms(int *geomfd, off_t *geom_size, char *stringpool, std::atomic<unsigned> *midx, std::atomic<unsigned> *midy, int &maxzoom, int minzoom, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, const char *tmpdir, double gamma, int full_detail, int low_detail, int min_detail, long long *pool_off, unsigned *initial_x, unsigned *initial_y, double simplification, double maxzoom_simplification, std::vector<std::map<std::string, layermap_entry> > &layermap, const char *prefilter, const char *postfilter, std::unordered_map<std::string, attribute_op> const *attribute_accum, json_object *filter, std::vector<strategy> &strategies, int iz, struct node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, int basezoom, double droprate, std::vector<std::string> const &unidecode_data, std::string const *drop_by_attribute_as_needed_attribute, bool drop_by_attribute_descending);
int traverse_zooms(int *geomfd, off_t *geom_size, char *stringpool, std::atomic<unsigned> *midx, std::atomic<unsigned> *midy, int &maxzoom, int minzoom, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, const char *tmpdir, double gamma, int full_detail, int low_detail, int min_detail, long long *pool_off, unsigned *initial_x, unsigned *initial_y, double simplification, double maxzoom_simplification, std::vector<std::map<std::string, layermap_entry> > &layermap, const char *prefilter, const char *postfilter, std::unordered_map<std::string, attribute_op> const *attribute_accum, struct json_object *filter, std::vector<strategy> &strategies, int iz, struct node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, int basezoom, double droprate, std::vector<std::string> const &unidecode_data, std::string const *drop_by_attribute_as_needed_attribute, bool drop_by_attribute_descending);
int manage_gap(unsigned long long index, unsigned long long *previndex, double scale, double gamma, double *gap);
+2 -434
View File
@@ -6,13 +6,7 @@
#include "mvt.hpp"
#include "projection.hpp"
#include "geometry.hpp"
#include "jsonpull/jsonpull.h"
#include "fpfmt/fpfmt.hpp"
#include <unistd.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <random>
#include <limits.h>
TEST_CASE("UTF-8 enforcement", "[utf8]") {
@@ -143,432 +137,6 @@ TEST_CASE("line_is_too_small") {
REQUIRE(line_is_too_small(dv, 0, 10));
}
// A high surrogate followed by a non-surrogate used to be combined into one
// code point, because the range check tested the outer-loop byte instead of
// the parsed code unit. The stale surrogate should come out as standalone
// CESU-8, then U+E000 encoded normally.
TEST_CASE("jsonpull surrogate-pair regression", "[jsonpull][surrogate]") {
json_pull_ptr jp = json_begin_string("\"\\uD83D\\uE000\"");
json_object_ptr o = json_read_tree(jp);
REQUIRE(jp->error == nullptr);
REQUIRE(o != nullptr);
REQUIRE(o->type == JSON_STRING);
const std::string expected = "\xED\xA0\xBD\xEE\x80\x80";
REQUIRE(o->string() == expected);
// Sanity check: the buggy output (a single 4-byte UTF-8 sequence for
// U+1F400) must not be what we got.
const std::string buggy = "\xF0\x9F\x90\x80";
REQUIRE(o->string() != buggy);
}
// What geojson-loop does: free each feature once serialized, so they do not
// accumulate while the rest of the document is parsed.
//
// This shape cannot catch the array-splicing bug, at any size: json_read hands
// back each container as it completes, so the node freed here is always the
// last-added element of its parent, which the old memmove got right by moving
// zero bytes. "json_free prunes a non-final element" below covers that.
TEST_CASE("json_free prunes a subtree from its parent", "[jsonpull][memory]") {
json_pull_ptr jp = json_begin_string("[[1, 2], [3, 4], [5, 6]]");
json_object *outer = nullptr;
int arrays_seen = 0;
json_object *j;
while ((j = json_read(jp)) != nullptr) {
if (j->type != JSON_ARRAY) {
continue;
}
arrays_seen++;
if (arrays_seen == 2) {
// This is [3, 4]; verify, then ask the parser to drop it.
REQUIRE(j->array().size() == 2);
REQUIRE(j->array()[0]->number() == 3);
REQUIRE(j->array()[1]->number() == 4);
json_free(j);
} else if (j->parent == nullptr) {
// The completed outer array; the parser still owns it
// via jp->root, so the borrowed pointer stays valid.
outer = j;
break;
}
}
REQUIRE(outer != nullptr);
REQUIRE(outer->type == JSON_ARRAY);
REQUIRE(outer->array().size() == 2);
// First surviving element: [1, 2].
REQUIRE(outer->array()[0]->type == JSON_ARRAY);
REQUIRE(outer->array()[0]->array().size() == 2);
REQUIRE(outer->array()[0]->array()[0]->number() == 1);
REQUIRE(outer->array()[0]->array()[1]->number() == 2);
// Second surviving element (previously third): [5, 6].
REQUIRE(outer->array()[1]->type == JSON_ARRAY);
REQUIRE(outer->array()[1]->array().size() == 2);
REQUIRE(outer->array()[1]->array()[0]->number() == 5);
REQUIRE(outer->array()[1]->array()[1]->number() == 6);
}
// A top-level value has no parent, so json_free has to drop the parser's
// reference instead. jp->root being empty afterwards is also proof the subtree
// was destroyed, since jp->root was its only owner.
TEST_CASE("json_free releases a top-level value held by the parser", "[jsonpull][memory]") {
json_pull_ptr jp = json_begin_string(R"({"a": 1, "b": [2, 3]})");
// json_read streams atoms first (1, 2, 3, [2,3], ...); the top-level
// hash is returned by the final `}` token.
json_object *top = nullptr;
json_object *j;
while ((j = json_read(jp)) != nullptr) {
if (j->parent == nullptr) {
top = j;
break;
}
}
REQUIRE(top != nullptr);
REQUIRE(top->type == JSON_HASH);
REQUIRE(jp->root.get() == top);
json_free(top);
// top is dangling now; do not dereference.
REQUIRE(jp->root == nullptr);
}
// Nothing in tippecanoe calls json_disconnect today -- the filter loaders get
// the same guarantee from json_read_tree -- so cover it here rather than leave
// a documented ownership primitive untested.
TEST_CASE("json_disconnect hands a subtree to the caller", "[jsonpull][ownership]") {
json_object_ptr taken;
json_object *outer = nullptr;
json_pull_ptr jp = json_begin_string("[[1, 2], [3, 4]]");
int arrays_seen = 0;
json_object *j;
while ((j = json_read(jp)) != nullptr) {
if (j->type != JSON_ARRAY) {
continue;
}
arrays_seen++;
if (arrays_seen == 2) {
// This is [3, 4]; take it away from the enclosing array.
taken = json_disconnect(j);
REQUIRE(taken != nullptr);
REQUIRE(taken.get() == j);
} else if (j->parent == nullptr) {
outer = j;
break;
}
}
// The outer array is left holding only the element we didn't take,
// and the parser is still the owner of it.
REQUIRE(outer != nullptr);
REQUIRE(jp->root.get() == outer);
REQUIRE(outer->array().size() == 1);
REQUIRE(outer->array()[0]->array().size() == 2);
REQUIRE(outer->array()[0]->array()[0]->number() == 1);
REQUIRE(outer->array()[0]->array()[1]->number() == 2);
// The detached subtree holds no pointers into the parser...
REQUIRE(taken->parser == nullptr);
REQUIRE(taken->array()[0]->parser == nullptr);
REQUIRE(taken->array()[1]->parser == nullptr);
// ...and its root no longer points out at the array it was spliced
// from, but the parent links *within* it are left intact so the tree
// stays navigable upwards.
REQUIRE(taken->parent == nullptr);
REQUIRE(taken->array()[0]->parent == taken.get());
REQUIRE(taken->array()[1]->parent == taken.get());
// So the subtree stays valid once the parser, and the tree the parser
// still owns, are destroyed.
jp.reset();
// outer is dangling now; do not dereference.
REQUIRE(taken->type == JSON_ARRAY);
REQUIRE(taken->array().size() == 2);
REQUIRE(taken->array()[0]->number() == 3);
REQUIRE(taken->array()[1]->number() == 4);
}
// json_free finds a node's owner through o->parent, so clearing the interior
// parent links on detach would make this a silent no-op.
TEST_CASE("json_free prunes an interior node of a detached tree", "[jsonpull][ownership]") {
json_pull_ptr jp = json_begin_string("[[1, 2], [3, 4], [5, 6]]");
json_object_ptr tree = json_read_tree(jp);
REQUIRE(tree != nullptr);
REQUIRE(tree->type == JSON_ARRAY);
REQUIRE(tree->array().size() == 3);
// Destroy the parser first, so this is unambiguously operating on a
// tree that no longer has one.
jp.reset();
REQUIRE(tree->parser == nullptr);
json_object *drop = tree->array()[1].get();
REQUIRE(drop->array()[0]->number() == 3);
REQUIRE(drop->parent == tree.get());
json_free(drop);
// drop is dangling now; do not dereference.
// Had the parent links been cleared on detach, json_free would not
// have found an owner to splice the node out of, and the array would
// still have three elements.
REQUIRE(tree->array().size() == 2);
REQUIRE(tree->array()[0]->array()[0]->number() == 1);
REQUIRE(tree->array()[1]->array()[0]->number() == 5);
}
// Not a removal: the key stays with a JSON_NULL stand-in so the surrounding
// pairs keep their alignment, and the entry goes only when both halves do.
TEST_CASE("json_free of a hash value leaves a null placeholder", "[jsonpull][ownership]") {
json_pull_ptr jp = json_begin_string(R"({"keep": 1, "drop": [2, 3]})");
json_object_ptr tree = json_read_tree(jp);
REQUIRE(tree != nullptr);
REQUIRE(tree->entries().size() == 2);
json_object *drop = json_hash_get(tree, "drop");
REQUIRE(drop != nullptr);
REQUIRE(drop->type == JSON_ARRAY);
json_free(drop);
// drop is dangling now; do not dereference.
// The key survives, now paired with a null rather than the array.
REQUIRE(tree->entries().size() == 2);
json_object *after = json_hash_get(tree, "drop");
REQUIRE(after != nullptr);
REQUIRE(after->type == JSON_NULL);
// The neighbouring pair is untouched.
REQUIRE(json_hash_get(tree, "keep") != nullptr);
REQUIRE(json_hash_get(tree, "keep")->number() == 1);
}
// The array-splicing fix. The old code passed an element count to memmove
// where a byte count was wanted, so pruning element 0 of eight left
// arr[0] == arr[1] -- one node owned twice -- and dropped the last element.
// Asserting each survivor's identity is what discriminates; checking only the
// size would not.
TEST_CASE("json_free prunes a non-final element", "[jsonpull][ownership]") {
json_pull_ptr jp = json_begin_string("[[1], [2], [3], [4], [5], [6], [7], [8]]");
json_object_ptr tree = json_read_tree(jp);
REQUIRE(tree != nullptr);
REQUIRE(tree->type == JSON_ARRAY);
REQUIRE(tree->array().size() == 8);
json_free(tree->array()[0].get());
// Every survivor keeps its identity, in order, and nothing is aliased.
REQUIRE(tree->array().size() == 7);
for (size_t i = 0; i < tree->array().size(); i++) {
json_object *e = tree->array()[i].get();
REQUIRE(e->type == JSON_ARRAY);
REQUIRE(e->array().size() == 1);
REQUIRE(e->array()[0]->number() == (double) (i + 2));
if (i + 1 < tree->array().size()) {
REQUIRE(e != tree->array()[i + 1].get());
}
}
}
// The mirror of the value case above.
TEST_CASE("json_free of a hash key, then of both halves", "[jsonpull][ownership]") {
json_pull_ptr jp = json_begin_string(R"({"a": 1, "b": 2, "c": 3})");
json_object_ptr tree = json_read_tree(jp);
REQUIRE(tree != nullptr);
REQUIRE(tree->entries().size() == 3);
// Free the key of the middle pair. The entry stays, with a null key,
// and its value is still reachable positionally.
json_free(tree->entries()[1].key.get());
REQUIRE(tree->entries().size() == 3);
REQUIRE(tree->entries()[1].key->type == JSON_NULL);
REQUIRE(tree->entries()[1].value->number() == 2);
// The neighbours are untouched, and the now-keyless pair is no longer
// findable by name.
REQUIRE(json_hash_get(tree, "b") == nullptr);
REQUIRE(json_hash_get(tree, "a")->number() == 1);
REQUIRE(json_hash_get(tree, "c")->number() == 3);
// Freeing the other half too retires the whole entry.
json_free(tree->entries()[1].value.get());
REQUIRE(tree->entries().size() == 2);
REQUIRE(json_hash_get(tree, "a")->number() == 1);
REQUIRE(json_hash_get(tree, "c")->number() == 3);
}
// What the filter loaders and -L / -E do. Each detached tree has to survive
// the next json_read_tree call and the parser's destruction.
TEST_CASE("repeated json_read_tree on a line-delimited stream", "[jsonpull][ownership]") {
json_pull_ptr jp = json_begin_string("{\"n\": 1}\n{\"n\": 2}\n{\"n\": 3}\n");
std::vector<json_object_ptr> trees;
for (int i = 0; i < 3; i++) {
json_object_ptr t = json_read_tree(jp);
REQUIRE(t != nullptr);
REQUIRE(t->type == JSON_HASH);
// Reading the next tree must not disturb the ones already taken.
REQUIRE(json_hash_get(t, "n")->number() == i + 1);
trees.push_back(std::move(t));
}
REQUIRE(json_read_tree(jp) == nullptr);
// All three outlive the parser they came from.
jp.reset();
for (int i = 0; i < 3; i++) {
REQUIRE(trees[i]->parser == nullptr);
REQUIRE(json_hash_get(trees[i], "n")->number() == i + 1);
}
}
// What json_context() prints on the error paths: a hash whose last key has no
// value yet renders that slot as "...".
TEST_CASE("json_stringify of a partially-parsed tree", "[jsonpull][stringify]") {
json_pull_ptr jp = json_begin_string("{\"a\": [1, 2], \"b\":");
// Read until the parser runs out of input mid-hash.
while (json_read(jp) != nullptr) {
;
}
REQUIRE(jp->error != nullptr);
REQUIRE(jp->root != nullptr);
std::string s = json_stringify(jp->root.get());
REQUIRE(s == "{\"a\":[1,2],\"b\":...}");
}
// Values are std::string now, so an embedded NUL is legal and stringify has to
// walk past it rather than stop the way a c_str() loop would.
TEST_CASE("json_stringify keeps text after an embedded NUL", "[jsonpull][stringify]") {
json_pull_ptr jp = json_begin_string("\"a\\u0000b\"");
json_object_ptr o = json_read_tree(jp);
REQUIRE(o != nullptr);
REQUIRE(o->type == JSON_STRING);
REQUIRE(o->string().size() == 3);
std::string s = json_stringify(o.get());
REQUIRE(s == "\"a\\u0000b\"");
}
// U+FFFF used to fall through the `< 0xFFFF` test into the four-byte branch
// and come out as the overlong F0 8F BF BF, which check_utf8 does not catch.
TEST_CASE("jsonpull encodes U+FFFF as three bytes", "[jsonpull][utf8]") {
json_pull_ptr jp = json_begin_string("\"a\\uFFFFb\"");
json_object_ptr o = json_read_tree(jp);
REQUIRE(jp->error == nullptr);
REQUIRE(o != nullptr);
REQUIRE(o->type == JSON_STRING);
REQUIRE(o->string() ==
"a\xEF\xBF\xBF"
"b");
REQUIRE(o->string() !=
"a\xF0\x8F\xBF\xBF"
"b");
// The boundary below it, and a genuine supplementary code point built
// from a surrogate pair, both keep their existing encodings.
json_pull_ptr jp2 = json_begin_string("\"\\uFFFE\"");
json_object_ptr o2 = json_read_tree(jp2);
REQUIRE(o2 != nullptr);
REQUIRE(o2->string() == "\xEF\xBF\xBE");
json_pull_ptr jp3 = json_begin_string("\"\\uD83D\\uDC00\"");
json_object_ptr o3 = json_read_tree(jp3);
REQUIRE(o3 != nullptr);
REQUIRE(o3->string() == "\xF0\x9F\x90\x80");
}
TEST_CASE("fpfmt formats the special cases", "[fpfmt]") {
REQUIRE(fpfmt::dtoa(0.0) == std::string("0"));
REQUIRE(fpfmt::dtoa(-0.0) == std::string("0"));
REQUIRE(fpfmt::dtoa(INFINITY) == std::string("inf"));
REQUIRE(fpfmt::dtoa(-INFINITY) == std::string("-inf"));
REQUIRE(fpfmt::dtoa(NAN) == std::string("nan"));
}
TEST_CASE("fpfmt chooses plain or exponential notation", "[fpfmt]") {
REQUIRE(fpfmt::dtoa(1) == std::string("1"));
REQUIRE(fpfmt::dtoa(-1) == std::string("-1"));
REQUIRE(fpfmt::dtoa(0.1) == std::string("0.1"));
REQUIRE(fpfmt::dtoa(12.34) == std::string("12.34"));
REQUIRE(fpfmt::dtoa(-12.34) == std::string("-12.34"));
REQUIRE(fpfmt::dtoa(123456789) == std::string("123456789"));
// Plain notation runs out to 21 integer digits, and down to 1e-6.
REQUIRE(fpfmt::dtoa(1e-6) == std::string("0.000001"));
REQUIRE(fpfmt::dtoa(1e-7) == std::string("1e-7")); // no zero padding, as milo did
REQUIRE(fpfmt::dtoa(1e20) == std::string("100000000000000000000"));
REQUIRE(fpfmt::dtoa(1e21) == std::string("1e+21"));
REQUIRE(fpfmt::dtoa(1.5e300) == std::string("1.5e+300"));
REQUIRE(fpfmt::dtoa(-1.5e-300) == std::string("-1.5e-300"));
// Subnormals, and the extremes of the range.
REQUIRE(fpfmt::dtoa(5e-324) == std::string("5e-324"));
REQUIRE(fpfmt::dtoa(2.2250738585072014e-308) == std::string("2.2250738585072014e-308"));
REQUIRE(fpfmt::dtoa(1.7976931348623157e308) == std::string("1.7976931348623157e+308"));
}
TEST_CASE("fpfmt uses the shortest digit string", "[fpfmt]") {
// Cases where Grisu2 emitted a digit or more than it had to.
REQUIRE(fpfmt::dtoa(-26.170045) == std::string("-26.170045"));
REQUIRE(fpfmt::dtoa(77.272945) == std::string("77.272945"));
// Cases where Grisu2 picked a neighbor of the correctly rounded digits.
REQUIRE(fpfmt::dtoa(1.0 / 6.0) == std::string("0.16666666666666666"));
REQUIRE(fpfmt::dtoa(18446744073709551616.0) == std::string("18446744073709552000"));
}
TEST_CASE("fpfmt round trips", "[fpfmt]") {
auto round_trips = [](double d) {
std::string s = fpfmt::dtoa(d);
return strtod(s.c_str(), NULL) == d;
};
for (int i = -300; i <= 300; i++) {
double d = pow(10.0, i);
REQUIRE(round_trips(d));
REQUIRE(round_trips(-d));
}
for (int i = 1; i < 10000; i++) {
REQUIRE(round_trips((double) i));
REQUIRE(round_trips(1.0 / i));
REQUIRE(round_trips(-1.0 / i));
}
std::mt19937_64 rng(20250101);
for (int i = 0; i < 200000; i++) {
uint64_t bits = rng();
double d;
memcpy(&d, &bits, sizeof(d));
if (std::isfinite(d) && d != 0) {
REQUIRE(round_trips(d));
}
}
}
TEST_CASE("Polygon cleaning drops a hole that no ring can parent", "[wagyu]") {
// Two mutually reversed self-intersecting rings whose union leaves a hole
// that wagyu's topology correction cannot assign to any surviving parent
@@ -577,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;
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "v2.83.0"
#define VERSION "v2.81.0"
#endif
+2 -2
View File
@@ -13,7 +13,7 @@
#include "geometry.hpp"
#include "mvt.hpp"
#include "write_json.hpp"
#include "fpfmt/fpfmt.hpp"
#include "milo/dtoa_milo.h"
#include "errors.hpp"
#include "serial.hpp"
@@ -158,7 +158,7 @@ void json_writer::json_write_json(std::string const &str) {
void json_writer::json_write_number(double d) {
json_adjust();
adds(fpfmt::dtoa(d).c_str());
adds(milo::dtoa_milo(d).c_str());
}
// Just to avoid json_writer:: changing expected output format