mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-24 01:11:17 +01:00
Compare commits
19
Commits
2.69.0
...
test-e33a52bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e33a52bf75 | ||
|
|
0d22f3dfeb | ||
|
|
4a17aecd3b | ||
|
|
bfb62ee2db | ||
|
|
a0532e73ac | ||
|
|
9d1637f7c1 | ||
|
|
de4e1e478f | ||
|
|
423fea1544 | ||
|
|
583fc3744a | ||
|
|
390c362452 | ||
|
|
10f7f0a3c2 | ||
|
|
7165ae6999 | ||
|
|
d70e3326da | ||
|
|
a8bd7ac723 | ||
|
|
bdfb06cd6a | ||
|
|
1d81935cd5 | ||
|
|
dcc616d3d4 | ||
|
|
11e3196c9a | ||
|
|
905b58cdf4 |
@@ -4,12 +4,18 @@ on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
|
||||
version: ['Release', 'Debug']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: sudo apt-get install libsqlite3-dev
|
||||
- name: Install dependencies (Ubuntu)
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get install libsqlite3-dev
|
||||
- name: Install dependencies (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: brew install sqlite3
|
||||
- run: uname -a; BUILDTYPE=${{ matrix.version }} make
|
||||
- run: make test
|
||||
|
||||
@@ -1,3 +1,45 @@
|
||||
# 2.77.0
|
||||
|
||||
* Add --deduplicate-by-id option to tippecanoe-overzoom
|
||||
|
||||
# 2.76.0
|
||||
|
||||
* Add missing case for accumulating the mean of attributes that are inconsistently present
|
||||
* Add --keep-point-cluster-position (#326)
|
||||
|
||||
# 2.75.1
|
||||
|
||||
* Further reduce memory consumption in attribute sorting and tilestats tracking
|
||||
|
||||
# 2.75.0
|
||||
|
||||
* Reduce memory consumption in attribute accumulation and feature sorting
|
||||
|
||||
# 2.74.0
|
||||
|
||||
* Add the option to join attributes from a sqlite database in tile-join
|
||||
* Improve tile-join's tileset bounding box calculations
|
||||
|
||||
# 2.73.0
|
||||
|
||||
* Correctly clip features down to nothing when the clip region doesn't intersect the tile at all
|
||||
|
||||
# 2.72.0
|
||||
|
||||
* Add --clip-polygon-file and --feature-filter-file options to tippecanoe-overzoom
|
||||
|
||||
# 2.71.0
|
||||
|
||||
* Add --clip-bounding-box and --clip-polygon options to tippecanoe-overzoom
|
||||
|
||||
# 2.70.1
|
||||
|
||||
* Raise tippecanoe-decode limit on the size of individual tiles
|
||||
|
||||
# 2.70.0
|
||||
|
||||
* Performance improvements to tippecanoe-overzoom with attribute exclusion
|
||||
|
||||
# 2.69.0
|
||||
|
||||
* Fix crash when the first bin gets clipped away
|
||||
|
||||
@@ -56,10 +56,10 @@ PG=
|
||||
H = $(wildcard *.h) $(wildcard *.hpp)
|
||||
C = $(wildcard *.c) $(wildcard *.cpp)
|
||||
|
||||
INCLUDES = -I/usr/local/include -I.
|
||||
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 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
|
||||
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 clipper2/src/clipper.engine.o
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
||||
|
||||
tippecanoe-enumerate: enumerate.o
|
||||
@@ -68,16 +68,16 @@ tippecanoe-enumerate: enumerate.o
|
||||
tippecanoe-decode: decode.o projection.o mvt.o write_json.o text.o jsonpull/jsonpull.o dirtiles.o pmtiles_file.o
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3
|
||||
|
||||
tile-join: tile-join.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
|
||||
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 clipper2/src/clipper.engine.o
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
||||
|
||||
tippecanoe-json-tool: jsontool.o jsonpull/jsonpull.o csv.o text.o geojson-loop.o
|
||||
$(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
|
||||
unit: unit.o text.o sort.o mvt.o projection.o clip.o attribute.o jsonpull/jsonpull.o evaluator.o read_json.o clipper2/src/clipper.engine.o
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
||||
|
||||
tippecanoe-overzoom: overzoom.o mvt.o clip.o evaluator.o jsonpull/jsonpull.o text.o attribute.o read_json.o projection.o
|
||||
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 clipper2/src/clipper.engine.o
|
||||
$(CXX) $(PG) $(LIBS) $(FINAL_FLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -lm -lz -lsqlite3 -lpthread
|
||||
|
||||
-include $(wildcard *.d)
|
||||
@@ -326,6 +326,11 @@ overzoom-test: tippecanoe-overzoom
|
||||
./tippecanoe-decode tests/pbf/0-0-0-pop-expr.pbf 0 0 0 > tests/pbf/0-0-0-pop-expr.pbf.json.check
|
||||
cmp tests/pbf/0-0-0-pop-expr.pbf.json.check tests/pbf/0-0-0-pop-expr.pbf.json
|
||||
rm tests/pbf/0-0-0-pop-expr.pbf tests/pbf/0-0-0-pop-expr.pbf.json.check
|
||||
# Same filter test, but reading the filter from a file
|
||||
./tippecanoe-overzoom -y NAME -J tests/pbf/scalerank-0-filter.json -o tests/pbf/0-0-0-pop-expr.pbf tests/pbf/0-0-0-pop.pbf 0/0/0 0/0/0
|
||||
./tippecanoe-decode tests/pbf/0-0-0-pop-expr.pbf 0 0 0 > tests/pbf/0-0-0-pop-expr.pbf.json.check
|
||||
cmp tests/pbf/0-0-0-pop-expr.pbf.json.check tests/pbf/0-0-0-pop-expr.pbf.json
|
||||
rm tests/pbf/0-0-0-pop-expr.pbf tests/pbf/0-0-0-pop-expr.pbf.json.check
|
||||
# Filtering with multiplier
|
||||
# 243 features in the source tile tests/pbf/0-0-0-pop.pbf
|
||||
# 8 features survive into the output, from 9 clusters of 30
|
||||
@@ -362,16 +367,37 @@ overzoom-test: tippecanoe-overzoom
|
||||
./tippecanoe-decode tests/pbf/countries-0-0-0.pbf.out 0 0 0 > tests/pbf/countries-0-0-0.pbf.out.json.check
|
||||
cmp tests/pbf/countries-0-0-0.pbf.out.json.check tests/pbf/countries-0-0-0.pbf.out.json
|
||||
rm tests/pbf/countries-0-0-0.pbf.out tests/pbf/countries-0-0-0.pbf.out.json.check
|
||||
# Clipping to bounding box
|
||||
./tippecanoe-overzoom --clip-bounding-box 5,5,25.7,50 -o tests/pbf/countries-0-0-0-clip.pbf.out tests/pbf/countries-0-0-0.pbf 0/0/0 0/0/0
|
||||
./tippecanoe-decode tests/pbf/countries-0-0-0-clip.pbf.out 0 0 0 > tests/pbf/countries-0-0-0-clip.pbf.out.json.check
|
||||
cmp tests/pbf/countries-0-0-0-clip.pbf.out.json.check tests/pbf/countries-0-0-0-clip.pbf.out.json
|
||||
rm tests/pbf/countries-0-0-0-clip.pbf.out tests/pbf/countries-0-0-0-clip.pbf.out.json.check
|
||||
# Binning
|
||||
./tippecanoe-overzoom -o tests/pbf/bin-11-327-791.pbf.out --assign-to-bins tests/pbf/sf-zips.json tests/pbf/muni-11-327-791.pbf 11/327/791 11/327/791
|
||||
./tippecanoe-decode tests/pbf/bin-11-327-791.pbf.out 11 327 791 > tests/pbf/bin-11-327-791.pbf.out.json.check
|
||||
cmp tests/pbf/bin-11-327-791.pbf.out.json.check tests/pbf/bin-11-327-791.pbf.out.json
|
||||
rm tests/pbf/bin-11-327-791.pbf.out.json.check tests/pbf/bin-11-327-791.pbf.out
|
||||
# Binning by id
|
||||
./tippecanoe-overzoom -o tests/pbf/bin-11-327-791-ids.pbf.out --assign-to-bins tests/pbf/sf-zips.json --bin-by-id bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
|
||||
./tippecanoe-overzoom -o tests/pbf/bin-11-327-791-ids.pbf.out --assign-to-bins tests/pbf/sf-zips.json --bin-by-id-list bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
|
||||
./tippecanoe-decode tests/pbf/bin-11-327-791-ids.pbf.out 11 327 791 > tests/pbf/bin-11-327-791-ids.pbf.out.json.check
|
||||
cmp tests/pbf/bin-11-327-791-ids.pbf.out.json.check tests/pbf/bin-11-327-791-ids.pbf.out.json
|
||||
rm tests/pbf/bin-11-327-791-ids.pbf.out.json.check tests/pbf/bin-11-327-791-ids.pbf.out
|
||||
# Binning by id, clipping by polygon
|
||||
./tippecanoe-overzoom -o tests/pbf/bin-11-327-791-ids-clip.pbf.out --clip-polygon='{"coordinates":[[[-122.4527379,37.8128815],[-122.4598853,37.7834743],[-122.4280914,37.7959397],[-122.4527379,37.8128815]]],"type":"Polygon"}' --assign-to-bins tests/pbf/sf-zips.json --bin-by-id-list bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
|
||||
./tippecanoe-decode tests/pbf/bin-11-327-791-ids-clip.pbf.out 11 327 791 > tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check
|
||||
cmp tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out.json
|
||||
rm tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out
|
||||
# Binning by id, clipping by polygon from file
|
||||
./tippecanoe-overzoom -o tests/pbf/bin-11-327-791-ids-clip.pbf.out --clip-polygon-file=tests/pbf/clip-poly.json --assign-to-bins tests/pbf/sf-zips.json --bin-by-id-list bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
|
||||
./tippecanoe-decode tests/pbf/bin-11-327-791-ids-clip.pbf.out 11 327 791 > tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check
|
||||
cmp tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out.json
|
||||
rm tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out
|
||||
# Binning by id, attribute stripping
|
||||
# Note that it still works even if we exclude the ID that we are binning by
|
||||
./tippecanoe-overzoom -yZCTA5CE10 -ytippecanoe:count -o tests/pbf/bin-11-327-791-ids-zip.pbf.out --assign-to-bins tests/pbf/sf-zips.json --bin-by-id-list bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
|
||||
./tippecanoe-decode tests/pbf/bin-11-327-791-ids-zip.pbf.out 11 327 791 > tests/pbf/bin-11-327-791-ids-zip.pbf.out.json.check
|
||||
cmp tests/pbf/bin-11-327-791-ids-zip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-zip.pbf.out.json
|
||||
rm tests/pbf/bin-11-327-791-ids-zip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-zip.pbf.out
|
||||
# Binning with longitude wraparound problems
|
||||
./tippecanoe-overzoom -o tests/pbf/0-0-0-pop-2-0-1.pbf.out --accumulate-numeric-attributes=tippecanoe --assign-to-bins tests/pbf/h3-2-0-1.geojson tests/pbf/0-0-0.pbf 2/0/1 2/0/1
|
||||
./tippecanoe-decode tests/pbf/0-0-0-pop-2-0-1.pbf.out 2 0 1 > tests/pbf/0-0-0-pop-2-0-1.pbf.out.json.check
|
||||
@@ -385,9 +411,48 @@ overzoom-test: tippecanoe-overzoom
|
||||
./tippecanoe-decode tests/pbf/0-0-0-pop-0-0-0.pbf.out 0 0 0 > tests/pbf/0-0-0-pop-0-0-0.pbf.out.json.check
|
||||
cmp tests/pbf/0-0-0-pop-0-0-0.pbf.out.json.check tests/pbf/0-0-0-pop-0-0-0.pbf.out.json
|
||||
rm tests/pbf/0-0-0-pop-0-0-0.pbf.out tests/pbf/0-0-0-pop-0-0-0.pbf.out.json.check
|
||||
# Binning, clipping to bounding box
|
||||
./tippecanoe-overzoom --clip-bounding-box 88,67.5,138,78 -o tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out --accumulate-numeric-attributes=tippecanoe --assign-to-bins tests/pbf/h3-1-1-0.geojson tests/pbf/0-0-0.pbf 1/1/0 1/1/0
|
||||
./tippecanoe-decode tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out 1 1 0 > tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out.json.check
|
||||
cmp tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out.json.check tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out.json
|
||||
rm tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out tests/pbf/0-0-0-pop-1-1-0-clip.pbf.out.json.check
|
||||
# Verify fix for crash
|
||||
./tippecanoe-overzoom '-o' tests/10188-crash/out.pbf '-t' '3/2/2' '--assign-to-bins' 'tests/10188-crash/bins.json' '--bin-by-id-list' 'felt:bin_features' '-b5' 'tests/10188-crash/2-0-0.pbf' '2/0/0'
|
||||
rm tests/10188-crash/out.pbf
|
||||
# Polygon clipping
|
||||
./tippecanoe-overzoom -o tests/pbf/countries-1-1-0-clip.pbf --clip-polygon "`cat tests/pbf/region.json`" tests/pbf/countries-1-1-0.pbf 1/1/0 1/1/0
|
||||
./tippecanoe-decode tests/pbf/countries-1-1-0-clip.pbf 1 1 0 > tests/pbf/countries-1-1-0-clip.json.check
|
||||
cmp tests/pbf/countries-1-1-0-clip.json.check tests/pbf/countries-1-1-0-clip.json
|
||||
rm tests/pbf/countries-1-1-0-clip.pbf tests/pbf/countries-1-1-0-clip.json.check
|
||||
# LineString clipping
|
||||
./tippecanoe-overzoom -o tests/pbf/roads-1-1-0-clip.pbf --clip-polygon "`cat tests/pbf/region.json`" tests/pbf/roads-1-1-0.pbf 1/1/0 1/1/0
|
||||
./tippecanoe-decode tests/pbf/roads-1-1-0-clip.pbf 1 1 0 > tests/pbf/roads-1-1-0-clip.json.check
|
||||
cmp tests/pbf/roads-1-1-0-clip.json.check tests/pbf/roads-1-1-0-clip.json
|
||||
rm tests/pbf/roads-1-1-0-clip.pbf tests/pbf/roads-1-1-0-clip.json.check
|
||||
# Point clipping
|
||||
./tippecanoe-overzoom -o tests/pbf/places-1-1-0-clip.pbf --clip-polygon "`cat tests/pbf/region.json`" tests/pbf/places-1-1-0.pbf 1/1/0 1/1/0
|
||||
./tippecanoe-decode tests/pbf/places-1-1-0-clip.pbf 1 1 0 > tests/pbf/places-1-1-0-clip.json.check
|
||||
cmp tests/pbf/places-1-1-0-clip.json.check tests/pbf/places-1-1-0-clip.json
|
||||
rm tests/pbf/places-1-1-0-clip.pbf tests/pbf/places-1-1-0-clip.json.check
|
||||
# Polygon clipping, with excessively large clip region
|
||||
./tippecanoe-overzoom -b10 -o tests/pbf/countries-8-135-86-bigclip.pbf --clip-polygon "`cat tests/pbf/region.json`" tests/pbf/countries-1-1-0.pbf 1/1/0 8/135/86
|
||||
./tippecanoe-decode tests/pbf/countries-8-135-86-bigclip.pbf 8 135 86 > tests/pbf/countries-8-135-86-bigclip.json.check
|
||||
cmp tests/pbf/countries-8-135-86-bigclip.json.check tests/pbf/countries-8-135-86-bigclip.json
|
||||
rm tests/pbf/countries-8-135-86-bigclip.pbf tests/pbf/countries-8-135-86-bigclip.json.check
|
||||
# Clip region that does not intersect with the tile
|
||||
./tippecanoe-overzoom -o tests/pbf/squirrels-13-2413-3077-clip.pbf --clip-polygon-file tests/pbf/squirrels-clip.json tests/pbf/squirrels-13-2413-3077.pbf 13/2413/3077 13/2413/3077
|
||||
cmp tests/pbf/squirrels-13-2413-3077-clip.pbf /dev/null # clipped away
|
||||
rm tests/pbf/squirrels-13-2413-3077-clip.pbf
|
||||
# Deduplication by feature ID
|
||||
./tippecanoe -z0 -f -e tests/pbf/1.json.dir -l layer tests/pbf/1.json
|
||||
./tippecanoe -z0 -f -e tests/pbf/2.json.dir -l layer tests/pbf/2.json
|
||||
./tippecanoe-overzoom -o tests/pbf/merged-nodedup.pbf -t 0/0/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-nodedup.pbf 0 0 0 > tests/pbf/merged-nodedup.pbf.json.check
|
||||
cmp tests/pbf/merged-nodedup.pbf.json.check tests/pbf/merged-nodedup.pbf.json
|
||||
./tippecanoe-overzoom --deduplicate-by-id -o tests/pbf/merged-dedup.pbf -t 0/0/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 0 0 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.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"}'
|
||||
@@ -523,6 +588,20 @@ join-test: tippecanoe tippecanoe-decode tile-join
|
||||
./tippecanoe-decode -x generator tests/ne_110m_ocean/join/joined.mbtiles > tests/ne_110m_ocean/join/joined.mbtiles.json.check
|
||||
cmp tests/ne_110m_ocean/join/joined.mbtiles.json.check tests/ne_110m_ocean/join/joined.mbtiles.json
|
||||
rm -f tests/ne_110m_ocean/join/ocean.mbtiles tests/ne_110m_ocean/join/countries.mbtiles tests/ne_110m_ocean/join/joined.mbtiles tests/ne_110m_ocean/join/joined.mbtiles.json.check
|
||||
#
|
||||
# Test sql join
|
||||
#
|
||||
./tile-join -i -f -o tests/join-sql/countries.pmtiles --join-sqlite tests/join-sql/countries.gpkg --join-table countries --join-tile-attribute ne10-admin0:name_en --join-table-expression 'lower(country)' tests/join-sql/bboxes.pmtiles
|
||||
./tippecanoe-decode -x generator tests/join-sql/countries.pmtiles > tests/join-sql/countries.pmtiles.json.check
|
||||
cmp tests/join-sql/countries.pmtiles.json.check tests/join-sql/countries.pmtiles.json
|
||||
rm -f tests/join-sql/countries.pmtiles tests/join-sql/countries.pmtiles.json.check
|
||||
#
|
||||
# Test sql join with limit
|
||||
#
|
||||
./tile-join --join-count-limit 3 -i -f -o tests/join-sql/countries-limit3.pmtiles --join-sqlite tests/join-sql/countries.gpkg --join-table countries --join-tile-attribute ne10-admin0:name_en --join-table-expression 'lower(country)' tests/join-sql/bboxes.pmtiles
|
||||
./tippecanoe-decode -x generator tests/join-sql/countries-limit3.pmtiles > tests/join-sql/countries-limit3.pmtiles.json.check
|
||||
cmp tests/join-sql/countries-limit3.pmtiles.json.check tests/join-sql/countries-limit3.pmtiles.json
|
||||
rm -f tests/join-sql/countries-limit3.pmtiles tests/join-sql/countries-limit3.pmtiles.json.check
|
||||
|
||||
accumulate-test:
|
||||
# there are 144 features with POP1950 in the original dataset
|
||||
@@ -618,11 +697,36 @@ accumulate-test:
|
||||
# the cluster sizes still add up to the 243 original features
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | sed 's/.*clustered:cluster_size": //' | awk '{sum += $$1} END {print sum}'` == 243
|
||||
#
|
||||
# Binning with attribute stripping
|
||||
./tippecanoe-overzoom -y clustered:count:POP1950 -y clustered:sum:POP1950 -y POP1950 -y clustered:cluster_size --assign-to-bins tests/pbf/h3-0-0-0.geojson --accumulate-numeric-attributes=clustered --accumulate-attribute '{"clustered:cluster_size":"sum"}' -o tests/pbf/bins-0-0-0.pbf tests/pbf/accum.dir/0/0/0.pbf 0/0/0 0/0/0
|
||||
# Now there are 30 bins with POP1950 clusters
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep 'clustered:count:POP1950' | wc -l` == 41
|
||||
# There are none with bare POP1950 (which is expected; we should only have summary statistics)
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep -v 'clustered:count:POP1950' | grep 'POP1950' | wc -l` == 0
|
||||
# And 4 with no POP1950 at all
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep -v 'POP1950' | wc -l` == 3
|
||||
#
|
||||
# the clustered and megatile-filtered and binned POP1950s add up to 161590
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep 'clustered:sum:POP1950' | sed 's/.*"clustered:sum:POP1950": //' | awk '{sum += $$1} END {print sum}'` == 161590
|
||||
# which is the right global total
|
||||
# Make sure we do *not* accumulate a numeric attribute that already has the magic prefix:
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep sum:clustered:unrelated | wc -l` == 0
|
||||
# And those attributes do *not* make it onto the bins
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | grep clustered:unrelated | wc -l` == 0
|
||||
# the cluster sizes still add up to the 243 original features
|
||||
test `./tippecanoe-decode -c tests/pbf/bins-0-0-0.pbf 0 0 0 | sed 's/.*clustered:cluster_size": //' | awk '{sum += $$1} END {print sum}'` == 243
|
||||
#
|
||||
#
|
||||
# A tile where the counts and means were previously wrong:
|
||||
./tippecanoe-overzoom --accumulate-numeric-attributes=felt -m -o tests/pbf/yearbuilt-accum.pbf tests/pbf/yearbuilt.pbf 0/0/0 0/0/0
|
||||
./tippecanoe-decode tests/pbf/yearbuilt-accum.pbf 0 0 0 > tests/pbf/yearbuilt-accum.pbf.json.check
|
||||
cmp tests/pbf/yearbuilt-accum.pbf.json.check tests/pbf/yearbuilt-accum.pbf.json
|
||||
rm tests/pbf/yearbuilt-accum.pbf tests/pbf/yearbuilt-accum.pbf.json.check
|
||||
# Same tile, with attribute stripping
|
||||
./tippecanoe-overzoom --accumulate-numeric-attributes=felt -y bldgsqft -y felt:sum:bldgsqft -m -o tests/pbf/yearbuilt-accum-bldgsqft.pbf tests/pbf/yearbuilt.pbf 0/0/0 0/0/0
|
||||
./tippecanoe-decode tests/pbf/yearbuilt-accum-bldgsqft.pbf 0 0 0 > tests/pbf/yearbuilt-accum-bldgsqft.pbf.json.check
|
||||
cmp tests/pbf/yearbuilt-accum-bldgsqft.pbf.json.check tests/pbf/yearbuilt-accum-bldgsqft.pbf.json
|
||||
rm tests/pbf/yearbuilt-accum-bldgsqft.pbf tests/pbf/yearbuilt-accum-bldgsqft.pbf.json.check
|
||||
|
||||
join-filter-test: tippecanoe tippecanoe-decode tile-join
|
||||
# Comes out different from the direct tippecanoe run because null attributes are lost
|
||||
|
||||
@@ -417,9 +417,9 @@ be reduced to the maximum that can be used with the specified _maxzoom_.
|
||||
that are dropped, coalesced-as-needed, or clustered. The _operation_ may be
|
||||
`sum`, `product`, `mean`, `max`, `min`, `concat`, or `comma`
|
||||
to specify how the named _attribute_ is accumulated onto the attribute of the same name in a feature that does survive.
|
||||
The attributes and operations may also be specified as JSON keys and values: `--accumulate-attribute='{"attr": "operation", "attr2", "operation2"}'`.
|
||||
The attributes and operations may also be specified as JSON keys and values: `--accumulate-attribute='{"attr": "operation", "attr2": "operation2"}'`.
|
||||
* `--set-attribute` _attribute_`:`_value_: Set the value of the specified _attribute_ in each feature to the specified _value_. This is mostly useful to give an attribute in each feature an initial value for `--accumulate-attribute`.
|
||||
The attributes and values may also be specified as JSON keys and values: `--set-attribute='{"attr": value, "attr2", value}'`.
|
||||
The attributes and values may also be specified as JSON keys and values: `--set-attribute='{"attr": value, "attr2": value}'`.
|
||||
* `-pe` or `--empty-csv-columns-are-null`: Treat empty CSV columns as nulls rather than as empty strings.
|
||||
* `-aI` or `--convert-stringified-ids-to-numbers`: If a feature ID is the string representation of a number, convert it to a plain number to use as the feature ID.
|
||||
* `--use-attribute-for-id=`*name*: Use the attribute with the specified *name* as if it were specified as the feature ID. (If this attribute is a stringified number, you must also use `-aI` to convert it to a number.)
|
||||
@@ -490,7 +490,7 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
|
||||
|
||||
### Dropping tightly overlapping features
|
||||
|
||||
* `-g` _gamma_ or `--gamma=_gamma`_: Rate at which especially dense dots are dropped (default 0, for no effect). A gamma of 2 reduces the number of dots less than a pixel apart to the square root of their original number.
|
||||
* `-g` _gamma_ or `--gamma=`_gamma_: Rate at which especially dense dots are dropped (default 0, for no effect). A gamma of 2 reduces the number of dots less than a pixel apart to the square root of their original number.
|
||||
* `-aG` or `--increase-gamma-as-needed`: If a tile is too large, try to reduce it to under 500K by increasing the `-g` gamma. The discovered gamma applies to the entire zoom level. You probably want to use `--drop-densest-as-needed` instead.
|
||||
|
||||
### Line and polygon simplification
|
||||
|
||||
+21
-39
@@ -89,7 +89,7 @@ void set_attribute_accum(std::unordered_map<std::string, attribute_op> &attribut
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static void preserve_attribute1(attribute_op const &op, std::string const &key, T const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<T> &full_values, std::unordered_map<std::string, accum_state> &attribute_accum_state, key_pool &key_pool) {
|
||||
static void preserve_attribute1(attribute_op const &op, std::string const &key, T const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<T> &full_values, key_pool &key_pool) {
|
||||
for (size_t i = 0; i < full_keys.size(); i++) {
|
||||
if (key == *full_keys[i]) {
|
||||
switch (op) {
|
||||
@@ -120,19 +120,13 @@ static void preserve_attribute1(attribute_op const &op, std::string const &key,
|
||||
}
|
||||
|
||||
case op_mean: {
|
||||
auto state = attribute_accum_state.find(key);
|
||||
if (state == attribute_accum_state.end()) {
|
||||
accum_state s;
|
||||
s.sum = full_values[i].to_double() + val.to_double();
|
||||
s.count = 2;
|
||||
attribute_accum_state.insert(std::pair<std::string, accum_state>(key, s));
|
||||
|
||||
full_values[i] = (s.sum / s.count);
|
||||
size_t count = full_values[i].get_count();
|
||||
if (count <= 1) {
|
||||
full_values[i].set_double_count((full_values[i].to_double() + val.to_double()) / 2, 2);
|
||||
} else {
|
||||
state->second.sum += val.to_double();
|
||||
state->second.count += 1;
|
||||
|
||||
full_values[i] = (state->second.sum / state->second.count);
|
||||
double sum = full_values[i].to_double() * count + val.to_double();
|
||||
count++;
|
||||
full_values[i].set_double_count(sum / count, count);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -146,16 +140,11 @@ static void preserve_attribute1(attribute_op const &op, std::string const &key,
|
||||
return;
|
||||
|
||||
case op_count: {
|
||||
auto state = attribute_accum_state.find(key);
|
||||
if (state == attribute_accum_state.end()) { // not already present
|
||||
accum_state s;
|
||||
s.count = 2;
|
||||
attribute_accum_state.insert(std::pair<std::string, accum_state>(key, s));
|
||||
|
||||
full_values[i] = (s.count);
|
||||
} else { // already present, incrementing
|
||||
state->second.count += 1;
|
||||
full_values[i] = (state->second.count);
|
||||
size_t count = full_values[i].get_count();
|
||||
if (count <= 1) {
|
||||
full_values[i].set_double_count(2, 2);
|
||||
} else {
|
||||
full_values[i].set_double_count(count + 1, count + 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -173,20 +162,13 @@ static void preserve_attribute1(attribute_op const &op, std::string const &key,
|
||||
v = val;
|
||||
break;
|
||||
|
||||
case op_count: {
|
||||
auto state = attribute_accum_state.find(key);
|
||||
if (state == attribute_accum_state.end()) { // not already present
|
||||
accum_state s;
|
||||
s.count = 1;
|
||||
attribute_accum_state.insert(std::pair<std::string, accum_state>(key, s));
|
||||
case op_count:
|
||||
v.set_double_count(1, 1);
|
||||
break;
|
||||
|
||||
v = (s.count);
|
||||
} else { // already present, incrementing
|
||||
fprintf(stderr, "preserve_attribute: can't happen (count)\n");
|
||||
exit(EXIT_IMPOSSIBLE);
|
||||
}
|
||||
case op_mean:
|
||||
v.set_double_count(val.to_double(), 1);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
fprintf(stderr, "can't happen: operation that isn't used by --accumulate-numeric-attributes\n");
|
||||
@@ -197,10 +179,10 @@ static void preserve_attribute1(attribute_op const &op, std::string const &key,
|
||||
full_values.push_back(v);
|
||||
}
|
||||
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, mvt_value const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<mvt_value> &full_values, std::unordered_map<std::string, accum_state> &attribute_accum_state, key_pool &key_pool) {
|
||||
preserve_attribute1(op, key, val, full_keys, full_values, attribute_accum_state, key_pool);
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, mvt_value const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<mvt_value> &full_values, key_pool &key_pool) {
|
||||
preserve_attribute1(op, key, val, full_keys, full_values, key_pool);
|
||||
}
|
||||
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, serial_val const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<serial_val> &full_values, std::unordered_map<std::string, accum_state> &attribute_accum_state, key_pool &key_pool) {
|
||||
preserve_attribute1(op, key, val, full_keys, full_values, attribute_accum_state, key_pool);
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, serial_val const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<serial_val> &full_values, key_pool &key_pool) {
|
||||
preserve_attribute1(op, key, val, full_keys, full_values, key_pool);
|
||||
}
|
||||
|
||||
+2
-7
@@ -19,19 +19,14 @@ enum attribute_op {
|
||||
op_count,
|
||||
};
|
||||
|
||||
struct accum_state {
|
||||
double sum = 0;
|
||||
double count = 0;
|
||||
};
|
||||
|
||||
struct serial_val;
|
||||
struct key_pool;
|
||||
|
||||
void set_attribute_accum(std::unordered_map<std::string, attribute_op> &attribute_accum, std::string name, std::string type);
|
||||
void set_attribute_accum(std::unordered_map<std::string, attribute_op> &attribute_accum, const char *arg, char **argv);
|
||||
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, serial_val const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<serial_val> &full_values, std::unordered_map<std::string, accum_state> &attribute_accum_state, key_pool &key_pool);
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, mvt_value const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<mvt_value> &full_values, std::unordered_map<std::string, accum_state> &attribute_accum_state, key_pool &key_pool);
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, serial_val const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<serial_val> &full_values, key_pool &key_pool);
|
||||
void preserve_attribute(attribute_op const &op, std::string const &key, mvt_value const &val, std::vector<std::shared_ptr<std::string>> &full_keys, std::vector<mvt_value> &full_values, key_pool &key_pool);
|
||||
|
||||
extern std::map<std::string, attribute_op> numeric_operations;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <mapbox/geometry/point.hpp>
|
||||
#include <mapbox/geometry/multi_polygon.hpp>
|
||||
#include <mapbox/geometry/wagyu/wagyu.hpp>
|
||||
#include <clipper2/clipper.h>
|
||||
#include <limits.h>
|
||||
#include "geometry.hpp"
|
||||
#include "errors.hpp"
|
||||
@@ -13,6 +14,7 @@
|
||||
#include "serial.hpp"
|
||||
#include "attribute.hpp"
|
||||
#include "projection.hpp"
|
||||
#include "read_json.hpp"
|
||||
|
||||
static std::vector<std::pair<double, double>> clip_poly1(std::vector<std::pair<double, double>> &geom,
|
||||
long long minx, long long miny, long long maxx, long long maxy,
|
||||
@@ -385,6 +387,123 @@ drawvec clean_or_clip_poly(drawvec &geom, int z, int buffer, bool clip, bool try
|
||||
return ret;
|
||||
}
|
||||
|
||||
drawvec clip_poly_poly(drawvec const &geom, drawvec const &bounds) {
|
||||
mapbox::geometry::multi_polygon<long long> result;
|
||||
|
||||
{
|
||||
mapbox::geometry::wagyu::wagyu<long long> wagyu;
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
if (geom[i].op == VT_MOVETO) {
|
||||
mapbox::geometry::linear_ring<long long> lr;
|
||||
lr.push_back(mapbox::geometry::point<long long>(geom[i].x, geom[i].y));
|
||||
|
||||
size_t j;
|
||||
for (j = i + 1; j < geom.size(); j++) {
|
||||
if (geom[j].op != VT_LINETO) {
|
||||
break;
|
||||
}
|
||||
lr.push_back(mapbox::geometry::point<long long>(geom[j].x, geom[j].y));
|
||||
}
|
||||
|
||||
if (lr.size() >= 4) {
|
||||
wagyu.add_ring(lr);
|
||||
}
|
||||
|
||||
i = j - 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < bounds.size(); i++) {
|
||||
if (bounds[i].op == VT_MOVETO) {
|
||||
mapbox::geometry::linear_ring<long long> lr;
|
||||
lr.push_back(mapbox::geometry::point<long long>(bounds[i].x, bounds[i].y));
|
||||
|
||||
size_t j;
|
||||
for (j = i + 1; j < bounds.size(); j++) {
|
||||
if (bounds[j].op != VT_LINETO) {
|
||||
break;
|
||||
}
|
||||
lr.push_back(mapbox::geometry::point<long long>(bounds[j].x, bounds[j].y));
|
||||
}
|
||||
|
||||
if (lr.size() >= 4) {
|
||||
wagyu.add_ring(lr, mapbox::geometry::wagyu::polygon_type_clip);
|
||||
}
|
||||
|
||||
i = j - 1;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
result.clear();
|
||||
wagyu.execute(mapbox::geometry::wagyu::clip_type_intersection, result, mapbox::geometry::wagyu::fill_type_positive, mapbox::geometry::wagyu::fill_type_positive);
|
||||
} catch (std::runtime_error &e) {
|
||||
fprintf(stderr, "Internal error: Polygon clipping failed\n");
|
||||
exit(EXIT_IMPOSSIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
drawvec ret;
|
||||
decode_clipped(result, ret, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
drawvec clip_point_poly(drawvec const &geom, drawvec const &bounds) {
|
||||
drawvec out;
|
||||
for (auto const &p : geom) {
|
||||
if (pnpoly_mp(bounds, p.x, p.y)) {
|
||||
out.push_back(p);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
static Clipper2Lib::Paths64 geom_to_clipper(drawvec const &geom) {
|
||||
Clipper2Lib::Paths64 subject;
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
if (geom[i].op == VT_MOVETO) {
|
||||
Clipper2Lib::Path64 path({{geom[i].x, geom[i].y}});
|
||||
size_t j;
|
||||
for (j = i + 1; j < geom.size(); j++) {
|
||||
if (geom[j].op != VT_LINETO) {
|
||||
break;
|
||||
}
|
||||
path.emplace_back(geom[j].x, geom[j].y);
|
||||
}
|
||||
subject.push_back(path);
|
||||
}
|
||||
}
|
||||
|
||||
return subject;
|
||||
}
|
||||
|
||||
static void clipper_to_geom(Clipper2Lib::Paths64 const &geom, drawvec &out) {
|
||||
for (auto const &ring : geom) {
|
||||
for (size_t i = 0; i < ring.size(); i++) {
|
||||
out.emplace_back(i == 0 ? VT_MOVETO : VT_LINETO, ring[i].x, ring[i].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drawvec clip_lines_poly(drawvec const &geom, drawvec const ®ion) {
|
||||
Clipper2Lib::Paths64 subject = geom_to_clipper(geom);
|
||||
Clipper2Lib::Paths64 clip = geom_to_clipper(region);
|
||||
|
||||
Clipper2Lib::Clipper64 clipper;
|
||||
clipper.AddOpenSubject(subject);
|
||||
clipper.AddClip(clip);
|
||||
|
||||
Clipper2Lib::Paths64 solution, open_solution;
|
||||
clipper.Execute(Clipper2Lib::ClipType::Intersection, Clipper2Lib::FillRule::Positive, solution, open_solution);
|
||||
|
||||
drawvec out;
|
||||
clipper_to_geom(solution, out);
|
||||
clipper_to_geom(open_solution, out);
|
||||
return out;
|
||||
}
|
||||
|
||||
void to_tile_scale(drawvec &geom, int z, int detail) {
|
||||
if (32 - detail - z < 0) {
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
@@ -1075,6 +1194,68 @@ bool pnpoly_mp(std::vector<mvt_geometry> const &geom, long long x, long long y)
|
||||
return found;
|
||||
}
|
||||
|
||||
bool pnpoly_mp(drawvec const &geom, long long x, long long y) {
|
||||
// assumes rings are properly nested, so inside a hole matches twice
|
||||
bool found = false;
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
if (geom[i].op == VT_MOVETO) {
|
||||
size_t j;
|
||||
for (j = i + 1; j < geom.size(); j++) {
|
||||
if (geom[j].op != VT_LINETO) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
found ^= pnpoly(geom, i, j - i, x, y);
|
||||
i = j - 1;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
clipbbox parse_clip_poly(std::string arg) {
|
||||
json_pull *jp = json_begin_string(arg.c_str());
|
||||
json_object *j = json_read_tree(jp);
|
||||
if (j == NULL) {
|
||||
fprintf(stderr, "Expected JSON object, not %s\n", arg.c_str());
|
||||
exit(EXIT_ARGS);
|
||||
}
|
||||
if (j->type != JSON_HASH) {
|
||||
fprintf(stderr, "Expected JSON geometry object, not %s\n", arg.c_str());
|
||||
exit(EXIT_ARGS);
|
||||
}
|
||||
|
||||
std::pair<int, drawvec> parsed_geometry = parse_geometry(j, jp, j, 0, 0, 0, 1LL << 32, false, false);
|
||||
json_end(jp);
|
||||
|
||||
clipbbox out;
|
||||
out.minx = LLONG_MAX;
|
||||
out.miny = LLONG_MAX;
|
||||
out.maxx = LLONG_MIN;
|
||||
out.maxy = LLONG_MIN;
|
||||
for (auto const &d : parsed_geometry.second) {
|
||||
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
|
||||
if (d.x < out.minx) {
|
||||
out.minx = d.x;
|
||||
}
|
||||
if (d.y < out.miny) {
|
||||
out.miny = d.y;
|
||||
}
|
||||
if (d.x > out.maxx) {
|
||||
out.maxx = d.x;
|
||||
}
|
||||
if (d.y > out.maxy) {
|
||||
out.maxy = d.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
out.dv = std::move(parsed_geometry.second);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int ny,
|
||||
int detail_or_unspecified, int buffer,
|
||||
std::set<std::string> const &keep,
|
||||
@@ -1087,7 +1268,9 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
|
||||
std::vector<std::string> const &unidecode_data, double simplification,
|
||||
double tiny_polygon_size,
|
||||
std::vector<mvt_layer> const &bins, std::string const &bin_by_id_list,
|
||||
std::string const &accumulate_numeric, size_t feature_limit) {
|
||||
std::string const &accumulate_numeric, size_t feature_limit,
|
||||
std::vector<clipbbox> const &clipbboxes,
|
||||
bool deduplicate_by_id) {
|
||||
std::vector<source_tile> decoded;
|
||||
|
||||
for (auto const &t : tiles) {
|
||||
@@ -1113,7 +1296,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, bins, bin_by_id_list, accumulate_numeric, feature_limit);
|
||||
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, bins, bin_by_id_list, accumulate_numeric, feature_limit, clipbboxes, deduplicate_by_id);
|
||||
}
|
||||
|
||||
// like a minimal serial_feature, but with mvt_feature-style attributes
|
||||
@@ -1127,7 +1310,30 @@ struct tile_feature {
|
||||
size_t seq = 0;
|
||||
};
|
||||
|
||||
static void add_mean(mvt_feature &feature, mvt_layer &layer, std::string const &accumulate_numeric) {
|
||||
static bool should_keep(std::string const &key,
|
||||
std::set<std::string> const &keep,
|
||||
std::set<std::string> const &exclude,
|
||||
std::vector<std::string> const &exclude_prefix) {
|
||||
if (keep.size() == 0 || keep.find(key) != keep.end()) {
|
||||
if (exclude.find(key) != exclude.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto const &prefix : exclude_prefix) {
|
||||
if (starts_with(key, prefix)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void add_mean(mvt_feature &feature, mvt_layer &layer, std::string const &accumulate_numeric,
|
||||
std::set<std::string> const &keep, std::set<std::string> const &exclude,
|
||||
std::vector<std::string> const &exclude_prefix) {
|
||||
std::string accumulate_numeric_colon = accumulate_numeric + ":";
|
||||
|
||||
std::unordered_map<std::string, size_t> attributes;
|
||||
@@ -1156,21 +1362,25 @@ static void add_mean(mvt_feature &feature, mvt_layer &layer, std::string const &
|
||||
mvt_value mean;
|
||||
mean.type = mvt_double;
|
||||
mean.numeric_value.double_value = mvt_value_to_double(sum) / count_val;
|
||||
layer.tag(feature, accumulate_numeric + ":mean:" + trunc, mean);
|
||||
|
||||
if (should_keep(key, keep, exclude, exclude_prefix)) {
|
||||
layer.tag(feature, accumulate_numeric + ":mean:" + trunc, mean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// accumulate :sum:, :min:, :max:, and :count: versions of the specified attribute
|
||||
static void preserve_numeric(const std::string &key, const mvt_value &val, // numeric attribute being accumulated
|
||||
std::vector<std::shared_ptr<std::string>> &full_keys, // keys of feature being accumulated onto
|
||||
std::vector<mvt_value> &full_values, // values of features being accumulated onto
|
||||
const std::string &accumulate_numeric, // prefix of accumulations
|
||||
std::set<std::string> &keys, // key presence in the source feature
|
||||
std::map<std::string, size_t> &numeric_out_field, // key index in the output feature
|
||||
std::unordered_map<std::string, accum_state> &attribute_accum_state, // accumulation state for preserve_attribute()
|
||||
key_pool &key_pool) {
|
||||
static void preserve_numeric(const std::string &key, const mvt_value &val, // numeric attribute being accumulated
|
||||
std::vector<std::shared_ptr<std::string>> &full_keys, // keys of feature being accumulated onto
|
||||
std::vector<mvt_value> &full_values, // values of features being accumulated onto
|
||||
const std::string &accumulate_numeric, // prefix of accumulations
|
||||
std::set<std::string> &keys, // key presence in the source feature
|
||||
std::map<std::string, size_t> &numeric_out_field, // key index in the output feature
|
||||
key_pool &key_pool,
|
||||
std::set<std::string> const &keep, std::set<std::string> const &exclude,
|
||||
std::vector<std::string> const &exclude_prefix) {
|
||||
// If this is a numeric attribute, but there is also a prefix:sum (etc.) for the
|
||||
// same attribute, we want to use that one instead of this one.
|
||||
|
||||
@@ -1203,6 +1413,10 @@ static void preserve_numeric(const std::string &key, const mvt_value &val,
|
||||
// and then put it back on for the output field
|
||||
std::string prefixed = accumulate_numeric + ":" + op.first + ":" + outkey;
|
||||
|
||||
if (!should_keep(prefixed, keep, exclude, exclude_prefix)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Does it exist in the output feature already?
|
||||
|
||||
auto prefixed_attr = numeric_out_field.find(prefixed);
|
||||
@@ -1243,7 +1457,7 @@ static void preserve_numeric(const std::string &key, const mvt_value &val,
|
||||
full_values.push_back(v);
|
||||
} else {
|
||||
full_values.push_back(full_values[out_attr->second]);
|
||||
preserve_attribute(op.second, prefixed, val, full_keys, full_values, attribute_accum_state, key_pool);
|
||||
preserve_attribute(op.second, prefixed, val, full_keys, full_values, key_pool);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1256,34 +1470,13 @@ static void preserve_numeric(const std::string &key, const mvt_value &val,
|
||||
full_values[prefixed_attr->second] = mvt_value(mvt_value_to_long_long(full_values[prefixed_attr->second]) + 1);
|
||||
}
|
||||
} else {
|
||||
preserve_attribute(op.second, prefixed, val, full_keys, full_values, attribute_accum_state, key_pool);
|
||||
preserve_attribute(op.second, prefixed, val, full_keys, full_values, key_pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool should_keep(std::string const &key,
|
||||
std::set<std::string> const &keep,
|
||||
std::set<std::string> const &exclude,
|
||||
std::vector<std::string> const &exclude_prefix) {
|
||||
if (keep.size() == 0 || keep.find(key) != keep.end()) {
|
||||
if (exclude.find(key) != exclude.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto const &prefix : exclude_prefix) {
|
||||
if (starts_with(key, prefix)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void handle_closepath_from_mvt(drawvec &geom) {
|
||||
// mvt geometries close polygons with a mvt_closepath operation
|
||||
// tippecanoe-internal geometries close polygons with a lineto to the initial point
|
||||
@@ -1306,28 +1499,81 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
std::vector<std::string> const &exclude_prefix,
|
||||
std::unordered_map<std::string, attribute_op> const &attribute_accum,
|
||||
std::string const &accumulate_numeric,
|
||||
key_pool &key_pool, int buffer) {
|
||||
key_pool &key_pool, int buffer, bool include_nonaggregate,
|
||||
std::vector<clipbbox> const &clipbboxes, int nz, int nx, int ny,
|
||||
std::set<unsigned long long> *deduplicate_ids) {
|
||||
// Add geometry to output feature
|
||||
|
||||
drawvec geom = features[0].geom;
|
||||
if (buffer >= 0) {
|
||||
int t = features[0].t;
|
||||
int t = features[0].t;
|
||||
|
||||
bool fix_polygons = false;
|
||||
if ((buffer >= 0 || clipbboxes.size() > 0) && t == VT_POLYGON) {
|
||||
fix_polygons = true;
|
||||
}
|
||||
|
||||
if (fix_polygons) {
|
||||
handle_closepath_from_mvt(geom);
|
||||
}
|
||||
|
||||
if (buffer >= 0) {
|
||||
if (t == VT_LINE) {
|
||||
geom = clip_lines(geom, 32 - outlayer.detail(), buffer);
|
||||
} else if (t == VT_POLYGON) {
|
||||
drawvec dv;
|
||||
handle_closepath_from_mvt(geom);
|
||||
geom = simple_clip_poly(geom, 32 - outlayer.detail(), buffer, dv, false);
|
||||
} else if (t == VT_POINT) {
|
||||
geom = clip_point(geom, 32 - outlayer.detail(), buffer);
|
||||
}
|
||||
|
||||
geom = remove_noop(geom, t, 0);
|
||||
if (t == VT_POLYGON) {
|
||||
geom = clean_or_clip_poly(geom, 0, 0, false, false);
|
||||
geom = close_poly(geom);
|
||||
}
|
||||
|
||||
if (clipbboxes.size() != 0) {
|
||||
// bounding box is in world coordinates at world scale
|
||||
// feature is in local coordinates at tile scale
|
||||
|
||||
long long dx = (long long) nx << (32 - nz);
|
||||
long long dy = (long long) ny << (32 - nz);
|
||||
double scale = (double) outlayer.extent / (1LL << (32 - nz));
|
||||
|
||||
for (auto const &c_world : clipbboxes) {
|
||||
clipbbox c = c_world;
|
||||
|
||||
c.minx = std::llround((c_world.minx - dx) * scale);
|
||||
c.miny = std::llround((c_world.miny - dy) * scale);
|
||||
c.maxx = std::llround((c_world.maxx - dx) * scale);
|
||||
c.maxy = std::llround((c_world.maxy - dy) * scale);
|
||||
|
||||
for (auto &p : c.dv) {
|
||||
p.x = std::llround((p.x - dx) * scale);
|
||||
p.y = std::llround((p.y - dy) * scale);
|
||||
}
|
||||
|
||||
if (t == VT_POLYGON) {
|
||||
geom = simple_clip_poly(geom, c.minx, c.miny, c.maxx, c.maxy, false);
|
||||
if (c.dv.size() > 0 && geom.size() > 0) {
|
||||
geom = clip_poly_poly(geom, c.dv);
|
||||
}
|
||||
} else if (t == VT_LINE) {
|
||||
geom = clip_lines(geom, c.minx, c.miny, c.maxx, c.maxy);
|
||||
if (c.dv.size() > 0 && geom.size() > 0) {
|
||||
geom = clip_lines_poly(geom, c.dv);
|
||||
}
|
||||
} else if (t == VT_POINT) {
|
||||
geom = clip_point(geom, c.minx, c.miny, c.maxx, c.maxy);
|
||||
if (c.dv.size() > 0 && geom.size() > 0) {
|
||||
geom = clip_point_poly(geom, c.dv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
geom = remove_noop(geom, t, 0);
|
||||
}
|
||||
|
||||
if (fix_polygons) {
|
||||
geom = clean_or_clip_poly(geom, 0, 0, false, false);
|
||||
geom = close_poly(geom);
|
||||
}
|
||||
|
||||
mvt_feature outfeature;
|
||||
@@ -1338,6 +1584,14 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
|
||||
// ID and attributes, if it didn't get clipped away
|
||||
|
||||
if (features[0].has_id && deduplicate_ids != NULL) {
|
||||
if (deduplicate_ids->find(features[0].id) != deduplicate_ids->end()) {
|
||||
outfeature.geometry.clear();
|
||||
} else {
|
||||
deduplicate_ids->insert(features[0].id);
|
||||
}
|
||||
}
|
||||
|
||||
if (outfeature.geometry.size() > 0) {
|
||||
if (features[0].has_id) {
|
||||
outfeature.has_id = true;
|
||||
@@ -1352,27 +1606,26 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
// attributes from the other features of the
|
||||
// multiplier cluster accumulated onto them
|
||||
|
||||
std::unordered_map<std::string, accum_state> attribute_accum_state;
|
||||
std::vector<std::shared_ptr<std::string>> full_keys;
|
||||
std::vector<mvt_value> full_values;
|
||||
std::map<std::string, size_t> numeric_out_field;
|
||||
|
||||
for (size_t i = 0; i + 1 < features[0].tags.size(); i += 2) {
|
||||
const std::string &key = features[0].layer->keys[features[0].tags[i]];
|
||||
auto f = attribute_accum.find(key);
|
||||
if (f != attribute_accum.end()) {
|
||||
// this attribute has an accumulator, so convert it
|
||||
full_keys.push_back(key_pool.pool(features[0].layer->keys[features[0].tags[i]]));
|
||||
full_values.push_back(features[0].layer->values[features[0].tags[i + 1]]);
|
||||
} else if (accumulate_numeric.size() > 0 && features[0].layer->values[features[0].tags[i + 1]].is_numeric()) {
|
||||
// convert numeric for accumulation
|
||||
numeric_out_field.emplace(key, full_keys.size());
|
||||
full_keys.push_back(key_pool.pool(key));
|
||||
full_values.push_back(features[0].layer->values[features[0].tags[i + 1]]);
|
||||
} else {
|
||||
// otherwise just tag it directly onto the output feature
|
||||
if (should_keep(features[0].layer->keys[features[0].tags[i]], keep, exclude, exclude_prefix)) {
|
||||
outlayer.tag(outfeature, features[0].layer->keys[features[0].tags[i]], features[0].layer->values[features[0].tags[i + 1]]);
|
||||
auto const &f = features[0];
|
||||
for (size_t i = 0; i + 1 < f.tags.size(); i += 2) {
|
||||
const std::string &key = f.layer->keys[f.tags[i]];
|
||||
if (should_keep(key, keep, exclude, exclude_prefix)) {
|
||||
if (attribute_accum.find(key) != attribute_accum.end()) {
|
||||
// this attribute has an accumulator, so convert it
|
||||
full_keys.push_back(key_pool.pool(f.layer->keys[f.tags[i]]));
|
||||
full_values.push_back(f.layer->values[f.tags[i + 1]]);
|
||||
} else if (accumulate_numeric.size() > 0 && f.layer->values[f.tags[i + 1]].is_numeric()) {
|
||||
// convert numeric for accumulation
|
||||
numeric_out_field.emplace(key, full_keys.size());
|
||||
full_keys.push_back(key_pool.pool(key));
|
||||
full_values.push_back(f.layer->values[f.tags[i + 1]]);
|
||||
} else if (include_nonaggregate) {
|
||||
// otherwise just tag it directly onto the output feature
|
||||
outlayer.tag(outfeature, f.layer->keys[f.tags[i]], f.layer->values[f.tags[i + 1]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1386,22 +1639,26 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
|
||||
for (size_t j = 0; j + 1 < features[i].tags.size(); j += 2) {
|
||||
const std::string &key = features[i].layer->keys[features[i].tags[j]];
|
||||
keys.insert(key);
|
||||
if (should_keep(key, keep, exclude, exclude_prefix)) {
|
||||
keys.insert(key);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t j = 0; j + 1 < features[i].tags.size(); j += 2) {
|
||||
const std::string &key = features[i].layer->keys[features[i].tags[j]];
|
||||
|
||||
auto f = attribute_accum.find(key);
|
||||
if (f != attribute_accum.end()) {
|
||||
mvt_value val = features[i].layer->values[features[i].tags[j + 1]];
|
||||
preserve_attribute(f->second, key, val, full_keys, full_values, attribute_accum_state, key_pool);
|
||||
} else if (accumulate_numeric.size() > 0) {
|
||||
const mvt_value &val = features[i].layer->values[features[i].tags[j + 1]];
|
||||
if (val.is_numeric()) {
|
||||
preserve_numeric(key, val, full_keys, full_values,
|
||||
accumulate_numeric,
|
||||
keys, numeric_out_field, attribute_accum_state, key_pool);
|
||||
if (should_keep(key, keep, exclude, exclude_prefix)) {
|
||||
auto found = attribute_accum.find(key);
|
||||
if (found != attribute_accum.end()) {
|
||||
mvt_value val = features[i].layer->values[features[i].tags[j + 1]];
|
||||
preserve_attribute(found->second, key, val, full_keys, full_values, key_pool);
|
||||
} else if (accumulate_numeric.size() > 0) {
|
||||
const mvt_value &val = features[i].layer->values[features[i].tags[j + 1]];
|
||||
if (val.is_numeric()) {
|
||||
preserve_numeric(key, val, full_keys, full_values,
|
||||
accumulate_numeric,
|
||||
keys, numeric_out_field, key_pool,
|
||||
keep, exclude, exclude_prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1417,9 +1674,9 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
}
|
||||
|
||||
if (accumulate_numeric.size() > 0) {
|
||||
add_mean(outfeature, outlayer, accumulate_numeric);
|
||||
add_mean(outfeature, outlayer, accumulate_numeric, keep, exclude, exclude_prefix);
|
||||
}
|
||||
} else {
|
||||
} else if (include_nonaggregate) {
|
||||
for (size_t i = 0; i + 1 < features[0].tags.size(); i += 2) {
|
||||
if (should_keep(features[0].layer->keys[features[0].tags[i]], keep, exclude, exclude_prefix)) {
|
||||
outlayer.tag(outfeature, features[0].layer->keys[features[0].tags[i]], features[0].layer->values[features[0].tags[i + 1]]);
|
||||
@@ -1562,7 +1819,7 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
std::set<std::string> keep,
|
||||
std::set<std::string> exclude,
|
||||
std::vector<std::string> exclude_prefix,
|
||||
int buffer) {
|
||||
int buffer, std::vector<clipbbox> const &clipbboxes) {
|
||||
std::vector<index_event> events;
|
||||
key_pool key_pool;
|
||||
|
||||
@@ -1725,7 +1982,8 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
if (outfeatures[i].size() > 1) {
|
||||
if (feature_out(outfeatures[i], outlayer,
|
||||
keep, exclude, exclude_prefix, attribute_accum,
|
||||
accumulate_numeric, key_pool, buffer)) {
|
||||
accumulate_numeric, key_pool, buffer, true,
|
||||
clipbboxes, z, x, y, NULL)) {
|
||||
mvt_feature &nfeature = outlayer.features.back();
|
||||
mvt_value val;
|
||||
val.type = mvt_uint;
|
||||
@@ -1737,7 +1995,9 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
} else {
|
||||
attrname = accumulate_numeric + ":count";
|
||||
}
|
||||
outlayer.tag(nfeature, attrname, val);
|
||||
if (should_keep(attrname, keep, exclude, exclude_prefix)) {
|
||||
outlayer.tag(nfeature, attrname, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1759,10 +2019,15 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
std::vector<std::string> const &unidecode_data, double simplification,
|
||||
double tiny_polygon_size,
|
||||
std::vector<mvt_layer> const &bins, std::string const &bin_by_id_list,
|
||||
std::string const &accumulate_numeric, size_t feature_limit) {
|
||||
std::string const &accumulate_numeric, size_t feature_limit,
|
||||
std::vector<clipbbox> const &clipbboxes,
|
||||
bool deduplicate_by_id) {
|
||||
mvt_tile outtile;
|
||||
key_pool key_pool;
|
||||
|
||||
// map from layer name to ids used in that layer
|
||||
std::map<std::string, std::set<unsigned long long>> deduplicate_ids;
|
||||
|
||||
for (auto const &tile : tiles) {
|
||||
for (auto const &layer : tile.tile.layers) {
|
||||
mvt_layer *outlayer = NULL;
|
||||
@@ -1789,6 +2054,16 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
outlayer = &outtile.layers.back();
|
||||
}
|
||||
|
||||
std::set<unsigned long long> *deduplicate_by_id_set = NULL;
|
||||
if (deduplicate_by_id) {
|
||||
auto layer_deduplicate_ids = deduplicate_ids.find(layer.name);
|
||||
if (layer_deduplicate_ids == deduplicate_ids.end()) {
|
||||
deduplicate_ids.emplace(layer.name, std::set<unsigned long long>());
|
||||
layer_deduplicate_ids = deduplicate_ids.find(layer.name);
|
||||
}
|
||||
deduplicate_by_id_set = &layer_deduplicate_ids->second;
|
||||
}
|
||||
|
||||
std::vector<tile_feature> pending_tile_features;
|
||||
double accum_area = 0;
|
||||
|
||||
@@ -1819,8 +2094,32 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
}
|
||||
}
|
||||
|
||||
// Clip to user-specified bounding boxes.
|
||||
// Bounding box clip first, to reduce complexity of the full clip.
|
||||
// But don't clip here if we are binning, because we need to bin points in the buffer
|
||||
if (bins.size() == 0) {
|
||||
for (auto &c : clipbboxes) {
|
||||
if (t == VT_POLYGON) {
|
||||
geom = simple_clip_poly(geom, c.minx, c.miny, c.maxx, c.maxy, false);
|
||||
if (c.dv.size() > 0 && geom.size() > 0) {
|
||||
geom = clip_poly_poly(geom, c.dv);
|
||||
}
|
||||
} else if (t == VT_LINE) {
|
||||
geom = clip_lines(geom, c.minx, c.miny, c.maxx, c.maxy);
|
||||
if (c.dv.size() > 0 && geom.size() > 0) {
|
||||
geom = clip_lines_poly(geom, c.dv);
|
||||
}
|
||||
} else if (t == VT_POINT) {
|
||||
geom = clip_point(geom, c.minx, c.miny, c.maxx, c.maxy);
|
||||
if (c.dv.size() > 0 && geom.size() > 0) {
|
||||
geom = clip_point_poly(geom, c.dv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now offset from world coordinates to output tile coordinates,
|
||||
// but retain world scale, because that is what tippecanoe clipping expects
|
||||
// but retain world scale, because that is what tippecanoe zoom-oriented clipping expects
|
||||
|
||||
long long outtilesize = 1LL << (32 - nz); // destination tile size in world coordinates
|
||||
for (auto &g : geom) {
|
||||
@@ -1886,7 +2185,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
|
||||
if (flush_multiplier_cluster) {
|
||||
if (pending_tile_features.size() > 0) {
|
||||
feature_out(pending_tile_features, *outlayer, keep, exclude, exclude_prefix, attribute_accum, accumulate_numeric, key_pool, -1);
|
||||
feature_out(pending_tile_features, *outlayer, keep, exclude, exclude_prefix, attribute_accum, accumulate_numeric, key_pool, -1, bins.size() == 0, std::vector<clipbbox>(), nz, nx, ny, deduplicate_by_id_set);
|
||||
if (outlayer->features.size() >= feature_limit) {
|
||||
break;
|
||||
}
|
||||
@@ -1946,7 +2245,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
}
|
||||
|
||||
if (pending_tile_features.size() > 0) {
|
||||
feature_out(pending_tile_features, *outlayer, keep, exclude, exclude_prefix, attribute_accum, accumulate_numeric, key_pool, -1);
|
||||
feature_out(pending_tile_features, *outlayer, keep, exclude, exclude_prefix, attribute_accum, accumulate_numeric, key_pool, -1, bins.size() == 0, std::vector<clipbbox>(), nz, nx, ny, deduplicate_by_id_set);
|
||||
pending_tile_features.clear();
|
||||
if (outlayer->features.size() >= feature_limit) {
|
||||
break;
|
||||
@@ -1986,7 +2285,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
detail_or_unspecified, buffer, keep, exclude, exclude_prefix, false, NULL,
|
||||
demultiply, filter, preserve_input_order, attribute_accum, unidecode_data,
|
||||
simplification, tiny_polygon_size, bins, bin_by_id_list, accumulate_numeric,
|
||||
1);
|
||||
1, clipbboxes, deduplicate_by_id);
|
||||
if (child.size() > 0) {
|
||||
next_overzoomed_tiles->emplace_back(nx * 2 + x, ny * 2 + y);
|
||||
}
|
||||
@@ -1998,7 +2297,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
if (bins.size() > 0) {
|
||||
outtile = assign_to_bins(outtile, bins, bin_by_id_list, nz, nx, ny,
|
||||
attribute_accum, accumulate_numeric,
|
||||
keep, exclude, exclude_prefix, buffer);
|
||||
keep, exclude, exclude_prefix, buffer, clipbboxes);
|
||||
}
|
||||
|
||||
for (ssize_t i = outtile.layers.size() - 1; i >= 0; i--) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,641 @@
|
||||
/*******************************************************************************
|
||||
* Author : Angus Johnson *
|
||||
* Date : 17 September 2024 *
|
||||
* Website : http://www.angusj.com *
|
||||
* Copyright : Angus Johnson 2010-2024 *
|
||||
* Purpose : This is the main polygon clipping module *
|
||||
* License : http://www.boost.org/LICENSE_1_0.txt *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef CLIPPER_ENGINE_H
|
||||
#define CLIPPER_ENGINE_H
|
||||
|
||||
#include <cstdlib>
|
||||
#include <stdint.h> //#541
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <numeric>
|
||||
#include <memory>
|
||||
|
||||
#include "clipper2/clipper.core.h"
|
||||
|
||||
namespace Clipper2Lib {
|
||||
|
||||
struct Scanline;
|
||||
struct IntersectNode;
|
||||
struct Active;
|
||||
struct Vertex;
|
||||
struct LocalMinima;
|
||||
struct OutRec;
|
||||
struct HorzSegment;
|
||||
|
||||
//Note: all clipping operations except for Difference are commutative.
|
||||
enum class ClipType { NoClip, Intersection, Union, Difference, Xor };
|
||||
|
||||
enum class PathType { Subject, Clip };
|
||||
enum class JoinWith { NoJoin, Left, Right };
|
||||
|
||||
enum class VertexFlags : uint32_t {
|
||||
Empty = 0, OpenStart = 1, OpenEnd = 2, LocalMax = 4, LocalMin = 8
|
||||
};
|
||||
|
||||
constexpr enum VertexFlags operator &(enum VertexFlags a, enum VertexFlags b)
|
||||
{
|
||||
return (enum VertexFlags)(uint32_t(a) & uint32_t(b));
|
||||
}
|
||||
|
||||
constexpr enum VertexFlags operator |(enum VertexFlags a, enum VertexFlags b)
|
||||
{
|
||||
return (enum VertexFlags)(uint32_t(a) | uint32_t(b));
|
||||
}
|
||||
|
||||
struct Vertex {
|
||||
Point64 pt;
|
||||
Vertex* next = nullptr;
|
||||
Vertex* prev = nullptr;
|
||||
VertexFlags flags = VertexFlags::Empty;
|
||||
};
|
||||
|
||||
struct OutPt {
|
||||
Point64 pt;
|
||||
OutPt* next = nullptr;
|
||||
OutPt* prev = nullptr;
|
||||
OutRec* outrec;
|
||||
HorzSegment* horz = nullptr;
|
||||
|
||||
OutPt(const Point64& pt_, OutRec* outrec_): pt(pt_), outrec(outrec_) {
|
||||
next = this;
|
||||
prev = this;
|
||||
}
|
||||
};
|
||||
|
||||
class PolyPath;
|
||||
class PolyPath64;
|
||||
class PolyPathD;
|
||||
using PolyTree64 = PolyPath64;
|
||||
using PolyTreeD = PolyPathD;
|
||||
|
||||
struct OutRec;
|
||||
typedef std::vector<OutRec*> OutRecList;
|
||||
|
||||
//OutRec: contains a path in the clipping solution. Edges in the AEL will
|
||||
//have OutRec pointers assigned when they form part of the clipping solution.
|
||||
struct OutRec {
|
||||
size_t idx = 0;
|
||||
OutRec* owner = nullptr;
|
||||
Active* front_edge = nullptr;
|
||||
Active* back_edge = nullptr;
|
||||
OutPt* pts = nullptr;
|
||||
PolyPath* polypath = nullptr;
|
||||
OutRecList* splits = nullptr;
|
||||
OutRec* recursive_split = nullptr;
|
||||
Rect64 bounds = {};
|
||||
Path64 path;
|
||||
bool is_open = false;
|
||||
|
||||
~OutRec() {
|
||||
if (splits) delete splits;
|
||||
// nb: don't delete the split pointers
|
||||
// as these are owned by ClipperBase's outrec_list_
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//Important: UP and DOWN here are premised on Y-axis positive down
|
||||
//displays, which is the orientation used in Clipper's development.
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Active {
|
||||
Point64 bot;
|
||||
Point64 top;
|
||||
int64_t curr_x = 0; //current (updated at every new scanline)
|
||||
double dx = 0.0;
|
||||
int wind_dx = 1; //1 or -1 depending on winding direction
|
||||
int wind_cnt = 0;
|
||||
int wind_cnt2 = 0; //winding count of the opposite polytype
|
||||
OutRec* outrec = nullptr;
|
||||
//AEL: 'active edge list' (Vatti's AET - active edge table)
|
||||
// a linked list of all edges (from left to right) that are present
|
||||
// (or 'active') within the current scanbeam (a horizontal 'beam' that
|
||||
// sweeps from bottom to top over the paths in the clipping operation).
|
||||
Active* prev_in_ael = nullptr;
|
||||
Active* next_in_ael = nullptr;
|
||||
//SEL: 'sorted edge list' (Vatti's ST - sorted table)
|
||||
// linked list used when sorting edges into their new positions at the
|
||||
// top of scanbeams, but also (re)used to process horizontals.
|
||||
Active* prev_in_sel = nullptr;
|
||||
Active* next_in_sel = nullptr;
|
||||
Active* jump = nullptr;
|
||||
Vertex* vertex_top = nullptr;
|
||||
LocalMinima* local_min = nullptr; // the bottom of an edge 'bound' (also Vatti)
|
||||
bool is_left_bound = false;
|
||||
JoinWith join_with = JoinWith::NoJoin;
|
||||
};
|
||||
|
||||
struct LocalMinima {
|
||||
Vertex* vertex;
|
||||
PathType polytype;
|
||||
bool is_open;
|
||||
LocalMinima(Vertex* v, PathType pt, bool open) :
|
||||
vertex(v), polytype(pt), is_open(open){}
|
||||
};
|
||||
|
||||
struct IntersectNode {
|
||||
Point64 pt;
|
||||
Active* edge1;
|
||||
Active* edge2;
|
||||
IntersectNode() : pt(Point64(0,0)), edge1(NULL), edge2(NULL) {}
|
||||
IntersectNode(Active* e1, Active* e2, Point64& pt_) :
|
||||
pt(pt_), edge1(e1), edge2(e2) {}
|
||||
};
|
||||
|
||||
struct HorzSegment {
|
||||
OutPt* left_op;
|
||||
OutPt* right_op = nullptr;
|
||||
bool left_to_right = true;
|
||||
HorzSegment() : left_op(nullptr) { }
|
||||
explicit HorzSegment(OutPt* op) : left_op(op) { }
|
||||
};
|
||||
|
||||
struct HorzJoin {
|
||||
OutPt* op1 = nullptr;
|
||||
OutPt* op2 = nullptr;
|
||||
HorzJoin() {};
|
||||
explicit HorzJoin(OutPt* ltr, OutPt* rtl) : op1(ltr), op2(rtl) { }
|
||||
};
|
||||
|
||||
#ifdef USINGZ
|
||||
typedef std::function<void(const Point64& e1bot, const Point64& e1top,
|
||||
const Point64& e2bot, const Point64& e2top, Point64& pt)> ZCallback64;
|
||||
|
||||
typedef std::function<void(const PointD& e1bot, const PointD& e1top,
|
||||
const PointD& e2bot, const PointD& e2top, PointD& pt)> ZCallbackD;
|
||||
#endif
|
||||
|
||||
typedef std::vector<HorzSegment> HorzSegmentList;
|
||||
typedef std::unique_ptr<LocalMinima> LocalMinima_ptr;
|
||||
typedef std::vector<LocalMinima_ptr> LocalMinimaList;
|
||||
typedef std::vector<IntersectNode> IntersectNodeList;
|
||||
|
||||
// ReuseableDataContainer64 ------------------------------------------------
|
||||
|
||||
class ReuseableDataContainer64 {
|
||||
private:
|
||||
friend class ClipperBase;
|
||||
LocalMinimaList minima_list_;
|
||||
std::vector<Vertex*> vertex_lists_;
|
||||
void AddLocMin(Vertex& vert, PathType polytype, bool is_open);
|
||||
public:
|
||||
virtual ~ReuseableDataContainer64();
|
||||
void Clear();
|
||||
void AddPaths(const Paths64& paths, PathType polytype, bool is_open);
|
||||
};
|
||||
|
||||
// ClipperBase -------------------------------------------------------------
|
||||
|
||||
class ClipperBase {
|
||||
private:
|
||||
ClipType cliptype_ = ClipType::NoClip;
|
||||
FillRule fillrule_ = FillRule::EvenOdd;
|
||||
FillRule fillpos = FillRule::Positive;
|
||||
int64_t bot_y_ = 0;
|
||||
bool minima_list_sorted_ = false;
|
||||
bool using_polytree_ = false;
|
||||
Active* actives_ = nullptr;
|
||||
Active *sel_ = nullptr;
|
||||
LocalMinimaList minima_list_; //pointers in case of memory reallocs
|
||||
LocalMinimaList::iterator current_locmin_iter_;
|
||||
std::vector<Vertex*> vertex_lists_;
|
||||
std::priority_queue<int64_t> scanline_list_;
|
||||
IntersectNodeList intersect_nodes_;
|
||||
HorzSegmentList horz_seg_list_;
|
||||
std::vector<HorzJoin> horz_join_list_;
|
||||
void Reset();
|
||||
inline void InsertScanline(int64_t y);
|
||||
inline bool PopScanline(int64_t &y);
|
||||
inline bool PopLocalMinima(int64_t y, LocalMinima*& local_minima);
|
||||
void DisposeAllOutRecs();
|
||||
void DisposeVerticesAndLocalMinima();
|
||||
void DeleteEdges(Active*& e);
|
||||
inline void AddLocMin(Vertex &vert, PathType polytype, bool is_open);
|
||||
bool IsContributingClosed(const Active &e) const;
|
||||
inline bool IsContributingOpen(const Active &e) const;
|
||||
void SetWindCountForClosedPathEdge(Active &edge);
|
||||
void SetWindCountForOpenPathEdge(Active &e);
|
||||
void InsertLocalMinimaIntoAEL(int64_t bot_y);
|
||||
void InsertLeftEdge(Active &e);
|
||||
inline void PushHorz(Active &e);
|
||||
inline bool PopHorz(Active *&e);
|
||||
inline OutPt* StartOpenPath(Active &e, const Point64& pt);
|
||||
inline void UpdateEdgeIntoAEL(Active *e);
|
||||
void IntersectEdges(Active &e1, Active &e2, const Point64& pt);
|
||||
inline void DeleteFromAEL(Active &e);
|
||||
inline void AdjustCurrXAndCopyToSEL(const int64_t top_y);
|
||||
void DoIntersections(const int64_t top_y);
|
||||
void AddNewIntersectNode(Active &e1, Active &e2, const int64_t top_y);
|
||||
bool BuildIntersectList(const int64_t top_y);
|
||||
void ProcessIntersectList();
|
||||
void SwapPositionsInAEL(Active& edge1, Active& edge2);
|
||||
OutRec* NewOutRec();
|
||||
OutPt* AddOutPt(const Active &e, const Point64& pt);
|
||||
OutPt* AddLocalMinPoly(Active &e1, Active &e2,
|
||||
const Point64& pt, bool is_new = false);
|
||||
OutPt* AddLocalMaxPoly(Active &e1, Active &e2, const Point64& pt);
|
||||
void DoHorizontal(Active &horz);
|
||||
bool ResetHorzDirection(const Active &horz, const Vertex* max_vertex,
|
||||
int64_t &horz_left, int64_t &horz_right);
|
||||
void DoTopOfScanbeam(const int64_t top_y);
|
||||
Active *DoMaxima(Active &e);
|
||||
void JoinOutrecPaths(Active &e1, Active &e2);
|
||||
void FixSelfIntersects(OutRec* outrec);
|
||||
void DoSplitOp(OutRec* outRec, OutPt* splitOp);
|
||||
|
||||
inline void AddTrialHorzJoin(OutPt* op);
|
||||
void ConvertHorzSegsToJoins();
|
||||
void ProcessHorzJoins();
|
||||
|
||||
void Split(Active& e, const Point64& pt);
|
||||
inline void CheckJoinLeft(Active& e,
|
||||
const Point64& pt, bool check_curr_x = false);
|
||||
inline void CheckJoinRight(Active& e,
|
||||
const Point64& pt, bool check_curr_x = false);
|
||||
protected:
|
||||
bool preserve_collinear_ = true;
|
||||
bool reverse_solution_ = false;
|
||||
int error_code_ = 0;
|
||||
bool has_open_paths_ = false;
|
||||
bool succeeded_ = true;
|
||||
OutRecList outrec_list_; //pointers in case list memory reallocated
|
||||
bool ExecuteInternal(ClipType ct, FillRule ft, bool use_polytrees);
|
||||
void CleanCollinear(OutRec* outrec);
|
||||
bool CheckBounds(OutRec* outrec);
|
||||
bool CheckSplitOwner(OutRec* outrec, OutRecList* splits);
|
||||
void RecursiveCheckOwners(OutRec* outrec, PolyPath* polypath);
|
||||
#ifdef USINGZ
|
||||
ZCallback64 zCallback_ = nullptr;
|
||||
void SetZ(const Active& e1, const Active& e2, Point64& pt);
|
||||
#endif
|
||||
void CleanUp(); // unlike Clear, CleanUp preserves added paths
|
||||
void AddPath(const Path64& path, PathType polytype, bool is_open);
|
||||
void AddPaths(const Paths64& paths, PathType polytype, bool is_open);
|
||||
public:
|
||||
virtual ~ClipperBase();
|
||||
int ErrorCode() const { return error_code_; };
|
||||
void PreserveCollinear(bool val) { preserve_collinear_ = val; };
|
||||
bool PreserveCollinear() const { return preserve_collinear_;};
|
||||
void ReverseSolution(bool val) { reverse_solution_ = val; };
|
||||
bool ReverseSolution() const { return reverse_solution_; };
|
||||
void Clear();
|
||||
void AddReuseableData(const ReuseableDataContainer64& reuseable_data);
|
||||
#ifdef USINGZ
|
||||
int64_t DefaultZ = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
// PolyPath / PolyTree --------------------------------------------------------
|
||||
|
||||
//PolyTree: is intended as a READ-ONLY data structure for CLOSED paths returned
|
||||
//by clipping operations. While this structure is more complex than the
|
||||
//alternative Paths structure, it does preserve path 'ownership' - ie those
|
||||
//paths that contain (or own) other paths. This will be useful to some users.
|
||||
|
||||
class PolyPath {
|
||||
protected:
|
||||
PolyPath* parent_;
|
||||
public:
|
||||
PolyPath(PolyPath* parent = nullptr): parent_(parent){}
|
||||
virtual ~PolyPath() {};
|
||||
//https://en.cppreference.com/w/cpp/language/rule_of_three
|
||||
PolyPath(const PolyPath&) = delete;
|
||||
PolyPath& operator=(const PolyPath&) = delete;
|
||||
|
||||
unsigned Level() const
|
||||
{
|
||||
unsigned result = 0;
|
||||
const PolyPath* p = parent_;
|
||||
while (p) { ++result; p = p->parent_; }
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual PolyPath* AddChild(const Path64& path) = 0;
|
||||
|
||||
virtual void Clear() = 0;
|
||||
virtual size_t Count() const { return 0; }
|
||||
|
||||
const PolyPath* Parent() const { return parent_; }
|
||||
|
||||
bool IsHole() const
|
||||
{
|
||||
unsigned lvl = Level();
|
||||
//Even levels except level 0
|
||||
return lvl && !(lvl & 1);
|
||||
}
|
||||
};
|
||||
|
||||
typedef typename std::vector<std::unique_ptr<PolyPath64>> PolyPath64List;
|
||||
typedef typename std::vector<std::unique_ptr<PolyPathD>> PolyPathDList;
|
||||
|
||||
class PolyPath64 : public PolyPath {
|
||||
private:
|
||||
PolyPath64List childs_;
|
||||
Path64 polygon_;
|
||||
public:
|
||||
explicit PolyPath64(PolyPath64* parent = nullptr) : PolyPath(parent) {}
|
||||
explicit PolyPath64(PolyPath64* parent, const Path64& path) : PolyPath(parent) { polygon_ = path; }
|
||||
|
||||
~PolyPath64() {
|
||||
childs_.resize(0);
|
||||
}
|
||||
|
||||
PolyPath64* operator [] (size_t index) const
|
||||
{
|
||||
return childs_[index].get(); //std::unique_ptr
|
||||
}
|
||||
|
||||
PolyPath64* Child(size_t index) const
|
||||
{
|
||||
return childs_[index].get();
|
||||
}
|
||||
|
||||
PolyPath64List::const_iterator begin() const { return childs_.cbegin(); }
|
||||
PolyPath64List::const_iterator end() const { return childs_.cend(); }
|
||||
|
||||
PolyPath64* AddChild(const Path64& path) override
|
||||
{
|
||||
return childs_.emplace_back(std::make_unique<PolyPath64>(this, path)).get();
|
||||
}
|
||||
|
||||
void Clear() override
|
||||
{
|
||||
childs_.resize(0);
|
||||
}
|
||||
|
||||
size_t Count() const override
|
||||
{
|
||||
return childs_.size();
|
||||
}
|
||||
|
||||
const Path64& Polygon() const { return polygon_; };
|
||||
|
||||
double Area() const
|
||||
{
|
||||
return std::accumulate(childs_.cbegin(), childs_.cend(),
|
||||
Clipper2Lib::Area<int64_t>(polygon_),
|
||||
[](double a, const auto& child) {return a + child->Area(); });
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class PolyPathD : public PolyPath {
|
||||
private:
|
||||
PolyPathDList childs_;
|
||||
double scale_;
|
||||
PathD polygon_;
|
||||
public:
|
||||
explicit PolyPathD(PolyPathD* parent = nullptr) : PolyPath(parent)
|
||||
{
|
||||
scale_ = parent ? parent->scale_ : 1.0;
|
||||
}
|
||||
|
||||
explicit PolyPathD(PolyPathD* parent, const Path64& path) : PolyPath(parent)
|
||||
{
|
||||
scale_ = parent ? parent->scale_ : 1.0;
|
||||
int error_code = 0;
|
||||
polygon_ = ScalePath<double, int64_t>(path, scale_, error_code);
|
||||
}
|
||||
|
||||
explicit PolyPathD(PolyPathD* parent, const PathD& path) : PolyPath(parent)
|
||||
{
|
||||
scale_ = parent ? parent->scale_ : 1.0;
|
||||
polygon_ = path;
|
||||
}
|
||||
|
||||
~PolyPathD() {
|
||||
childs_.resize(0);
|
||||
}
|
||||
|
||||
PolyPathD* operator [] (size_t index) const
|
||||
{
|
||||
return childs_[index].get();
|
||||
}
|
||||
|
||||
PolyPathD* Child(size_t index) const
|
||||
{
|
||||
return childs_[index].get();
|
||||
}
|
||||
|
||||
PolyPathDList::const_iterator begin() const { return childs_.cbegin(); }
|
||||
PolyPathDList::const_iterator end() const { return childs_.cend(); }
|
||||
|
||||
void SetScale(double value) { scale_ = value; }
|
||||
double Scale() const { return scale_; }
|
||||
|
||||
PolyPathD* AddChild(const Path64& path) override
|
||||
{
|
||||
return childs_.emplace_back(std::make_unique<PolyPathD>(this, path)).get();
|
||||
}
|
||||
|
||||
PolyPathD* AddChild(const PathD& path)
|
||||
{
|
||||
return childs_.emplace_back(std::make_unique<PolyPathD>(this, path)).get();
|
||||
}
|
||||
|
||||
void Clear() override
|
||||
{
|
||||
childs_.resize(0);
|
||||
}
|
||||
|
||||
size_t Count() const override
|
||||
{
|
||||
return childs_.size();
|
||||
}
|
||||
|
||||
const PathD& Polygon() const { return polygon_; };
|
||||
|
||||
double Area() const
|
||||
{
|
||||
return std::accumulate(childs_.begin(), childs_.end(),
|
||||
Clipper2Lib::Area<double>(polygon_),
|
||||
[](double a, const auto& child) {return a + child->Area(); });
|
||||
}
|
||||
};
|
||||
|
||||
class Clipper64 : public ClipperBase
|
||||
{
|
||||
private:
|
||||
void BuildPaths64(Paths64& solutionClosed, Paths64* solutionOpen);
|
||||
void BuildTree64(PolyPath64& polytree, Paths64& open_paths);
|
||||
public:
|
||||
#ifdef USINGZ
|
||||
void SetZCallback(ZCallback64 cb) { zCallback_ = cb; }
|
||||
#endif
|
||||
|
||||
void AddSubject(const Paths64& subjects)
|
||||
{
|
||||
AddPaths(subjects, PathType::Subject, false);
|
||||
}
|
||||
void AddOpenSubject(const Paths64& open_subjects)
|
||||
{
|
||||
AddPaths(open_subjects, PathType::Subject, true);
|
||||
}
|
||||
void AddClip(const Paths64& clips)
|
||||
{
|
||||
AddPaths(clips, PathType::Clip, false);
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type,
|
||||
FillRule fill_rule, Paths64& closed_paths)
|
||||
{
|
||||
Paths64 dummy;
|
||||
return Execute(clip_type, fill_rule, closed_paths, dummy);
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type, FillRule fill_rule,
|
||||
Paths64& closed_paths, Paths64& open_paths)
|
||||
{
|
||||
closed_paths.clear();
|
||||
open_paths.clear();
|
||||
if (ExecuteInternal(clip_type, fill_rule, false))
|
||||
BuildPaths64(closed_paths, &open_paths);
|
||||
CleanUp();
|
||||
return succeeded_;
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type, FillRule fill_rule, PolyTree64& polytree)
|
||||
{
|
||||
Paths64 dummy;
|
||||
return Execute(clip_type, fill_rule, polytree, dummy);
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type,
|
||||
FillRule fill_rule, PolyTree64& polytree, Paths64& open_paths)
|
||||
{
|
||||
if (ExecuteInternal(clip_type, fill_rule, true))
|
||||
{
|
||||
open_paths.clear();
|
||||
polytree.Clear();
|
||||
BuildTree64(polytree, open_paths);
|
||||
}
|
||||
CleanUp();
|
||||
return succeeded_;
|
||||
}
|
||||
};
|
||||
|
||||
class ClipperD : public ClipperBase {
|
||||
private:
|
||||
double scale_ = 1.0, invScale_ = 1.0;
|
||||
#ifdef USINGZ
|
||||
ZCallbackD zCallbackD_ = nullptr;
|
||||
#endif
|
||||
void BuildPathsD(PathsD& solutionClosed, PathsD* solutionOpen);
|
||||
void BuildTreeD(PolyPathD& polytree, PathsD& open_paths);
|
||||
public:
|
||||
explicit ClipperD(int precision = 2) : ClipperBase()
|
||||
{
|
||||
CheckPrecisionRange(precision, error_code_);
|
||||
// to optimize scaling / descaling precision
|
||||
// set the scale to a power of double's radix (2) (#25)
|
||||
scale_ = std::pow(std::numeric_limits<double>::radix,
|
||||
std::ilogb(std::pow(10, precision)) + 1);
|
||||
invScale_ = 1 / scale_;
|
||||
}
|
||||
|
||||
#ifdef USINGZ
|
||||
void SetZCallback(ZCallbackD cb) { zCallbackD_ = cb; };
|
||||
|
||||
void ZCB(const Point64& e1bot, const Point64& e1top,
|
||||
const Point64& e2bot, const Point64& e2top, Point64& pt)
|
||||
{
|
||||
// de-scale (x & y)
|
||||
// temporarily convert integers to their initial float values
|
||||
// this will slow clipping marginally but will make it much easier
|
||||
// to understand the coordinates passed to the callback function
|
||||
PointD tmp = PointD(pt) * invScale_;
|
||||
PointD e1b = PointD(e1bot) * invScale_;
|
||||
PointD e1t = PointD(e1top) * invScale_;
|
||||
PointD e2b = PointD(e2bot) * invScale_;
|
||||
PointD e2t = PointD(e2top) * invScale_;
|
||||
zCallbackD_(e1b,e1t, e2b, e2t, tmp);
|
||||
pt.z = tmp.z; // only update 'z'
|
||||
};
|
||||
|
||||
void CheckCallback()
|
||||
{
|
||||
if(zCallbackD_)
|
||||
// if the user defined float point callback has been assigned
|
||||
// then assign the proxy callback function
|
||||
ClipperBase::zCallback_ =
|
||||
std::bind(&ClipperD::ZCB, this, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5);
|
||||
else
|
||||
ClipperBase::zCallback_ = nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void AddSubject(const PathsD& subjects)
|
||||
{
|
||||
AddPaths(ScalePaths<int64_t, double>(subjects, scale_, error_code_), PathType::Subject, false);
|
||||
}
|
||||
|
||||
void AddOpenSubject(const PathsD& open_subjects)
|
||||
{
|
||||
AddPaths(ScalePaths<int64_t, double>(open_subjects, scale_, error_code_), PathType::Subject, true);
|
||||
}
|
||||
|
||||
void AddClip(const PathsD& clips)
|
||||
{
|
||||
AddPaths(ScalePaths<int64_t, double>(clips, scale_, error_code_), PathType::Clip, false);
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type, FillRule fill_rule, PathsD& closed_paths)
|
||||
{
|
||||
PathsD dummy;
|
||||
return Execute(clip_type, fill_rule, closed_paths, dummy);
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type,
|
||||
FillRule fill_rule, PathsD& closed_paths, PathsD& open_paths)
|
||||
{
|
||||
#ifdef USINGZ
|
||||
CheckCallback();
|
||||
#endif
|
||||
if (ExecuteInternal(clip_type, fill_rule, false))
|
||||
{
|
||||
BuildPathsD(closed_paths, &open_paths);
|
||||
}
|
||||
CleanUp();
|
||||
return succeeded_;
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type, FillRule fill_rule, PolyTreeD& polytree)
|
||||
{
|
||||
PathsD dummy;
|
||||
return Execute(clip_type, fill_rule, polytree, dummy);
|
||||
}
|
||||
|
||||
bool Execute(ClipType clip_type,
|
||||
FillRule fill_rule, PolyTreeD& polytree, PathsD& open_paths)
|
||||
{
|
||||
#ifdef USINGZ
|
||||
CheckCallback();
|
||||
#endif
|
||||
if (ExecuteInternal(clip_type, fill_rule, true))
|
||||
{
|
||||
polytree.Clear();
|
||||
polytree.SetScale(invScale_);
|
||||
open_paths.clear();
|
||||
BuildTreeD(polytree, open_paths);
|
||||
}
|
||||
CleanUp();
|
||||
return succeeded_;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // CLIPPER_ENGINE_H
|
||||
@@ -0,0 +1,827 @@
|
||||
/*******************************************************************************
|
||||
* Author : Angus Johnson *
|
||||
* Date : 17 September 2024 *
|
||||
* Website : http://www.angusj.com *
|
||||
* Copyright : Angus Johnson 2010-2024 *
|
||||
* Purpose : This module exports the Clipper2 Library (ie DLL/so) *
|
||||
* License : http://www.boost.org/LICENSE_1_0.txt *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
Boolean clipping:
|
||||
cliptype: NoClip=0, Intersection=1, Union=2, Difference=3, Xor=4
|
||||
fillrule: EvenOdd=0, NonZero=1, Positive=2, Negative=3
|
||||
|
||||
Polygon offsetting (inflate/deflate):
|
||||
jointype: Square=0, Bevel=1, Round=2, Miter=3
|
||||
endtype: Polygon=0, Joined=1, Butt=2, Square=3, Round=4
|
||||
|
||||
The path structures used extensively in other parts of this library are all
|
||||
based on std::vector classes. Since C++ classes can't be accessed by other
|
||||
languages, these paths are converted here into very simple array data
|
||||
structures that can be parsed by just about any programming language.
|
||||
|
||||
These 2D paths are defined by series of x and y coordinates together with an
|
||||
optional user-defined 'z' value (see Z-values below). Hence, a vertex refers
|
||||
to a single x and y coordinate (+/- a user-defined value). These values will
|
||||
be either type int64_t or type double. Data structures have names that
|
||||
indicate the array type by a suffixed '64' or a 'D'. For example, the data
|
||||
structure CPath64 contains an array of int64_t values, whereas the data
|
||||
structure CPathD contains an array of double. Where documentation omits
|
||||
the type suffix (eg CPath), it is simply agnostic to the array's data type.
|
||||
|
||||
For conciseness, the following letters are used in the diagrams below:
|
||||
N: Number of vertices in a given path
|
||||
C: Count of structure's paths
|
||||
A: Array size (as distinct from the size in memory)
|
||||
|
||||
|
||||
CPath64 and CPathD:
|
||||
These are arrays of consecutive vertices preceeded by a pair of values
|
||||
containing the number of vertices (N) in the path, and a 0 value.
|
||||
_______________________________________________________________
|
||||
| counters | vertex1 | vertex2 | ... | vertexN |
|
||||
| N, 0 | x1, y1, (z1) | x2, y2, (z2) | ... | xN, yN, (zN) |
|
||||
---------------------------------------------------------------
|
||||
|
||||
|
||||
CPaths64 and CPathsD:
|
||||
These are also arrays containing any number of consecutive CPath
|
||||
structures. Preceeding these consecutive paths, there is a pair of
|
||||
values that contain the length of the array structure (A) and
|
||||
the count of following CPath structures (C).
|
||||
Memory allocation for CPaths64 = A * sizeof(int64_t)
|
||||
Memory allocation for CPathsD = A * sizeof(double)
|
||||
__________________________________________
|
||||
| counters | path1 | path2 | ... | pathC |
|
||||
| A, C | | | ... | |
|
||||
------------------------------------------
|
||||
|
||||
|
||||
CPolytree64 and CPolytreeD:
|
||||
These structures consist of two values followed by a series of CPolyPath
|
||||
structures. The first value indicates the total length of the array (A).
|
||||
The second value indicates the number of following CPolyPath structures
|
||||
that are the top level CPolyPath in the CPolytree (C). These CPolyPath
|
||||
may, in turn, contain their own nested CPolyPath children that
|
||||
collectively make a tree structure.
|
||||
_________________________________________________________
|
||||
| counters | CPolyPath1 | CPolyPath2 | ... | CPolyPathC |
|
||||
| A, C | | | ... | |
|
||||
---------------------------------------------------------
|
||||
|
||||
|
||||
CPolyPath64 and CPolyPathD:
|
||||
These array structures consist of a pair of counter values followed by a
|
||||
series of polygon vertices and a series of nested CPolyPath children.
|
||||
The first counter values indicates the number of vertices in the
|
||||
polygon (N), and the second counter indicates the CPolyPath child count (C).
|
||||
_____________________________________________________________________________
|
||||
|cntrs |vertex1 |vertex2 |...|vertexN |child1|child2|...|childC|
|
||||
|N, C |x1, y1, (z1)| x2, y2, (z2)|...|xN, yN, (zN)| | |...| |
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
DisposeArray64 & DisposeArrayD:
|
||||
All array structures are allocated in heap memory which will eventually
|
||||
need to be released. However, since applications linking to these DLL
|
||||
functions may use different memory managers, the only safe way to release
|
||||
this memory is to use the exported DisposeArray functions.
|
||||
|
||||
|
||||
(Optional) Z-Values:
|
||||
Structures will only contain user-defined z-values when the USINGZ
|
||||
pre-processor identifier is used. The library does not assign z-values
|
||||
because this field is intended for users to assign custom values to vertices.
|
||||
Z-values in input paths (subject and clip) will be copied to solution paths.
|
||||
New vertices at path intersections will generate a callback event that allows
|
||||
users to assign z-values at these new vertices. The user's callback function
|
||||
must conform with the DLLZCallback definition and be registered with the
|
||||
DLL via SetZCallback. To assist the user in assigning z-values, the library
|
||||
passes in the callback function the new intersection point together with
|
||||
the four vertices that define the two segments that are intersecting.
|
||||
|
||||
*/
|
||||
#ifndef CLIPPER2_EXPORT_H
|
||||
#define CLIPPER2_EXPORT_H
|
||||
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include "clipper2/clipper.core.h"
|
||||
#include "clipper2/clipper.engine.h"
|
||||
#include "clipper2/clipper.offset.h"
|
||||
#include "clipper2/clipper.rectclip.h"
|
||||
|
||||
namespace Clipper2Lib {
|
||||
|
||||
typedef int64_t* CPath64;
|
||||
typedef int64_t* CPaths64;
|
||||
typedef double* CPathD;
|
||||
typedef double* CPathsD;
|
||||
|
||||
typedef int64_t* CPolyPath64;
|
||||
typedef int64_t* CPolyTree64;
|
||||
typedef double* CPolyPathD;
|
||||
typedef double* CPolyTreeD;
|
||||
|
||||
template <typename T>
|
||||
struct CRect {
|
||||
T left;
|
||||
T top;
|
||||
T right;
|
||||
T bottom;
|
||||
};
|
||||
|
||||
typedef CRect<int64_t> CRect64;
|
||||
typedef CRect<double> CRectD;
|
||||
|
||||
template <typename T>
|
||||
inline bool CRectIsEmpty(const CRect<T>& rect)
|
||||
{
|
||||
return (rect.right <= rect.left) || (rect.bottom <= rect.top);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Rect<T> CRectToRect(const CRect<T>& rect)
|
||||
{
|
||||
Rect<T> result;
|
||||
result.left = rect.left;
|
||||
result.top = rect.top;
|
||||
result.right = rect.right;
|
||||
result.bottom = rect.bottom;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
inline T1 Reinterpret(T2 value) {
|
||||
return *reinterpret_cast<T1*>(&value);
|
||||
}
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#define EXTERN_DLL_EXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define EXTERN_DLL_EXPORT extern "C"
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// EXPORTED FUNCTION DECLARATIONS
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
EXTERN_DLL_EXPORT const char* Version();
|
||||
|
||||
EXTERN_DLL_EXPORT void DisposeArray64(int64_t*& p)
|
||||
{
|
||||
delete[] p;
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT void DisposeArrayD(double*& p)
|
||||
{
|
||||
delete[] p;
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOp64(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPaths64 subjects,
|
||||
const CPaths64 subjects_open, const CPaths64 clips,
|
||||
CPaths64& solution, CPaths64& solution_open,
|
||||
bool preserve_collinear = true, bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOp_PolyTree64(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPaths64 subjects,
|
||||
const CPaths64 subjects_open, const CPaths64 clips,
|
||||
CPolyTree64& sol_tree, CPaths64& solution_open,
|
||||
bool preserve_collinear = true, bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOpD(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPathsD subjects,
|
||||
const CPathsD subjects_open, const CPathsD clips,
|
||||
CPathsD& solution, CPathsD& solution_open, int precision = 2,
|
||||
bool preserve_collinear = true, bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOp_PolyTreeD(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPathsD subjects,
|
||||
const CPathsD subjects_open, const CPathsD clips,
|
||||
CPolyTreeD& solution, CPathsD& solution_open, int precision = 2,
|
||||
bool preserve_collinear = true, bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 InflatePaths64(const CPaths64 paths,
|
||||
double delta, uint8_t jointype, uint8_t endtype,
|
||||
double miter_limit = 2.0, double arc_tolerance = 0.0,
|
||||
bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT CPathsD InflatePathsD(const CPathsD paths,
|
||||
double delta, uint8_t jointype, uint8_t endtype,
|
||||
int precision = 2, double miter_limit = 2.0,
|
||||
double arc_tolerance = 0.0, bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 InflatePath64(const CPath64 path,
|
||||
double delta, uint8_t jointype, uint8_t endtype,
|
||||
double miter_limit = 2.0, double arc_tolerance = 0.0,
|
||||
bool reverse_solution = false);
|
||||
|
||||
EXTERN_DLL_EXPORT CPathsD InflatePathD(const CPathD path,
|
||||
double delta, uint8_t jointype, uint8_t endtype,
|
||||
int precision = 2, double miter_limit = 2.0,
|
||||
double arc_tolerance = 0.0, bool reverse_solution = false);
|
||||
|
||||
// RectClip & RectClipLines:
|
||||
EXTERN_DLL_EXPORT CPaths64 RectClip64(const CRect64& rect,
|
||||
const CPaths64 paths);
|
||||
EXTERN_DLL_EXPORT CPathsD RectClipD(const CRectD& rect,
|
||||
const CPathsD paths, int precision = 2);
|
||||
EXTERN_DLL_EXPORT CPaths64 RectClipLines64(const CRect64& rect,
|
||||
const CPaths64 paths);
|
||||
EXTERN_DLL_EXPORT CPathsD RectClipLinesD(const CRectD& rect,
|
||||
const CPathsD paths, int precision = 2);
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// INTERNAL FUNCTIONS
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
#ifdef USINGZ
|
||||
ZCallback64 dllCallback64 = nullptr;
|
||||
ZCallbackD dllCallbackD = nullptr;
|
||||
|
||||
constexpr int EXPORT_VERTEX_DIMENSIONALITY = 3;
|
||||
#else
|
||||
constexpr int EXPORT_VERTEX_DIMENSIONALITY = 2;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
static void GetPathCountAndCPathsArrayLen(const Paths<T>& paths,
|
||||
size_t& cnt, size_t& array_len)
|
||||
{
|
||||
array_len = 2;
|
||||
cnt = 0;
|
||||
for (const Path<T>& path : paths)
|
||||
if (path.size())
|
||||
{
|
||||
array_len += path.size() * EXPORT_VERTEX_DIMENSIONALITY + 2;
|
||||
++cnt;
|
||||
}
|
||||
}
|
||||
|
||||
static size_t GetPolyPathArrayLen64(const PolyPath64& pp)
|
||||
{
|
||||
size_t result = 2; // poly_length + child_count
|
||||
result += pp.Polygon().size() * EXPORT_VERTEX_DIMENSIONALITY;
|
||||
//plus nested children :)
|
||||
for (size_t i = 0; i < pp.Count(); ++i)
|
||||
result += GetPolyPathArrayLen64(*pp[i]);
|
||||
return result;
|
||||
}
|
||||
|
||||
static size_t GetPolyPathArrayLenD(const PolyPathD& pp)
|
||||
{
|
||||
size_t result = 2; // poly_length + child_count
|
||||
result += pp.Polygon().size() * EXPORT_VERTEX_DIMENSIONALITY;
|
||||
//plus nested children :)
|
||||
for (size_t i = 0; i < pp.Count(); ++i)
|
||||
result += GetPolyPathArrayLenD(*pp[i]);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void GetPolytreeCountAndCStorageSize64(const PolyTree64& tree,
|
||||
size_t& cnt, size_t& array_len)
|
||||
{
|
||||
cnt = tree.Count(); // nb: top level count only
|
||||
array_len = GetPolyPathArrayLen64(tree);
|
||||
}
|
||||
|
||||
static void GetPolytreeCountAndCStorageSizeD(const PolyTreeD& tree,
|
||||
size_t& cnt, size_t& array_len)
|
||||
{
|
||||
cnt = tree.Count(); // nb: top level count only
|
||||
array_len = GetPolyPathArrayLenD(tree);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static T* CreateCPathsFromPathsT(const Paths<T>& paths)
|
||||
{
|
||||
size_t cnt = 0, array_len = 0;
|
||||
GetPathCountAndCPathsArrayLen(paths, cnt, array_len);
|
||||
T* result = new T[array_len], * v = result;
|
||||
*v++ = array_len;
|
||||
*v++ = cnt;
|
||||
for (const Path<T>& path : paths)
|
||||
{
|
||||
if (!path.size()) continue;
|
||||
*v++ = path.size();
|
||||
*v++ = 0;
|
||||
for (const Point<T>& pt : path)
|
||||
{
|
||||
*v++ = pt.x;
|
||||
*v++ = pt.y;
|
||||
#ifdef USINGZ
|
||||
*v++ = Reinterpret<T>(pt.z);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
CPathsD CreateCPathsDFromPathsD(const PathsD& paths)
|
||||
{
|
||||
if (!paths.size()) return nullptr;
|
||||
size_t cnt, array_len;
|
||||
GetPathCountAndCPathsArrayLen(paths, cnt, array_len);
|
||||
CPathsD result = new double[array_len], v = result;
|
||||
*v++ = (double)array_len;
|
||||
*v++ = (double)cnt;
|
||||
for (const PathD& path : paths)
|
||||
{
|
||||
if (!path.size()) continue;
|
||||
*v = (double)path.size();
|
||||
++v; *v++ = 0;
|
||||
for (const PointD& pt : path)
|
||||
{
|
||||
*v++ = pt.x;
|
||||
*v++ = pt.y;
|
||||
#ifdef USINGZ
|
||||
* v++ = Reinterpret<double>(pt.z);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
CPathsD CreateCPathsDFromPaths64(const Paths64& paths, double scale)
|
||||
{
|
||||
if (!paths.size()) return nullptr;
|
||||
size_t cnt, array_len;
|
||||
GetPathCountAndCPathsArrayLen(paths, cnt, array_len);
|
||||
CPathsD result = new double[array_len], v = result;
|
||||
*v++ = (double)array_len;
|
||||
*v++ = (double)cnt;
|
||||
for (const Path64& path : paths)
|
||||
{
|
||||
if (!path.size()) continue;
|
||||
*v = (double)path.size();
|
||||
++v; *v++ = 0;
|
||||
for (const Point64& pt : path)
|
||||
{
|
||||
*v++ = pt.x * scale;
|
||||
*v++ = pt.y * scale;
|
||||
#ifdef USINGZ
|
||||
*v++ = Reinterpret<double>(pt.z);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static Path<T> ConvertCPathToPathT(T* path)
|
||||
{
|
||||
Path<T> result;
|
||||
if (!path) return result;
|
||||
T* v = path;
|
||||
size_t cnt = static_cast<size_t>(*v);
|
||||
v += 2; // skip 0 value
|
||||
result.reserve(cnt);
|
||||
for (size_t j = 0; j < cnt; ++j)
|
||||
{
|
||||
T x = *v++, y = *v++;
|
||||
#ifdef USINGZ
|
||||
z_type z = Reinterpret<z_type>(*v++);
|
||||
result.push_back(Point<T>(x, y, z));
|
||||
#else
|
||||
result.push_back(Point<T>(x, y));
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static Paths<T> ConvertCPathsToPathsT(T* paths)
|
||||
{
|
||||
Paths<T> result;
|
||||
if (!paths) return result;
|
||||
T* v = paths; ++v;
|
||||
size_t cnt = static_cast<size_t>(*v++);
|
||||
result.reserve(cnt);
|
||||
for (size_t i = 0; i < cnt; ++i)
|
||||
{
|
||||
size_t cnt2 = static_cast<size_t>(*v);
|
||||
v += 2;
|
||||
Path<T> path;
|
||||
path.reserve(cnt2);
|
||||
for (size_t j = 0; j < cnt2; ++j)
|
||||
{
|
||||
T x = *v++, y = *v++;
|
||||
#ifdef USINGZ
|
||||
z_type z = Reinterpret<z_type>(*v++);
|
||||
path.push_back(Point<T>(x, y, z));
|
||||
#else
|
||||
path.push_back(Point<T>(x, y));
|
||||
#endif
|
||||
}
|
||||
result.push_back(path);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static Path64 ConvertCPathDToPath64WithScale(const CPathD path, double scale)
|
||||
{
|
||||
Path64 result;
|
||||
if (!path) return result;
|
||||
double* v = path;
|
||||
size_t cnt = static_cast<size_t>(*v);
|
||||
v += 2; // skip 0 value
|
||||
result.reserve(cnt);
|
||||
for (size_t j = 0; j < cnt; ++j)
|
||||
{
|
||||
double x = *v++ * scale;
|
||||
double y = *v++ * scale;
|
||||
#ifdef USINGZ
|
||||
z_type z = Reinterpret<z_type>(*v++);
|
||||
result.push_back(Point64(x, y, z));
|
||||
#else
|
||||
result.push_back(Point64(x, y));
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static Paths64 ConvertCPathsDToPaths64(const CPathsD paths, double scale)
|
||||
{
|
||||
Paths64 result;
|
||||
if (!paths) return result;
|
||||
double* v = paths;
|
||||
++v; // skip the first value (0)
|
||||
size_t cnt = static_cast<size_t>(*v++);
|
||||
result.reserve(cnt);
|
||||
for (size_t i = 0; i < cnt; ++i)
|
||||
{
|
||||
size_t cnt2 = static_cast<size_t>(*v);
|
||||
v += 2;
|
||||
Path64 path;
|
||||
path.reserve(cnt2);
|
||||
for (size_t j = 0; j < cnt2; ++j)
|
||||
{
|
||||
double x = *v++ * scale;
|
||||
double y = *v++ * scale;
|
||||
#ifdef USINGZ
|
||||
z_type z = Reinterpret<z_type>(*v++);
|
||||
path.push_back(Point64(x, y, z));
|
||||
#else
|
||||
path.push_back(Point64(x, y));
|
||||
#endif
|
||||
}
|
||||
result.push_back(path);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void CreateCPolyPath64(const PolyPath64* pp, int64_t*& v)
|
||||
{
|
||||
*v++ = static_cast<int64_t>(pp->Polygon().size());
|
||||
*v++ = static_cast<int64_t>(pp->Count());
|
||||
for (const Point64& pt : pp->Polygon())
|
||||
{
|
||||
*v++ = pt.x;
|
||||
*v++ = pt.y;
|
||||
#ifdef USINGZ
|
||||
* v++ = Reinterpret<int64_t>(pt.z); // raw memory copy
|
||||
#endif
|
||||
}
|
||||
for (size_t i = 0; i < pp->Count(); ++i)
|
||||
CreateCPolyPath64(pp->Child(i), v);
|
||||
}
|
||||
|
||||
static void CreateCPolyPathD(const PolyPathD* pp, double*& v)
|
||||
{
|
||||
*v++ = static_cast<double>(pp->Polygon().size());
|
||||
*v++ = static_cast<double>(pp->Count());
|
||||
for (const PointD& pt : pp->Polygon())
|
||||
{
|
||||
*v++ = pt.x;
|
||||
*v++ = pt.y;
|
||||
#ifdef USINGZ
|
||||
* v++ = Reinterpret<double>(pt.z); // raw memory copy
|
||||
#endif
|
||||
}
|
||||
for (size_t i = 0; i < pp->Count(); ++i)
|
||||
CreateCPolyPathD(pp->Child(i), v);
|
||||
}
|
||||
|
||||
static int64_t* CreateCPolyTree64(const PolyTree64& tree)
|
||||
{
|
||||
size_t cnt, array_len;
|
||||
GetPolytreeCountAndCStorageSize64(tree, cnt, array_len);
|
||||
if (!cnt) return nullptr;
|
||||
// allocate storage
|
||||
int64_t* result = new int64_t[array_len];
|
||||
int64_t* v = result;
|
||||
*v++ = static_cast<int64_t>(array_len);
|
||||
*v++ = static_cast<int64_t>(tree.Count());
|
||||
for (size_t i = 0; i < tree.Count(); ++i)
|
||||
CreateCPolyPath64(tree.Child(i), v);
|
||||
return result;
|
||||
}
|
||||
|
||||
static double* CreateCPolyTreeD(const PolyTreeD& tree)
|
||||
{
|
||||
double scale = std::log10(tree.Scale());
|
||||
size_t cnt, array_len;
|
||||
GetPolytreeCountAndCStorageSizeD(tree, cnt, array_len);
|
||||
if (!cnt) return nullptr;
|
||||
// allocate storage
|
||||
double* result = new double[array_len];
|
||||
double* v = result;
|
||||
*v++ = static_cast<double>(array_len);
|
||||
*v++ = static_cast<double>(tree.Count());
|
||||
for (size_t i = 0; i < tree.Count(); ++i)
|
||||
CreateCPolyPathD(tree.Child(i), v);
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// EXPORTED FUNCTION DEFINITIONS
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
EXTERN_DLL_EXPORT const char* Version()
|
||||
{
|
||||
return CLIPPER2_VERSION;
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOp64(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPaths64 subjects,
|
||||
const CPaths64 subjects_open, const CPaths64 clips,
|
||||
CPaths64& solution, CPaths64& solution_open,
|
||||
bool preserve_collinear, bool reverse_solution)
|
||||
{
|
||||
if (cliptype > static_cast<uint8_t>(ClipType::Xor)) return -4;
|
||||
if (fillrule > static_cast<uint8_t>(FillRule::Negative)) return -3;
|
||||
|
||||
Paths64 sub, sub_open, clp, sol, sol_open;
|
||||
sub = ConvertCPathsToPathsT(subjects);
|
||||
sub_open = ConvertCPathsToPathsT(subjects_open);
|
||||
clp = ConvertCPathsToPathsT(clips);
|
||||
|
||||
Clipper64 clipper;
|
||||
clipper.PreserveCollinear(preserve_collinear);
|
||||
clipper.ReverseSolution(reverse_solution);
|
||||
#ifdef USINGZ
|
||||
if (dllCallback64)
|
||||
clipper.SetZCallback(dllCallback64);
|
||||
#endif
|
||||
if (sub.size() > 0) clipper.AddSubject(sub);
|
||||
if (sub_open.size() > 0) clipper.AddOpenSubject(sub_open);
|
||||
if (clp.size() > 0) clipper.AddClip(clp);
|
||||
if (!clipper.Execute(ClipType(cliptype), FillRule(fillrule), sol, sol_open))
|
||||
return -1; // clipping bug - should never happen :)
|
||||
solution = CreateCPathsFromPathsT(sol);
|
||||
solution_open = CreateCPathsFromPathsT(sol_open);
|
||||
return 0; //success !!
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOp_PolyTree64(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPaths64 subjects,
|
||||
const CPaths64 subjects_open, const CPaths64 clips,
|
||||
CPolyTree64& sol_tree, CPaths64& solution_open,
|
||||
bool preserve_collinear, bool reverse_solution)
|
||||
{
|
||||
if (cliptype > static_cast<uint8_t>(ClipType::Xor)) return -4;
|
||||
if (fillrule > static_cast<uint8_t>(FillRule::Negative)) return -3;
|
||||
Paths64 sub, sub_open, clp, sol_open;
|
||||
sub = ConvertCPathsToPathsT(subjects);
|
||||
sub_open = ConvertCPathsToPathsT(subjects_open);
|
||||
clp = ConvertCPathsToPathsT(clips);
|
||||
|
||||
PolyTree64 tree;
|
||||
Clipper64 clipper;
|
||||
clipper.PreserveCollinear(preserve_collinear);
|
||||
clipper.ReverseSolution(reverse_solution);
|
||||
#ifdef USINGZ
|
||||
if (dllCallback64)
|
||||
clipper.SetZCallback(dllCallback64);
|
||||
#endif
|
||||
if (sub.size() > 0) clipper.AddSubject(sub);
|
||||
if (sub_open.size() > 0) clipper.AddOpenSubject(sub_open);
|
||||
if (clp.size() > 0) clipper.AddClip(clp);
|
||||
if (!clipper.Execute(ClipType(cliptype), FillRule(fillrule), tree, sol_open))
|
||||
return -1; // clipping bug - should never happen :)
|
||||
|
||||
sol_tree = CreateCPolyTree64(tree);
|
||||
solution_open = CreateCPathsFromPathsT(sol_open);
|
||||
return 0; //success !!
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOpD(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPathsD subjects,
|
||||
const CPathsD subjects_open, const CPathsD clips,
|
||||
CPathsD& solution, CPathsD& solution_open, int precision,
|
||||
bool preserve_collinear, bool reverse_solution)
|
||||
{
|
||||
if (precision < -8 || precision > 8) return -5;
|
||||
if (cliptype > static_cast<uint8_t>(ClipType::Xor)) return -4;
|
||||
if (fillrule > static_cast<uint8_t>(FillRule::Negative)) return -3;
|
||||
//const double scale = std::pow(10, precision);
|
||||
|
||||
PathsD sub, sub_open, clp, sol, sol_open;
|
||||
sub = ConvertCPathsToPathsT(subjects);
|
||||
sub_open = ConvertCPathsToPathsT(subjects_open);
|
||||
clp = ConvertCPathsToPathsT(clips);
|
||||
|
||||
ClipperD clipper(precision);
|
||||
clipper.PreserveCollinear(preserve_collinear);
|
||||
clipper.ReverseSolution(reverse_solution);
|
||||
#ifdef USINGZ
|
||||
if (dllCallbackD)
|
||||
clipper.SetZCallback(dllCallbackD);
|
||||
#endif
|
||||
if (sub.size() > 0) clipper.AddSubject(sub);
|
||||
if (sub_open.size() > 0) clipper.AddOpenSubject(sub_open);
|
||||
if (clp.size() > 0) clipper.AddClip(clp);
|
||||
if (!clipper.Execute(ClipType(cliptype),
|
||||
FillRule(fillrule), sol, sol_open)) return -1;
|
||||
solution = CreateCPathsDFromPathsD(sol);
|
||||
solution_open = CreateCPathsDFromPathsD(sol_open);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT int BooleanOp_PolyTreeD(uint8_t cliptype,
|
||||
uint8_t fillrule, const CPathsD subjects,
|
||||
const CPathsD subjects_open, const CPathsD clips,
|
||||
CPolyTreeD& solution, CPathsD& solution_open, int precision,
|
||||
bool preserve_collinear, bool reverse_solution)
|
||||
{
|
||||
if (precision < -8 || precision > 8) return -5;
|
||||
if (cliptype > static_cast<uint8_t>(ClipType::Xor)) return -4;
|
||||
if (fillrule > static_cast<uint8_t>(FillRule::Negative)) return -3;
|
||||
//double scale = std::pow(10, precision);
|
||||
|
||||
int err = 0;
|
||||
PathsD sub, sub_open, clp, sol_open;
|
||||
sub = ConvertCPathsToPathsT(subjects);
|
||||
sub_open = ConvertCPathsToPathsT(subjects_open);
|
||||
clp = ConvertCPathsToPathsT(clips);
|
||||
|
||||
PolyTreeD tree;
|
||||
ClipperD clipper(precision);
|
||||
clipper.PreserveCollinear(preserve_collinear);
|
||||
clipper.ReverseSolution(reverse_solution);
|
||||
#ifdef USINGZ
|
||||
if (dllCallbackD)
|
||||
clipper.SetZCallback(dllCallbackD);
|
||||
#endif
|
||||
if (sub.size() > 0) clipper.AddSubject(sub);
|
||||
if (sub_open.size() > 0) clipper.AddOpenSubject(sub_open);
|
||||
if (clp.size() > 0) clipper.AddClip(clp);
|
||||
if (!clipper.Execute(ClipType(cliptype), FillRule(fillrule), tree, sol_open))
|
||||
return -1; // clipping bug - should never happen :)
|
||||
|
||||
solution = CreateCPolyTreeD(tree);
|
||||
solution_open = CreateCPathsDFromPathsD(sol_open);
|
||||
return 0; //success !!
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 InflatePaths64(const CPaths64 paths,
|
||||
double delta, uint8_t jointype, uint8_t endtype, double miter_limit,
|
||||
double arc_tolerance, bool reverse_solution)
|
||||
{
|
||||
Paths64 pp;
|
||||
pp = ConvertCPathsToPathsT(paths);
|
||||
ClipperOffset clip_offset( miter_limit,
|
||||
arc_tolerance, reverse_solution);
|
||||
clip_offset.AddPaths(pp, JoinType(jointype), EndType(endtype));
|
||||
Paths64 result;
|
||||
clip_offset.Execute(delta, result);
|
||||
return CreateCPathsFromPathsT(result);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPathsD InflatePathsD(const CPathsD paths,
|
||||
double delta, uint8_t jointype, uint8_t endtype,
|
||||
int precision, double miter_limit,
|
||||
double arc_tolerance, bool reverse_solution)
|
||||
{
|
||||
if (precision < -8 || precision > 8 || !paths) return nullptr;
|
||||
|
||||
const double scale = std::pow(10, precision);
|
||||
ClipperOffset clip_offset(miter_limit, arc_tolerance, reverse_solution);
|
||||
Paths64 pp = ConvertCPathsDToPaths64(paths, scale);
|
||||
clip_offset.AddPaths(pp, JoinType(jointype), EndType(endtype));
|
||||
Paths64 result;
|
||||
clip_offset.Execute(delta * scale, result);
|
||||
return CreateCPathsDFromPaths64(result, 1 / scale);
|
||||
}
|
||||
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 InflatePath64(const CPath64 path,
|
||||
double delta, uint8_t jointype, uint8_t endtype, double miter_limit,
|
||||
double arc_tolerance, bool reverse_solution)
|
||||
{
|
||||
Path64 pp;
|
||||
pp = ConvertCPathToPathT(path);
|
||||
ClipperOffset clip_offset(miter_limit,
|
||||
arc_tolerance, reverse_solution);
|
||||
clip_offset.AddPath(pp, JoinType(jointype), EndType(endtype));
|
||||
Paths64 result;
|
||||
clip_offset.Execute(delta, result);
|
||||
return CreateCPathsFromPathsT(result);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPathsD InflatePathD(const CPathD path,
|
||||
double delta, uint8_t jointype, uint8_t endtype,
|
||||
int precision, double miter_limit,
|
||||
double arc_tolerance, bool reverse_solution)
|
||||
{
|
||||
if (precision < -8 || precision > 8 || !path) return nullptr;
|
||||
|
||||
const double scale = std::pow(10, precision);
|
||||
ClipperOffset clip_offset(miter_limit, arc_tolerance, reverse_solution);
|
||||
Path64 pp = ConvertCPathDToPath64WithScale(path, scale);
|
||||
clip_offset.AddPath(pp, JoinType(jointype), EndType(endtype));
|
||||
Paths64 result;
|
||||
clip_offset.Execute(delta * scale, result);
|
||||
|
||||
return CreateCPathsDFromPaths64(result, 1 / scale);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 RectClip64(const CRect64& rect, const CPaths64 paths)
|
||||
{
|
||||
if (CRectIsEmpty(rect) || !paths) return nullptr;
|
||||
Rect64 r64 = CRectToRect(rect);
|
||||
class RectClip64 rc(r64);
|
||||
Paths64 pp = ConvertCPathsToPathsT(paths);
|
||||
Paths64 result = rc.Execute(pp);
|
||||
return CreateCPathsFromPathsT(result);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPathsD RectClipD(const CRectD& rect, const CPathsD paths, int precision)
|
||||
{
|
||||
if (CRectIsEmpty(rect) || !paths) return nullptr;
|
||||
if (precision < -8 || precision > 8) return nullptr;
|
||||
const double scale = std::pow(10, precision);
|
||||
|
||||
RectD r = CRectToRect(rect);
|
||||
Rect64 rec = ScaleRect<int64_t, double>(r, scale);
|
||||
Paths64 pp = ConvertCPathsDToPaths64(paths, scale);
|
||||
class RectClip64 rc(rec);
|
||||
Paths64 result = rc.Execute(pp);
|
||||
|
||||
return CreateCPathsDFromPaths64(result, 1 / scale);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 RectClipLines64(const CRect64& rect,
|
||||
const CPaths64 paths)
|
||||
{
|
||||
if (CRectIsEmpty(rect) || !paths) return nullptr;
|
||||
Rect64 r = CRectToRect(rect);
|
||||
class RectClipLines64 rcl (r);
|
||||
Paths64 pp = ConvertCPathsToPathsT(paths);
|
||||
Paths64 result = rcl.Execute(pp);
|
||||
return CreateCPathsFromPathsT(result);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPathsD RectClipLinesD(const CRectD& rect,
|
||||
const CPathsD paths, int precision)
|
||||
{
|
||||
if (CRectIsEmpty(rect) || !paths) return nullptr;
|
||||
if (precision < -8 || precision > 8) return nullptr;
|
||||
|
||||
const double scale = std::pow(10, precision);
|
||||
Rect64 r = ScaleRect<int64_t, double>(CRectToRect(rect), scale);
|
||||
class RectClipLines64 rcl(r);
|
||||
Paths64 pp = ConvertCPathsDToPaths64(paths, scale);
|
||||
Paths64 result = rcl.Execute(pp);
|
||||
return CreateCPathsDFromPaths64(result, 1 / scale);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 MinkowskiSum64(const CPath64& cpattern, const CPath64& cpath, bool is_closed)
|
||||
{
|
||||
Path64 path = ConvertCPathToPathT(cpath);
|
||||
Path64 pattern = ConvertCPathToPathT(cpattern);
|
||||
Paths64 solution = MinkowskiSum(pattern, path, is_closed);
|
||||
return CreateCPathsFromPathsT(solution);
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT CPaths64 MinkowskiDiff64(const CPath64& cpattern, const CPath64& cpath, bool is_closed)
|
||||
{
|
||||
Path64 path = ConvertCPathToPathT(cpath);
|
||||
Path64 pattern = ConvertCPathToPathT(cpattern);
|
||||
Paths64 solution = MinkowskiDiff(pattern, path, is_closed);
|
||||
return CreateCPathsFromPathsT(solution);
|
||||
}
|
||||
|
||||
#ifdef USINGZ
|
||||
typedef void (*DLLZCallback64)(const Point64& e1bot, const Point64& e1top, const Point64& e2bot, const Point64& e2top, Point64& pt);
|
||||
typedef void (*DLLZCallbackD)(const PointD& e1bot, const PointD& e1top, const PointD& e2bot, const PointD& e2top, PointD& pt);
|
||||
|
||||
EXTERN_DLL_EXPORT void SetZCallback64(DLLZCallback64 callback)
|
||||
{
|
||||
dllCallback64 = callback;
|
||||
}
|
||||
|
||||
EXTERN_DLL_EXPORT void SetZCallbackD(DLLZCallbackD callback)
|
||||
{
|
||||
dllCallbackD = callback;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif // CLIPPER2_EXPORT_H
|
||||
@@ -0,0 +1,671 @@
|
||||
/*******************************************************************************
|
||||
* Author : Angus Johnson *
|
||||
* Date : 27 April 2024 *
|
||||
* Website : http://www.angusj.com *
|
||||
* Copyright : Angus Johnson 2010-2024 *
|
||||
* Purpose : This module provides a simple interface to the Clipper Library *
|
||||
* License : http://www.boost.org/LICENSE_1_0.txt *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef CLIPPER_H
|
||||
#define CLIPPER_H
|
||||
|
||||
#include <cstdlib>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "clipper2/clipper.core.h"
|
||||
#include "clipper2/clipper.engine.h"
|
||||
|
||||
namespace Clipper2Lib {
|
||||
|
||||
inline Paths64 BooleanOp(ClipType cliptype, FillRule fillrule,
|
||||
const Paths64& subjects, const Paths64& clips)
|
||||
{
|
||||
Paths64 result;
|
||||
Clipper64 clipper;
|
||||
clipper.AddSubject(subjects);
|
||||
clipper.AddClip(clips);
|
||||
clipper.Execute(cliptype, fillrule, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void BooleanOp(ClipType cliptype, FillRule fillrule,
|
||||
const Paths64& subjects, const Paths64& clips, PolyTree64& solution)
|
||||
{
|
||||
Paths64 sol_open;
|
||||
Clipper64 clipper;
|
||||
clipper.AddSubject(subjects);
|
||||
clipper.AddClip(clips);
|
||||
clipper.Execute(cliptype, fillrule, solution, sol_open);
|
||||
}
|
||||
|
||||
inline PathsD BooleanOp(ClipType cliptype, FillRule fillrule,
|
||||
const PathsD& subjects, const PathsD& clips, int precision = 2)
|
||||
{
|
||||
int error_code = 0;
|
||||
CheckPrecisionRange(precision, error_code);
|
||||
PathsD result;
|
||||
if (error_code) return result;
|
||||
ClipperD clipper(precision);
|
||||
clipper.AddSubject(subjects);
|
||||
clipper.AddClip(clips);
|
||||
clipper.Execute(cliptype, fillrule, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void BooleanOp(ClipType cliptype, FillRule fillrule,
|
||||
const PathsD& subjects, const PathsD& clips,
|
||||
PolyTreeD& polytree, int precision = 2)
|
||||
{
|
||||
polytree.Clear();
|
||||
int error_code = 0;
|
||||
CheckPrecisionRange(precision, error_code);
|
||||
if (error_code) return;
|
||||
ClipperD clipper(precision);
|
||||
clipper.AddSubject(subjects);
|
||||
clipper.AddClip(clips);
|
||||
clipper.Execute(cliptype, fillrule, polytree);
|
||||
}
|
||||
|
||||
inline Paths64 Intersect(const Paths64& subjects, const Paths64& clips, FillRule fillrule)
|
||||
{
|
||||
return BooleanOp(ClipType::Intersection, fillrule, subjects, clips);
|
||||
}
|
||||
|
||||
inline PathsD Intersect(const PathsD& subjects, const PathsD& clips, FillRule fillrule, int decimal_prec = 2)
|
||||
{
|
||||
return BooleanOp(ClipType::Intersection, fillrule, subjects, clips, decimal_prec);
|
||||
}
|
||||
|
||||
inline Paths64 Union(const Paths64& subjects, const Paths64& clips, FillRule fillrule)
|
||||
{
|
||||
return BooleanOp(ClipType::Union, fillrule, subjects, clips);
|
||||
}
|
||||
|
||||
inline PathsD Union(const PathsD& subjects, const PathsD& clips, FillRule fillrule, int decimal_prec = 2)
|
||||
{
|
||||
return BooleanOp(ClipType::Union, fillrule, subjects, clips, decimal_prec);
|
||||
}
|
||||
|
||||
inline Paths64 Union(const Paths64& subjects, FillRule fillrule)
|
||||
{
|
||||
Paths64 result;
|
||||
Clipper64 clipper;
|
||||
clipper.AddSubject(subjects);
|
||||
clipper.Execute(ClipType::Union, fillrule, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline PathsD Union(const PathsD& subjects, FillRule fillrule, int precision = 2)
|
||||
{
|
||||
PathsD result;
|
||||
int error_code = 0;
|
||||
CheckPrecisionRange(precision, error_code);
|
||||
if (error_code) return result;
|
||||
ClipperD clipper(precision);
|
||||
clipper.AddSubject(subjects);
|
||||
clipper.Execute(ClipType::Union, fillrule, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Paths64 Difference(const Paths64& subjects, const Paths64& clips, FillRule fillrule)
|
||||
{
|
||||
return BooleanOp(ClipType::Difference, fillrule, subjects, clips);
|
||||
}
|
||||
|
||||
inline PathsD Difference(const PathsD& subjects, const PathsD& clips, FillRule fillrule, int decimal_prec = 2)
|
||||
{
|
||||
return BooleanOp(ClipType::Difference, fillrule, subjects, clips, decimal_prec);
|
||||
}
|
||||
|
||||
inline Paths64 Xor(const Paths64& subjects, const Paths64& clips, FillRule fillrule)
|
||||
{
|
||||
return BooleanOp(ClipType::Xor, fillrule, subjects, clips);
|
||||
}
|
||||
|
||||
inline PathsD Xor(const PathsD& subjects, const PathsD& clips, FillRule fillrule, int decimal_prec = 2)
|
||||
{
|
||||
return BooleanOp(ClipType::Xor, fillrule, subjects, clips, decimal_prec);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Path<T> TranslatePath(const Path<T>& path, T dx, T dy)
|
||||
{
|
||||
Path<T> result;
|
||||
result.reserve(path.size());
|
||||
std::transform(path.begin(), path.end(), back_inserter(result),
|
||||
[dx, dy](const auto& pt) { return Point<T>(pt.x + dx, pt.y +dy); });
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Path64 TranslatePath(const Path64& path, int64_t dx, int64_t dy)
|
||||
{
|
||||
return TranslatePath<int64_t>(path, dx, dy);
|
||||
}
|
||||
|
||||
inline PathD TranslatePath(const PathD& path, double dx, double dy)
|
||||
{
|
||||
return TranslatePath<double>(path, dx, dy);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Paths<T> TranslatePaths(const Paths<T>& paths, T dx, T dy)
|
||||
{
|
||||
Paths<T> result;
|
||||
result.reserve(paths.size());
|
||||
std::transform(paths.begin(), paths.end(), back_inserter(result),
|
||||
[dx, dy](const auto& path) { return TranslatePath(path, dx, dy); });
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Paths64 TranslatePaths(const Paths64& paths, int64_t dx, int64_t dy)
|
||||
{
|
||||
return TranslatePaths<int64_t>(paths, dx, dy);
|
||||
}
|
||||
|
||||
inline PathsD TranslatePaths(const PathsD& paths, double dx, double dy)
|
||||
{
|
||||
return TranslatePaths<double>(paths, dx, dy);
|
||||
}
|
||||
|
||||
namespace details
|
||||
{
|
||||
|
||||
inline void PolyPathToPaths64(const PolyPath64& polypath, Paths64& paths)
|
||||
{
|
||||
paths.push_back(polypath.Polygon());
|
||||
for (const auto& child : polypath)
|
||||
PolyPathToPaths64(*child, paths);
|
||||
}
|
||||
|
||||
inline void PolyPathToPathsD(const PolyPathD& polypath, PathsD& paths)
|
||||
{
|
||||
paths.push_back(polypath.Polygon());
|
||||
for (const auto& child : polypath)
|
||||
PolyPathToPathsD(*child, paths);
|
||||
}
|
||||
|
||||
inline bool PolyPath64ContainsChildren(const PolyPath64& pp)
|
||||
{
|
||||
for (const auto& child : pp)
|
||||
{
|
||||
// return false if this child isn't fully contained by its parent
|
||||
|
||||
// checking for a single vertex outside is a bit too crude since
|
||||
// it doesn't account for rounding errors. It's better to check
|
||||
// for consecutive vertices found outside the parent's polygon.
|
||||
|
||||
int outsideCnt = 0;
|
||||
for (const Point64& pt : child->Polygon())
|
||||
{
|
||||
PointInPolygonResult result = PointInPolygon(pt, pp.Polygon());
|
||||
if (result == PointInPolygonResult::IsInside) --outsideCnt;
|
||||
else if (result == PointInPolygonResult::IsOutside) ++outsideCnt;
|
||||
if (outsideCnt > 1) return false;
|
||||
else if (outsideCnt < -1) break;
|
||||
}
|
||||
|
||||
// now check any nested children too
|
||||
if (child->Count() > 0 && !PolyPath64ContainsChildren(*child))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void OutlinePolyPath(std::ostream& os,
|
||||
size_t idx, bool isHole, size_t count, const std::string& preamble)
|
||||
{
|
||||
std::string plural = (count == 1) ? "." : "s.";
|
||||
if (isHole)
|
||||
os << preamble << "+- Hole (" << idx << ") contains " << count <<
|
||||
" nested polygon" << plural << std::endl;
|
||||
else
|
||||
os << preamble << "+- Polygon (" << idx << ") contains " << count <<
|
||||
" hole" << plural << std::endl;
|
||||
}
|
||||
|
||||
static void OutlinePolyPath64(std::ostream& os, const PolyPath64& pp,
|
||||
size_t idx, std::string preamble)
|
||||
{
|
||||
OutlinePolyPath(os, idx, pp.IsHole(), pp.Count(), preamble);
|
||||
for (size_t i = 0; i < pp.Count(); ++i)
|
||||
if (pp.Child(i)->Count())
|
||||
details::OutlinePolyPath64(os, *pp.Child(i), i, preamble + " ");
|
||||
}
|
||||
|
||||
static void OutlinePolyPathD(std::ostream& os, const PolyPathD& pp,
|
||||
size_t idx, std::string preamble)
|
||||
{
|
||||
OutlinePolyPath(os, idx, pp.IsHole(), pp.Count(), preamble);
|
||||
for (size_t i = 0; i < pp.Count(); ++i)
|
||||
if (pp.Child(i)->Count())
|
||||
details::OutlinePolyPathD(os, *pp.Child(i), i, preamble + " ");
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
inline constexpr void MakePathGeneric(const T an_array,
|
||||
size_t array_size, std::vector<U>& result)
|
||||
{
|
||||
result.reserve(array_size / 2);
|
||||
for (size_t i = 0; i < array_size; i +=2)
|
||||
#ifdef USINGZ
|
||||
result.push_back( U{ an_array[i], an_array[i + 1], 0} );
|
||||
#else
|
||||
result.push_back( U{ an_array[i], an_array[i + 1]} );
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end details namespace
|
||||
|
||||
inline std::ostream& operator<< (std::ostream& os, const PolyTree64& pp)
|
||||
{
|
||||
std::string plural = (pp.Count() == 1) ? " polygon." : " polygons.";
|
||||
os << std::endl << "Polytree with " << pp.Count() << plural << std::endl;
|
||||
for (size_t i = 0; i < pp.Count(); ++i)
|
||||
if (pp.Child(i)->Count())
|
||||
details::OutlinePolyPath64(os, *pp.Child(i), i, " ");
|
||||
os << std::endl << std::endl;
|
||||
return os;
|
||||
}
|
||||
|
||||
inline std::ostream& operator<< (std::ostream& os, const PolyTreeD& pp)
|
||||
{
|
||||
std::string plural = (pp.Count() == 1) ? " polygon." : " polygons.";
|
||||
os << std::endl << "Polytree with " << pp.Count() << plural << std::endl;
|
||||
for (size_t i = 0; i < pp.Count(); ++i)
|
||||
if (pp.Child(i)->Count())
|
||||
details::OutlinePolyPathD(os, *pp.Child(i), i, " ");
|
||||
os << std::endl << std::endl;
|
||||
if (!pp.Level()) os << std::endl;
|
||||
return os;
|
||||
}
|
||||
|
||||
inline Paths64 PolyTreeToPaths64(const PolyTree64& polytree)
|
||||
{
|
||||
Paths64 result;
|
||||
for (const auto& child : polytree)
|
||||
details::PolyPathToPaths64(*child, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline PathsD PolyTreeToPathsD(const PolyTreeD& polytree)
|
||||
{
|
||||
PathsD result;
|
||||
for (const auto& child : polytree)
|
||||
details::PolyPathToPathsD(*child, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline bool CheckPolytreeFullyContainsChildren(const PolyTree64& polytree)
|
||||
{
|
||||
for (const auto& child : polytree)
|
||||
if (child->Count() > 0 &&
|
||||
!details::PolyPath64ContainsChildren(*child))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T,
|
||||
typename std::enable_if<
|
||||
std::is_integral<T>::value &&
|
||||
!std::is_same<char, T>::value, bool
|
||||
>::type = true>
|
||||
inline Path64 MakePath(const std::vector<T>& list)
|
||||
{
|
||||
const auto size = list.size() - list.size() % 2;
|
||||
if (list.size() != size)
|
||||
DoError(non_pair_error_i); // non-fatal without exception handling
|
||||
Path64 result;
|
||||
details::MakePathGeneric(list, size, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, std::size_t N,
|
||||
typename std::enable_if<
|
||||
std::is_integral<T>::value &&
|
||||
!std::is_same<char, T>::value, bool
|
||||
>::type = true>
|
||||
inline Path64 MakePath(const T(&list)[N])
|
||||
{
|
||||
// Make the compiler error on unpaired value (i.e. no runtime effects).
|
||||
static_assert(N % 2 == 0, "MakePath requires an even number of arguments");
|
||||
Path64 result;
|
||||
details::MakePathGeneric(list, N, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T,
|
||||
typename std::enable_if<
|
||||
std::is_arithmetic<T>::value &&
|
||||
!std::is_same<char, T>::value, bool
|
||||
>::type = true>
|
||||
inline PathD MakePathD(const std::vector<T>& list)
|
||||
{
|
||||
const auto size = list.size() - list.size() % 2;
|
||||
if (list.size() != size)
|
||||
DoError(non_pair_error_i); // non-fatal without exception handling
|
||||
PathD result;
|
||||
details::MakePathGeneric(list, size, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, std::size_t N,
|
||||
typename std::enable_if<
|
||||
std::is_arithmetic<T>::value &&
|
||||
!std::is_same<char, T>::value, bool
|
||||
>::type = true>
|
||||
inline PathD MakePathD(const T(&list)[N])
|
||||
{
|
||||
// Make the compiler error on unpaired value (i.e. no runtime effects).
|
||||
static_assert(N % 2 == 0, "MakePath requires an even number of arguments");
|
||||
PathD result;
|
||||
details::MakePathGeneric(list, N, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef USINGZ
|
||||
template<typename T2, std::size_t N>
|
||||
inline Path64 MakePathZ(const T2(&list)[N])
|
||||
{
|
||||
static_assert(N % 3 == 0 && std::numeric_limits<T2>::is_integer,
|
||||
"MakePathZ requires integer values in multiples of 3");
|
||||
std::size_t size = N / 3;
|
||||
Path64 result(size);
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
result[i] = Point64(list[i * 3],
|
||||
list[i * 3 + 1], list[i * 3 + 2]);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T2, std::size_t N>
|
||||
inline PathD MakePathZD(const T2(&list)[N])
|
||||
{
|
||||
static_assert(N % 3 == 0,
|
||||
"MakePathZD requires values in multiples of 3");
|
||||
std::size_t size = N / 3;
|
||||
PathD result(size);
|
||||
if constexpr (std::numeric_limits<T2>::is_integer)
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
result[i] = PointD(list[i * 3],
|
||||
list[i * 3 + 1], list[i * 3 + 2]);
|
||||
else
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
result[i] = PointD(list[i * 3], list[i * 3 + 1],
|
||||
static_cast<int64_t>(list[i * 3 + 2]));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline Path64 TrimCollinear(const Path64& p, bool is_open_path = false)
|
||||
{
|
||||
size_t len = p.size();
|
||||
if (len < 3)
|
||||
{
|
||||
if (!is_open_path || len < 2 || p[0] == p[1]) return Path64();
|
||||
else return p;
|
||||
}
|
||||
|
||||
Path64 dst;
|
||||
dst.reserve(len);
|
||||
Path64::const_iterator srcIt = p.cbegin(), prevIt, stop = p.cend() - 1;
|
||||
|
||||
if (!is_open_path)
|
||||
{
|
||||
while (srcIt != stop && IsCollinear(*stop, *srcIt, *(srcIt + 1)))
|
||||
++srcIt;
|
||||
while (srcIt != stop && IsCollinear(*(stop - 1), *stop, *srcIt))
|
||||
--stop;
|
||||
if (srcIt == stop) return Path64();
|
||||
}
|
||||
|
||||
prevIt = srcIt++;
|
||||
dst.push_back(*prevIt);
|
||||
for (; srcIt != stop; ++srcIt)
|
||||
{
|
||||
if (!IsCollinear(*prevIt, *srcIt, *(srcIt + 1)))
|
||||
{
|
||||
prevIt = srcIt;
|
||||
dst.push_back(*prevIt);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_open_path)
|
||||
dst.push_back(*srcIt);
|
||||
else if (!IsCollinear(*prevIt, *stop, dst[0]))
|
||||
dst.push_back(*stop);
|
||||
else
|
||||
{
|
||||
while (dst.size() > 2 &&
|
||||
IsCollinear(dst[dst.size() - 1], dst[dst.size() - 2], dst[0]))
|
||||
dst.pop_back();
|
||||
if (dst.size() < 3) return Path64();
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
inline PathD TrimCollinear(const PathD& path, int precision, bool is_open_path = false)
|
||||
{
|
||||
int error_code = 0;
|
||||
CheckPrecisionRange(precision, error_code);
|
||||
if (error_code) return PathD();
|
||||
const double scale = std::pow(10, precision);
|
||||
Path64 p = ScalePath<int64_t, double>(path, scale, error_code);
|
||||
if (error_code) return PathD();
|
||||
p = TrimCollinear(p, is_open_path);
|
||||
return ScalePath<double, int64_t>(p, 1/scale, error_code);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline double Distance(const Point<T> pt1, const Point<T> pt2)
|
||||
{
|
||||
return std::sqrt(DistanceSqr(pt1, pt2));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline double Length(const Path<T>& path, bool is_closed_path = false)
|
||||
{
|
||||
double result = 0.0;
|
||||
if (path.size() < 2) return result;
|
||||
auto it = path.cbegin(), stop = path.end() - 1;
|
||||
for (; it != stop; ++it)
|
||||
result += Distance(*it, *(it + 1));
|
||||
if (is_closed_path)
|
||||
result += Distance(*stop, *path.cbegin());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline bool NearCollinear(const Point<T>& pt1, const Point<T>& pt2, const Point<T>& pt3, double sin_sqrd_min_angle_rads)
|
||||
{
|
||||
double cp = std::abs(CrossProduct(pt1, pt2, pt3));
|
||||
return (cp * cp) / (DistanceSqr(pt1, pt2) * DistanceSqr(pt2, pt3)) < sin_sqrd_min_angle_rads;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Path<T> Ellipse(const Rect<T>& rect, size_t steps = 0)
|
||||
{
|
||||
return Ellipse(rect.MidPoint(),
|
||||
static_cast<double>(rect.Width()) *0.5,
|
||||
static_cast<double>(rect.Height()) * 0.5, steps);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Path<T> Ellipse(const Point<T>& center,
|
||||
double radiusX, double radiusY = 0, size_t steps = 0)
|
||||
{
|
||||
if (radiusX <= 0) return Path<T>();
|
||||
if (radiusY <= 0) radiusY = radiusX;
|
||||
if (steps <= 2)
|
||||
steps = static_cast<size_t>(PI * sqrt((radiusX + radiusY) / 2));
|
||||
|
||||
double si = std::sin(2 * PI / steps);
|
||||
double co = std::cos(2 * PI / steps);
|
||||
double dx = co, dy = si;
|
||||
Path<T> result;
|
||||
result.reserve(steps);
|
||||
result.push_back(Point<T>(center.x + radiusX, static_cast<double>(center.y)));
|
||||
for (size_t i = 1; i < steps; ++i)
|
||||
{
|
||||
result.push_back(Point<T>(center.x + radiusX * dx, center.y + radiusY * dy));
|
||||
double x = dx * co - dy * si;
|
||||
dy = dy * co + dx * si;
|
||||
dx = x;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
inline size_t GetNext(size_t current, size_t high,
|
||||
const std::vector<bool>& flags)
|
||||
{
|
||||
++current;
|
||||
while (current <= high && flags[current]) ++current;
|
||||
if (current <= high) return current;
|
||||
current = 0;
|
||||
while (flags[current]) ++current;
|
||||
return current;
|
||||
}
|
||||
|
||||
inline size_t GetPrior(size_t current, size_t high,
|
||||
const std::vector<bool>& flags)
|
||||
{
|
||||
if (current == 0) current = high;
|
||||
else --current;
|
||||
while (current > 0 && flags[current]) --current;
|
||||
if (!flags[current]) return current;
|
||||
current = high;
|
||||
while (flags[current]) --current;
|
||||
return current;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Path<T> SimplifyPath(const Path<T> &path,
|
||||
double epsilon, bool isClosedPath = true)
|
||||
{
|
||||
const size_t len = path.size(), high = len -1;
|
||||
const double epsSqr = Sqr(epsilon);
|
||||
if (len < 4) return Path<T>(path);
|
||||
|
||||
std::vector<bool> flags(len);
|
||||
std::vector<double> distSqr(len);
|
||||
size_t prior = high, curr = 0, start, next, prior2;
|
||||
if (isClosedPath)
|
||||
{
|
||||
distSqr[0] = PerpendicDistFromLineSqrd(path[0], path[high], path[1]);
|
||||
distSqr[high] = PerpendicDistFromLineSqrd(path[high], path[0], path[high - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
distSqr[0] = MAX_DBL;
|
||||
distSqr[high] = MAX_DBL;
|
||||
}
|
||||
for (size_t i = 1; i < high; ++i)
|
||||
distSqr[i] = PerpendicDistFromLineSqrd(path[i], path[i - 1], path[i + 1]);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (distSqr[curr] > epsSqr)
|
||||
{
|
||||
start = curr;
|
||||
do
|
||||
{
|
||||
curr = GetNext(curr, high, flags);
|
||||
} while (curr != start && distSqr[curr] > epsSqr);
|
||||
if (curr == start) break;
|
||||
}
|
||||
|
||||
prior = GetPrior(curr, high, flags);
|
||||
next = GetNext(curr, high, flags);
|
||||
if (next == prior) break;
|
||||
|
||||
// flag for removal the smaller of adjacent 'distances'
|
||||
if (distSqr[next] < distSqr[curr])
|
||||
{
|
||||
prior2 = prior;
|
||||
prior = curr;
|
||||
curr = next;
|
||||
next = GetNext(next, high, flags);
|
||||
}
|
||||
else
|
||||
prior2 = GetPrior(prior, high, flags);
|
||||
|
||||
flags[curr] = true;
|
||||
curr = next;
|
||||
next = GetNext(next, high, flags);
|
||||
|
||||
if (isClosedPath || ((curr != high) && (curr != 0)))
|
||||
distSqr[curr] = PerpendicDistFromLineSqrd(path[curr], path[prior], path[next]);
|
||||
if (isClosedPath || ((prior != 0) && (prior != high)))
|
||||
distSqr[prior] = PerpendicDistFromLineSqrd(path[prior], path[prior2], path[curr]);
|
||||
}
|
||||
Path<T> result;
|
||||
result.reserve(len);
|
||||
for (typename Path<T>::size_type i = 0; i < len; ++i)
|
||||
if (!flags[i]) result.push_back(path[i]);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Paths<T> SimplifyPaths(const Paths<T> &paths,
|
||||
double epsilon, bool isClosedPath = true)
|
||||
{
|
||||
Paths<T> result;
|
||||
result.reserve(paths.size());
|
||||
for (const auto& path : paths)
|
||||
result.push_back(SimplifyPath(path, epsilon, isClosedPath));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void RDP(const Path<T> path, std::size_t begin,
|
||||
std::size_t end, double epsSqrd, std::vector<bool>& flags)
|
||||
{
|
||||
typename Path<T>::size_type idx = 0;
|
||||
double max_d = 0;
|
||||
while (end > begin && path[begin] == path[end]) flags[end--] = false;
|
||||
for (typename Path<T>::size_type i = begin + 1; i < end; ++i)
|
||||
{
|
||||
// PerpendicDistFromLineSqrd - avoids expensive Sqrt()
|
||||
double d = PerpendicDistFromLineSqrd(path[i], path[begin], path[end]);
|
||||
if (d <= max_d) continue;
|
||||
max_d = d;
|
||||
idx = i;
|
||||
}
|
||||
if (max_d <= epsSqrd) return;
|
||||
flags[idx] = true;
|
||||
if (idx > begin + 1) RDP(path, begin, idx, epsSqrd, flags);
|
||||
if (idx < end - 1) RDP(path, idx, end, epsSqrd, flags);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Path<T> RamerDouglasPeucker(const Path<T>& path, double epsilon)
|
||||
{
|
||||
const typename Path<T>::size_type len = path.size();
|
||||
if (len < 5) return Path<T>(path);
|
||||
std::vector<bool> flags(len);
|
||||
flags[0] = true;
|
||||
flags[len - 1] = true;
|
||||
RDP(path, 0, len - 1, Sqr(epsilon), flags);
|
||||
Path<T> result;
|
||||
result.reserve(len);
|
||||
for (typename Path<T>::size_type i = 0; i < len; ++i)
|
||||
if (flags[i])
|
||||
result.push_back(path[i]);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline Paths<T> RamerDouglasPeucker(const Paths<T>& paths, double epsilon)
|
||||
{
|
||||
Paths<T> result;
|
||||
result.reserve(paths.size());
|
||||
std::transform(paths.begin(), paths.end(), back_inserter(result),
|
||||
[epsilon](const auto& path)
|
||||
{ return RamerDouglasPeucker<T>(path, epsilon); });
|
||||
return result;
|
||||
}
|
||||
|
||||
} // end Clipper2Lib namespace
|
||||
|
||||
#endif // CLIPPER_H
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef CLIPPER_VERSION_H
|
||||
#define CLIPPER_VERSION_H
|
||||
|
||||
constexpr auto CLIPPER2_VERSION = "1.4.0";
|
||||
|
||||
#endif // CLIPPER_VERSION_H
|
||||
File diff suppressed because it is too large
Load Diff
+12
-9
@@ -247,23 +247,26 @@ void decode(char *fname, int z, unsigned x, unsigned y, std::set<std::string> co
|
||||
if (fd >= 0) {
|
||||
struct stat st;
|
||||
if (fstat(fd, &st) == 0) {
|
||||
if (st.st_size < 50 * 1024 * 1024) {
|
||||
char *map = (char *) mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
if (map != NULL && map != MAP_FAILED) {
|
||||
if (strcmp(map, "SQLite format 3") != 0 && strncmp(map, "PMTiles", 7) != 0) {
|
||||
if (z >= 0) {
|
||||
char *map = (char *) mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
if (map != NULL && map != MAP_FAILED) {
|
||||
if (strcmp(map, "SQLite format 3") != 0 && strncmp(map, "PMTiles", 7) != 0) {
|
||||
if (z >= 0) {
|
||||
if (st.st_size > 250 * 1024 * 1024) {
|
||||
fprintf(stderr, "%s: unrealistically large single-tile size %zu\n", fname, (size_t) st.st_size);
|
||||
exit(EXIT_MEMORY);
|
||||
} else {
|
||||
std::string s = std::string(map, st.st_size);
|
||||
handle(s, z, x, y, to_decode, pipeline, stats, state, coordinate_mode);
|
||||
munmap(map, st.st_size);
|
||||
return;
|
||||
} else {
|
||||
fprintf(stderr, "Must specify zoom/x/y to decode a single pbf file\n");
|
||||
exit(EXIT_ARGS);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Must specify zoom/x/y to decode a single pbf file\n");
|
||||
exit(EXIT_ARGS);
|
||||
}
|
||||
}
|
||||
munmap(map, st.st_size);
|
||||
}
|
||||
munmap(map, st.st_size);
|
||||
} else {
|
||||
perror("fstat");
|
||||
}
|
||||
|
||||
+1
-1
@@ -199,7 +199,7 @@ int serialize_geojson_feature(struct serialization_state *sst, json_object *geom
|
||||
}
|
||||
|
||||
drawvec dv;
|
||||
parse_geometry(t, coordinates, dv, VT_MOVETO, sst->fname, sst->line, feature);
|
||||
parse_coordinates(t, coordinates, dv, VT_MOVETO, sst->fname, sst->line, feature);
|
||||
|
||||
serial_feature sf;
|
||||
sf.layer = layer;
|
||||
|
||||
+27
-2
@@ -99,8 +99,13 @@ drawvec clip_lines(drawvec &geom, long long x1, long long y1, long long x2, long
|
||||
drawvec clip_point(drawvec &geom, long long x1, long long y1, long long x2, long long y2);
|
||||
void visvalingam(drawvec &ls, size_t start, size_t end, double threshold, size_t retain);
|
||||
int pnpoly(const drawvec &vert, size_t start, size_t nvert, long long testx, long long testy);
|
||||
bool pnpoly_mp(drawvec const &geom, long long x, long long y);
|
||||
double distance_from_line(long long point_x, long long point_y, long long segA_x, long long segA_y, long long segB_x, long long segB_y);
|
||||
|
||||
drawvec clip_poly_poly(drawvec const &geom, drawvec const &bounds);
|
||||
drawvec clip_lines_poly(drawvec const &geom, drawvec const &bounds);
|
||||
drawvec clip_point_poly(drawvec const &geom, drawvec const &bounds);
|
||||
|
||||
struct input_tile {
|
||||
std::string tile;
|
||||
int z;
|
||||
@@ -115,6 +120,20 @@ struct source_tile {
|
||||
int y;
|
||||
};
|
||||
|
||||
struct clipbbox {
|
||||
double lon1;
|
||||
double lat1;
|
||||
double lon2;
|
||||
double lat2;
|
||||
|
||||
long long minx;
|
||||
long long miny;
|
||||
long long maxx;
|
||||
long long maxy;
|
||||
|
||||
drawvec dv; // empty, or arbitrary clipping polygon
|
||||
};
|
||||
|
||||
std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int ny,
|
||||
int detail, int buffer,
|
||||
std::set<std::string> const &keep,
|
||||
@@ -127,7 +146,9 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
std::vector<std::string> const &unidecode_data, double simplification,
|
||||
double tiny_polygon_size,
|
||||
std::vector<mvt_layer> const &bins, std::string const &bin_by_id_list,
|
||||
std::string const &accumulate_numeric, size_t feature_limit);
|
||||
std::string const &accumulate_numeric, size_t feature_limit,
|
||||
std::vector<clipbbox> const &clipbboxes,
|
||||
bool deduplicate_by_id);
|
||||
|
||||
std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int ny,
|
||||
int detail, int buffer,
|
||||
@@ -141,11 +162,15 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
|
||||
std::vector<std::string> const &unidecode_data, double simplification,
|
||||
double tiny_polygon_size,
|
||||
std::vector<mvt_layer> const &bins, std::string const &bin_by_id_list,
|
||||
std::string const &accumulate_numeric, size_t feature_limit);
|
||||
std::string const &accumulate_numeric, size_t feature_limit,
|
||||
std::vector<clipbbox> const &clipbboxes,
|
||||
bool deduplicate_by_id);
|
||||
|
||||
draw center_of_mass_mp(const drawvec &dv);
|
||||
|
||||
void get_quadkey_bounds(long long xmin, long long ymin, long long xmax, long long ymax,
|
||||
unsigned long long *start, unsigned long long *end);
|
||||
|
||||
clipbbox parse_clip_poly(std::string arg);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <limits.h>
|
||||
#include <sqlite3.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/resource.h>
|
||||
#include <pthread.h>
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
@@ -67,6 +66,7 @@
|
||||
#include "sort.hpp"
|
||||
#include "attribute.hpp"
|
||||
#include "thread.hpp"
|
||||
#include "platform.hpp"
|
||||
|
||||
static int low_detail = 12;
|
||||
static int full_detail = -1;
|
||||
@@ -187,7 +187,7 @@ void init_cpus() {
|
||||
if (TIPPECANOE_MAX_THREADS != NULL) {
|
||||
CPUS = atoi_require(TIPPECANOE_MAX_THREADS, "TIPPECANOE_MAX_THREADS");
|
||||
} else {
|
||||
CPUS = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
CPUS = get_num_avail_cpus();
|
||||
}
|
||||
|
||||
if (CPUS < 1) {
|
||||
@@ -202,13 +202,7 @@ void init_cpus() {
|
||||
// Round down to a power of 2
|
||||
CPUS = 1 << (int) (log(CPUS) / log(2));
|
||||
|
||||
struct rlimit rl;
|
||||
if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||
perror("getrlimit");
|
||||
exit(EXIT_PTHREAD);
|
||||
} else {
|
||||
MAX_FILES = rl.rlim_cur;
|
||||
}
|
||||
MAX_FILES = get_max_open_files();
|
||||
|
||||
// Don't really want too many temporary files, because the file system
|
||||
// will start to bog down eventually
|
||||
@@ -222,7 +216,7 @@ void init_cpus() {
|
||||
long long fds[MAX_FILES];
|
||||
long long i;
|
||||
for (i = 0; i < MAX_FILES; i++) {
|
||||
fds[i] = open("/dev/null", O_RDONLY | O_CLOEXEC);
|
||||
fds[i] = open(get_null_device(), O_RDONLY | O_CLOEXEC);
|
||||
if (fds[i] < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -899,7 +893,7 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split
|
||||
std::atomic<long long> indexpos(indexst.st_size);
|
||||
int bytes = sizeof(struct index);
|
||||
|
||||
int page = sysconf(_SC_PAGESIZE);
|
||||
int page = get_page_size();
|
||||
// Don't try to sort more than 2GB at once,
|
||||
// which used to crash Macs and may still
|
||||
long long max_unit = 2LL * 1024 * 1024 * 1024;
|
||||
@@ -1069,31 +1063,6 @@ void prep_drop_states(struct drop_state *ds, int maxzoom, int basezoom, double d
|
||||
}
|
||||
}
|
||||
|
||||
static size_t calc_memsize() {
|
||||
size_t mem;
|
||||
|
||||
#ifdef __APPLE__
|
||||
int64_t hw_memsize;
|
||||
size_t len = sizeof(int64_t);
|
||||
if (sysctlbyname("hw.memsize", &hw_memsize, &len, NULL, 0) < 0) {
|
||||
perror("sysctl hw.memsize");
|
||||
exit(EXIT_MEMORY);
|
||||
}
|
||||
mem = hw_memsize;
|
||||
#else
|
||||
long long pagesize = sysconf(_SC_PAGESIZE);
|
||||
long long pages = sysconf(_SC_PHYS_PAGES);
|
||||
if (pages < 0 || pagesize < 0) {
|
||||
perror("sysconf _SC_PAGESIZE or _SC_PHYS_PAGES");
|
||||
exit(EXIT_MEMORY);
|
||||
}
|
||||
|
||||
mem = (long long) pages * pagesize;
|
||||
#endif
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FILE *indexfile, const char *tmpdir, std::atomic<long long> *geompos, int maxzoom, int basezoom, double droprate, double gamma) {
|
||||
// Run through the index and geometry for each reader,
|
||||
// splitting the contents out by index into as many
|
||||
@@ -1446,7 +1415,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
size_t dist_count = 0;
|
||||
double area_sum = 0;
|
||||
|
||||
int files_open_before_reading = open("/dev/null", O_RDONLY | O_CLOEXEC);
|
||||
int files_open_before_reading = open(get_null_device(), O_RDONLY | O_CLOEXEC);
|
||||
if (files_open_before_reading < 0) {
|
||||
perror("open /dev/null");
|
||||
exit(EXIT_OPEN);
|
||||
@@ -1887,7 +1856,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
}
|
||||
}
|
||||
|
||||
int files_open_after_reading = open("/dev/null", O_RDONLY | O_CLOEXEC);
|
||||
int files_open_after_reading = open(get_null_device(), O_RDONLY | O_CLOEXEC);
|
||||
if (files_open_after_reading < 0) {
|
||||
perror("open /dev/null");
|
||||
exit(EXIT_OPEN);
|
||||
@@ -2380,6 +2349,9 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
double want = nearby_ft / 2;
|
||||
|
||||
maxzoom = ceil(log(360 / (.00000274 * want)) / log(2) - full_detail);
|
||||
if (maxzoom < 0) {
|
||||
maxzoom = 0;
|
||||
}
|
||||
if (!quiet) {
|
||||
fprintf(stderr,
|
||||
"Choosing a maxzoom of -z%d for features typically %d feet (%d meters) apart, ",
|
||||
@@ -3125,6 +3097,7 @@ int main(int argc, char **argv) {
|
||||
{"coalesce-smallest-as-needed", no_argument, &additional[A_COALESCE_SMALLEST_AS_NEEDED], 1},
|
||||
{"force-feature-limit", no_argument, &prevent[P_DYNAMIC_DROP], 1},
|
||||
{"cluster-densest-as-needed", no_argument, &additional[A_CLUSTER_DENSEST_AS_NEEDED], 1},
|
||||
{"keep-point-cluster-position", no_argument, &additional[A_KEEP_POINT_CLUSTER_POSITION], 1},
|
||||
|
||||
{"Dropping tightly overlapping features", 0, 0, 0},
|
||||
{"gamma", required_argument, 0, 'g'},
|
||||
@@ -3725,7 +3698,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
files_open_at_start = open("/dev/null", O_RDONLY | O_CLOEXEC);
|
||||
files_open_at_start = open(get_null_device(), O_RDONLY | O_CLOEXEC);
|
||||
if (files_open_at_start < 0) {
|
||||
perror("open /dev/null");
|
||||
exit(EXIT_OPEN);
|
||||
@@ -3875,7 +3848,7 @@ int main(int argc, char **argv) {
|
||||
muntrace();
|
||||
#endif
|
||||
|
||||
i = open("/dev/null", O_RDONLY | O_CLOEXEC);
|
||||
i = open(get_null_device(), O_RDONLY | O_CLOEXEC);
|
||||
// i < files_open_at_start is not an error, because reading from a pipe closes stdin
|
||||
if (i > files_open_at_start) {
|
||||
fprintf(stderr, "Internal error: did not close all files: %d\n", i);
|
||||
|
||||
@@ -24,18 +24,6 @@ struct index {
|
||||
}
|
||||
};
|
||||
|
||||
struct clipbbox {
|
||||
double lon1;
|
||||
double lat1;
|
||||
double lon2;
|
||||
double lat2;
|
||||
|
||||
long long minx;
|
||||
long long miny;
|
||||
long long maxx;
|
||||
long long maxy;
|
||||
};
|
||||
|
||||
extern std::vector<clipbbox> clipbboxes;
|
||||
|
||||
void checkdisk(std::vector<struct reader> *r);
|
||||
|
||||
+1
-1
@@ -700,7 +700,7 @@ metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minla
|
||||
|
||||
m.strategies_json = stringify_strategies(strategies);
|
||||
|
||||
if (isinf(droprate)) {
|
||||
if (std::isinf(droprate)) {
|
||||
droprate = LLONG_MAX;
|
||||
}
|
||||
if (basezoom != maxzoom || droprate != 2.5 || retain_points_multiplier != 1) {
|
||||
|
||||
@@ -316,6 +316,10 @@ struct sorted_value {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator()(const std::shared_ptr<sorted_value> &a, const std::shared_ptr<sorted_value> &b) {
|
||||
return *a < *b;
|
||||
}
|
||||
};
|
||||
|
||||
std::string mvt_tile::encode() {
|
||||
@@ -334,7 +338,7 @@ std::string mvt_tile::encode() {
|
||||
layer_writer.add_string(3, layers[i].keys[j]); /* key */
|
||||
}
|
||||
|
||||
std::vector<sorted_value> sorted_values;
|
||||
std::vector<std::shared_ptr<sorted_value>> sorted_values;
|
||||
|
||||
for (size_t v = 0; v < layers[i].values.size(); v++) {
|
||||
std::string value_string;
|
||||
@@ -371,30 +375,34 @@ std::string mvt_tile::encode() {
|
||||
exit(EXIT_IMPOSSIBLE);
|
||||
}
|
||||
|
||||
sorted_value sv;
|
||||
sv.val = std::move(value_string);
|
||||
sv.orig = v;
|
||||
std::shared_ptr<sorted_value> sv = std::make_shared<sorted_value>();
|
||||
sv->val = std::move(value_string);
|
||||
sv->orig = v;
|
||||
sorted_values.push_back(std::move(sv));
|
||||
}
|
||||
|
||||
std::stable_sort(sorted_values.begin(), sorted_values.end());
|
||||
std::stable_sort(sorted_values.begin(), sorted_values.end(), sorted_value());
|
||||
std::vector<size_t> mapping;
|
||||
mapping.resize(sorted_values.size());
|
||||
|
||||
size_t value_index = 0;
|
||||
for (size_t v = 0; v < sorted_values.size(); v++) {
|
||||
mapping[sorted_values[v].orig] = value_index;
|
||||
layer_writer.add_message(4, sorted_values[v].val);
|
||||
mapping[sorted_values[v]->orig] = value_index;
|
||||
layer_writer.add_message(4, sorted_values[v]->val);
|
||||
|
||||
// crunch out duplicates that were missed by the hashing
|
||||
while (v + 1 < sorted_values.size() && sorted_values[v].val == sorted_values[v + 1].val) {
|
||||
mapping[sorted_values[v + 1].orig] = value_index;
|
||||
while (v + 1 < sorted_values.size() && sorted_values[v]->val == sorted_values[v + 1]->val) {
|
||||
sorted_values[v]->val.clear();
|
||||
mapping[sorted_values[v + 1]->orig] = value_index;
|
||||
v++;
|
||||
}
|
||||
|
||||
sorted_values[v]->val.clear();
|
||||
value_index++;
|
||||
}
|
||||
|
||||
sorted_values.clear();
|
||||
|
||||
for (size_t f = 0; f < layers[i].features.size(); f++) {
|
||||
std::string feature_string;
|
||||
protozero::pbf_writer feature_writer(feature_string);
|
||||
|
||||
@@ -81,7 +81,8 @@ struct mvt_value;
|
||||
double mvt_value_to_double(mvt_value const &v);
|
||||
|
||||
struct mvt_value {
|
||||
mvt_value_type type;
|
||||
long /* mvt_value_type */ type : 5;
|
||||
long count : 64 - 5;
|
||||
std::shared_ptr<std::string> s;
|
||||
|
||||
union {
|
||||
@@ -138,6 +139,10 @@ struct mvt_value {
|
||||
return mvt_value_to_double(*this);
|
||||
}
|
||||
|
||||
size_t get_count() const {
|
||||
return count;
|
||||
}
|
||||
|
||||
bool operator<(const mvt_value &o) const;
|
||||
bool operator==(const mvt_value &o) const;
|
||||
std::string toString() const;
|
||||
@@ -145,11 +150,19 @@ struct mvt_value {
|
||||
mvt_value() {
|
||||
this->type = mvt_double;
|
||||
this->numeric_value.double_value = 0;
|
||||
this->count = 0;
|
||||
}
|
||||
|
||||
mvt_value(double v) {
|
||||
this->type = mvt_double;
|
||||
this->numeric_value.double_value = v;
|
||||
this->count = 0;
|
||||
}
|
||||
|
||||
void set_double_count(double v, size_t c) {
|
||||
this->type = mvt_double;
|
||||
this->numeric_value.double_value = v;
|
||||
this->count = c;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#define A_VARIABLE_DEPTH_PYRAMID ((int) 't')
|
||||
#define A_VISVALINGAM ((int) 'v')
|
||||
#define A_DETECT_WRAPAROUND ((int) 'w')
|
||||
#define A_KEEP_POINT_CLUSTER_POSITION ((int) 'a')
|
||||
|
||||
#define P_TILE_COMPRESSION ((int) 'C')
|
||||
#define P_DUPLICATION ((int) 'D')
|
||||
|
||||
+120
-20
@@ -10,6 +10,7 @@
|
||||
#include "attribute.hpp"
|
||||
#include "text.hpp"
|
||||
#include "read_json.hpp"
|
||||
#include "projection.hpp"
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
@@ -18,6 +19,7 @@ int detail = 12; // tippecanoe-style: mvt extent == 1 << detail
|
||||
int buffer = 5; // tippecanoe-style: mvt buffer == extent * buffer / 256;
|
||||
bool demultiply = false;
|
||||
bool do_compress = true;
|
||||
bool deduplicate_by_id = false;
|
||||
|
||||
std::string filter;
|
||||
bool preserve_input_order = false;
|
||||
@@ -29,6 +31,7 @@ std::string accumulate_numeric;
|
||||
std::set<std::string> keep;
|
||||
std::set<std::string> exclude;
|
||||
std::vector<std::string> exclude_prefix;
|
||||
std::vector<clipbbox> clipbboxes;
|
||||
|
||||
void usage(char **argv) {
|
||||
fprintf(stderr, "Usage: %s -o newtile.pbf.gz tile.pbf.gz oz/ox/oy nz/nx/ny\n", argv[0]);
|
||||
@@ -38,6 +41,26 @@ void usage(char **argv) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
std::string read_json_file(const char *fname) {
|
||||
std::string out;
|
||||
|
||||
FILE *f = fopen(fname, "r");
|
||||
if (f == NULL) {
|
||||
perror(optarg);
|
||||
exit(EXIT_OPEN);
|
||||
}
|
||||
|
||||
char buf[2000];
|
||||
size_t nread;
|
||||
while ((nread = fread(buf, sizeof(char), 2000, f)) != 0) {
|
||||
out += std::string(buf, nread);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int i;
|
||||
const char *outtile = NULL;
|
||||
@@ -58,6 +81,7 @@ int main(int argc, char **argv) {
|
||||
{"output", required_argument, 0, 'o'},
|
||||
{"filter-points-multiplier", no_argument, 0, 'm'},
|
||||
{"feature-filter", required_argument, 0, 'j'},
|
||||
{"feature-filter-file", required_argument, 0, 'J'},
|
||||
{"preserve-input-order", no_argument, 0, 'o' & 0x1F},
|
||||
{"accumulate-attribute", required_argument, 0, 'E'},
|
||||
{"unidecode-data", required_argument, 0, 'u' & 0x1F},
|
||||
@@ -68,6 +92,10 @@ int main(int argc, char **argv) {
|
||||
{"bin-by-id-list", required_argument, 0, 'c' & 0x1F},
|
||||
{"accumulate-numeric-attributes", required_argument, 0, 'a' & 0x1F},
|
||||
{"no-tile-compression", no_argument, 0, 'd' & 0x1F},
|
||||
{"clip-bounding-box", required_argument, 0, 'k' & 0x1F},
|
||||
{"clip-polygon", required_argument, 0, 'l' & 0x1F},
|
||||
{"clip-polygon-file", required_argument, 0, 'm' & 0x1F},
|
||||
{"deduplicate-by-id", no_argument, 0, 'i' & 0x1F},
|
||||
|
||||
{0, 0, 0, 0},
|
||||
};
|
||||
@@ -118,6 +146,10 @@ int main(int argc, char **argv) {
|
||||
filter = optarg;
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
filter = read_json_file(optarg);
|
||||
break;
|
||||
|
||||
case 'o' & 0x1F:
|
||||
preserve_input_order = true;
|
||||
break;
|
||||
@@ -158,6 +190,36 @@ int main(int argc, char **argv) {
|
||||
do_compress = false;
|
||||
break;
|
||||
|
||||
case 'k' & 0x1F: {
|
||||
clipbbox clip;
|
||||
if (sscanf(optarg, "%lf,%lf,%lf,%lf", &clip.lon1, &clip.lat1, &clip.lon2, &clip.lat2) == 4) {
|
||||
projection->project(clip.lon1, clip.lat1, 32, &clip.minx, &clip.maxy);
|
||||
projection->project(clip.lon2, clip.lat2, 32, &clip.maxx, &clip.miny);
|
||||
clipbboxes.push_back(clip);
|
||||
} else {
|
||||
fprintf(stderr, "%s: Can't parse bounding box --clip-bounding-box=%s\n", argv[0], optarg);
|
||||
exit(EXIT_ARGS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'l' & 0x1F: {
|
||||
clipbbox clip = parse_clip_poly(optarg);
|
||||
clipbboxes.push_back(clip);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'm' & 0x1F: {
|
||||
clipbbox clip = parse_clip_poly(read_json_file(optarg));
|
||||
clipbboxes.push_back(clip);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'i' & 0x1F: {
|
||||
deduplicate_by_id = true;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unrecognized flag -%c\n", i);
|
||||
usage(argv);
|
||||
@@ -236,34 +298,72 @@ int main(int argc, char **argv) {
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
json_object *json_filter = NULL;
|
||||
if (filter.size() > 0) {
|
||||
json_filter = parse_filter(filter.c_str());
|
||||
// clip the clip polygons, if any, to the tile bounds,
|
||||
// to reduce their complexity
|
||||
|
||||
bool clipped_to_nothing = false;
|
||||
if (clipbboxes.size() > 0) {
|
||||
long long wx1 = (nx - buffer / 256.0) * (1LL << (32 - nz));
|
||||
long long wy1 = (ny - buffer / 256.0) * (1LL << (32 - nz));
|
||||
long long wx2 = (nx + 1 + buffer / 256.0) * (1LL << (32 - nz));
|
||||
long long wy2 = (ny + 1 + buffer / 256.0) * (1LL << (32 - nz));
|
||||
|
||||
drawvec tile_bounds;
|
||||
tile_bounds.emplace_back(VT_MOVETO, wx1, wy1);
|
||||
tile_bounds.emplace_back(VT_LINETO, wx2, wy1);
|
||||
tile_bounds.emplace_back(VT_LINETO, wx2, wy2);
|
||||
tile_bounds.emplace_back(VT_LINETO, wx1, wy2);
|
||||
tile_bounds.emplace_back(VT_LINETO, wx1, wy1);
|
||||
|
||||
for (auto &c : clipbboxes) {
|
||||
c.minx = std::max(c.minx, wx1);
|
||||
c.miny = std::max(c.miny, wy1);
|
||||
c.maxx = std::min(c.maxx, wx2);
|
||||
c.maxy = std::min(c.maxy, wy2);
|
||||
|
||||
if (c.dv.size() > 0) {
|
||||
c.dv = clip_poly_poly(c.dv, tile_bounds);
|
||||
|
||||
if (c.dv.size() == 0) {
|
||||
clipped_to_nothing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto const &s : sources) {
|
||||
std::string tile;
|
||||
char buf[1000];
|
||||
int len;
|
||||
std::string out;
|
||||
|
||||
FILE *f = fopen(s.tile.c_str(), "rb");
|
||||
if (f == NULL) {
|
||||
perror(s.tile.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
if (!clipped_to_nothing) {
|
||||
json_object *json_filter = NULL;
|
||||
if (filter.size() > 0) {
|
||||
json_filter = parse_filter(filter.c_str());
|
||||
}
|
||||
|
||||
while ((len = fread(buf, sizeof(char), 1000, f)) > 0) {
|
||||
tile.append(std::string(buf, len));
|
||||
}
|
||||
fclose(f);
|
||||
for (auto const &s : sources) {
|
||||
std::string tile;
|
||||
char buf[1000];
|
||||
int len;
|
||||
|
||||
input_tile t = s;
|
||||
t.tile = std::move(tile);
|
||||
its.push_back(std::move(t));
|
||||
FILE *f = fopen(s.tile.c_str(), "rb");
|
||||
if (f == NULL) {
|
||||
perror(s.tile.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while ((len = fread(buf, sizeof(char), 1000, f)) > 0) {
|
||||
tile.append(std::string(buf, len));
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
input_tile t = s;
|
||||
t.tile = std::move(tile);
|
||||
its.push_back(std::move(t));
|
||||
}
|
||||
|
||||
out = overzoom(its, nz, nx, ny, detail, buffer, keep, exclude, exclude_prefix, do_compress, NULL, demultiply, json_filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, bins, bin_by_id_list, accumulate_numeric, SIZE_MAX, clipbboxes, deduplicate_by_id);
|
||||
}
|
||||
|
||||
std::string 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, bins, bin_by_id_list, accumulate_numeric, SIZE_MAX);
|
||||
|
||||
FILE *f = fopen(outfile, "wb");
|
||||
if (f == NULL) {
|
||||
perror(outfile);
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "platform.hpp"
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#include "errors.hpp"
|
||||
|
||||
long get_num_avail_cpus() {
|
||||
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||
}
|
||||
|
||||
long get_page_size() {
|
||||
return sysconf(_SC_PAGESIZE);
|
||||
}
|
||||
|
||||
size_t calc_memsize() {
|
||||
size_t mem;
|
||||
|
||||
#ifdef __APPLE__
|
||||
int64_t hw_memsize;
|
||||
size_t len = sizeof(int64_t);
|
||||
if (sysctlbyname("hw.memsize", &hw_memsize, &len, NULL, 0) < 0) {
|
||||
perror("sysctl hw.memsize");
|
||||
exit(EXIT_MEMORY);
|
||||
}
|
||||
mem = hw_memsize;
|
||||
#else
|
||||
long long pagesize = sysconf(_SC_PAGESIZE);
|
||||
long long pages = sysconf(_SC_PHYS_PAGES);
|
||||
if (pages < 0 || pagesize < 0) {
|
||||
perror("sysconf _SC_PAGESIZE or _SC_PHYS_PAGES");
|
||||
exit(EXIT_MEMORY);
|
||||
}
|
||||
|
||||
mem = (long long) pages * pagesize;
|
||||
#endif
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
size_t get_max_open_files() {
|
||||
struct rlimit rl;
|
||||
if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||
perror("getrlimit");
|
||||
exit(EXIT_PTHREAD);
|
||||
}
|
||||
return rl.rlim_cur;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef PLATFORM_HPP
|
||||
#define PLATFORM_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
long get_num_avail_cpus();
|
||||
|
||||
long get_page_size();
|
||||
|
||||
size_t calc_memsize();
|
||||
|
||||
size_t get_max_open_files();
|
||||
|
||||
constexpr const char *get_null_device() {
|
||||
return "/dev/null";
|
||||
}
|
||||
|
||||
#endif // PLATFORM_HPP
|
||||
+1
-1
@@ -223,7 +223,7 @@ serial_feature parse_feature(json_pull *jp, int z, unsigned x, unsigned y, std::
|
||||
}
|
||||
|
||||
drawvec dv;
|
||||
parse_geometry(t, coordinates, dv, VT_MOVETO, "Filter output", jp->line, j);
|
||||
parse_coordinates(t, coordinates, dv, VT_MOVETO, "Filter output", jp->line, j);
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = fix_polygon(dv, false, false);
|
||||
}
|
||||
|
||||
+134
-121
@@ -53,7 +53,7 @@ void json_context(json_object *j) {
|
||||
free(s); // stringify
|
||||
}
|
||||
|
||||
void parse_geometry(int t, json_object *j, drawvec &out, int op, const char *fname, int line, json_object *feature) {
|
||||
void parse_coordinates(int t, json_object *j, drawvec &out, int op, const char *fname, int line, json_object *feature) {
|
||||
if (j == NULL || j->type != JSON_ARRAY) {
|
||||
fprintf(stderr, "%s:%d: expected array for geometry type %d: ", fname, line, t);
|
||||
json_context(feature);
|
||||
@@ -72,7 +72,7 @@ void parse_geometry(int t, json_object *j, drawvec &out, int op, const char *fna
|
||||
}
|
||||
}
|
||||
|
||||
parse_geometry(within, j->value.array.array[i], out, op, fname, line, feature);
|
||||
parse_coordinates(within, j->value.array.array[i], out, op, fname, line, feature);
|
||||
}
|
||||
} else {
|
||||
if (j->value.array.length >= 2 && j->value.array.array[0]->type == JSON_NUMBER && j->value.array.array[1]->type == JSON_NUMBER) {
|
||||
@@ -178,6 +178,129 @@ static std::vector<mvt_geometry> to_feature(drawvec &geom) {
|
||||
return out;
|
||||
}
|
||||
|
||||
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 == NULL) {
|
||||
fprintf(stderr, "Filter output:%d: null geometry (additional not reported): ", jp->line);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
if (geometry_type->type != JSON_STRING) {
|
||||
fprintf(stderr, "Filter output:%d: geometry type is not a string: ", jp->line);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
json_object *coordinates = json_hash_get(geometry, "coordinates");
|
||||
if (coordinates == NULL || coordinates->type != JSON_ARRAY) {
|
||||
fprintf(stderr, "Filter output:%d: geometry without coordinates array: ", jp->line);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
int t;
|
||||
for (t = 0; t < GEOM_TYPES; 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->value.string.string);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
drawvec dv;
|
||||
parse_coordinates(t, coordinates, dv, VT_MOVETO, "Filter output", jp->line, j);
|
||||
|
||||
// handle longitude wraparound
|
||||
//
|
||||
// this is supposed to be data for a single tile,
|
||||
// so any jump from the left hand side edge of the world
|
||||
// to the right edge, or vice versa, is unexpected,
|
||||
// so move it to the other side.
|
||||
|
||||
if (fix_longitudes && mb_geometry[t] == VT_POLYGON) {
|
||||
const long long quarter_world = 1LL << 30;
|
||||
const long long world = 1LL << 32;
|
||||
|
||||
bool copy_to_left = false;
|
||||
bool copy_to_right = false;
|
||||
|
||||
for (size_t i = 0; i < dv.size(); i++) {
|
||||
// is this vertex on a different side of the world
|
||||
// than the first vertex? then shift this one to match
|
||||
if (i > 0) {
|
||||
if ((dv[0].x < quarter_world) && (dv[i].x > 3 * quarter_world)) {
|
||||
dv[i].x -= world;
|
||||
}
|
||||
if ((dv[0].x > 3 * quarter_world) && (dv[i].x < quarter_world)) {
|
||||
dv[i].x += world;
|
||||
}
|
||||
}
|
||||
|
||||
// does it stick off the edge of the world?
|
||||
// then we need another copy on the other side of the world
|
||||
if (dv[i].x < 0) {
|
||||
copy_to_right = true;
|
||||
}
|
||||
if (dv[i].x > world) {
|
||||
copy_to_left = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (copy_to_left) {
|
||||
size_t n = dv.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
dv.emplace_back(dv[i].op, dv[i].x - world, (long long) dv[i].y);
|
||||
}
|
||||
}
|
||||
if (copy_to_right) {
|
||||
size_t n = dv.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
dv.emplace_back(dv[i].op, dv[i].x + world, (long long) dv[i].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = fix_polygon(dv, false, false);
|
||||
}
|
||||
|
||||
// Offset and scale geometry from global to tile
|
||||
for (size_t i = 0; i < dv.size(); i++) {
|
||||
long long scale = 1LL << (32 - z);
|
||||
|
||||
// offset to tile
|
||||
dv[i].x -= scale * x;
|
||||
dv[i].y -= scale * y;
|
||||
|
||||
// scale to tile
|
||||
dv[i].x = std::round(dv[i].x * (extent / (double) scale));
|
||||
dv[i].y = std::round(dv[i].y * (extent / (double) scale));
|
||||
}
|
||||
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
// don't try scaling up because we may have coordinates
|
||||
// on the other side of the world
|
||||
dv = clean_or_clip_poly(dv, z, 256, true, false);
|
||||
if (dv.size() < 3) {
|
||||
dv.clear();
|
||||
}
|
||||
}
|
||||
dv = remove_noop(dv, mb_geometry[t], 0);
|
||||
|
||||
if (mvt_style) {
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = close_poly(dv);
|
||||
}
|
||||
}
|
||||
|
||||
return std::pair<int, drawvec>(t, dv);
|
||||
}
|
||||
|
||||
std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int extent, bool fix_longitudes) {
|
||||
std::map<std::string, mvt_layer> ret;
|
||||
std::shared_ptr<std::string> tile_stringpool = std::make_shared<std::string>();
|
||||
@@ -208,14 +331,6 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
|
||||
continue;
|
||||
}
|
||||
|
||||
json_object *geometry = json_hash_get(j, "geometry");
|
||||
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 == NULL || (properties->type != JSON_HASH && properties->type != JSON_NULL)) {
|
||||
fprintf(stderr, "Filter output:%d: feature without properties hash: ", jp->line);
|
||||
@@ -224,38 +339,6 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
json_object *geometry_type = json_hash_get(geometry, "type");
|
||||
if (geometry_type == NULL) {
|
||||
fprintf(stderr, "Filter output:%d: null geometry (additional not reported): ", jp->line);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
if (geometry_type->type != JSON_STRING) {
|
||||
fprintf(stderr, "Filter output:%d: geometry type is not a string: ", jp->line);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
json_object *coordinates = json_hash_get(geometry, "coordinates");
|
||||
if (coordinates == NULL || coordinates->type != JSON_ARRAY) {
|
||||
fprintf(stderr, "Filter output:%d: feature without coordinates array: ", jp->line);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
int t;
|
||||
for (t = 0; t < GEOM_TYPES; 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->value.string.string);
|
||||
json_context(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
std::string layername = "unknown";
|
||||
json_object *tippecanoe = json_hash_get(j, "tippecanoe");
|
||||
json_object *layer = NULL;
|
||||
@@ -276,88 +359,18 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
|
||||
}
|
||||
auto l = ret.find(layername);
|
||||
|
||||
drawvec dv;
|
||||
parse_geometry(t, coordinates, dv, VT_MOVETO, "Filter output", jp->line, j);
|
||||
|
||||
// handle longitude wraparound
|
||||
//
|
||||
// this is supposed to be data for a single tile,
|
||||
// so any jump from the left hand side edge of the world
|
||||
// to the right edge, or vice versa, is unexpected,
|
||||
// so move it to the other side.
|
||||
|
||||
if (fix_longitudes && mb_geometry[t] == VT_POLYGON) {
|
||||
const long long quarter_world = 1LL << 30;
|
||||
const long long world = 1LL << 32;
|
||||
|
||||
bool copy_to_left = false;
|
||||
bool copy_to_right = false;
|
||||
|
||||
for (size_t i = 0; i < dv.size(); i++) {
|
||||
// is this vertex on a different side of the world
|
||||
// than the first vertex? then shift this one to match
|
||||
if (i > 0) {
|
||||
if ((dv[0].x < quarter_world) && (dv[i].x > 3 * quarter_world)) {
|
||||
dv[i].x -= world;
|
||||
}
|
||||
if ((dv[0].x > 3 * quarter_world) && (dv[i].x < quarter_world)) {
|
||||
dv[i].x += world;
|
||||
}
|
||||
}
|
||||
|
||||
// does it stick off the edge of the world?
|
||||
// then we need another copy on the other side of the world
|
||||
if (dv[i].x < 0) {
|
||||
copy_to_right = true;
|
||||
}
|
||||
if (dv[i].x > world) {
|
||||
copy_to_left = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (copy_to_left) {
|
||||
size_t n = dv.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
dv.emplace_back(dv[i].op, dv[i].x - world, (long long) dv[i].y);
|
||||
}
|
||||
}
|
||||
if (copy_to_right) {
|
||||
size_t n = dv.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
dv.emplace_back(dv[i].op, dv[i].x + world, (long long) dv[i].y);
|
||||
}
|
||||
}
|
||||
json_object *geometry = json_hash_get(j, "geometry");
|
||||
if (geometry == NULL) {
|
||||
fprintf(stderr, "Filter output:%d: filtered feature with no geometry: ", jp->line);
|
||||
json_context(j);
|
||||
json_free(j);
|
||||
exit(EXIT_JSON);
|
||||
}
|
||||
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = fix_polygon(dv, false, false);
|
||||
}
|
||||
std::pair<int, drawvec> parsed_geometry = parse_geometry(geometry, jp, j, z, x, y, extent, fix_longitudes, true);
|
||||
|
||||
// Offset and scale geometry from global to tile
|
||||
for (size_t i = 0; i < dv.size(); i++) {
|
||||
long long scale = 1LL << (32 - z);
|
||||
|
||||
// offset to tile
|
||||
dv[i].x -= scale * x;
|
||||
dv[i].y -= scale * y;
|
||||
|
||||
// scale to tile
|
||||
dv[i].x = std::round(dv[i].x * extent / (double) scale);
|
||||
dv[i].y = std::round(dv[i].y * extent / (double) scale);
|
||||
}
|
||||
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
// don't try scaling up because we may have coordinates
|
||||
// on the other side of the world
|
||||
dv = clean_or_clip_poly(dv, z, 256, true, false);
|
||||
if (dv.size() < 3) {
|
||||
dv.clear();
|
||||
}
|
||||
}
|
||||
dv = remove_noop(dv, mb_geometry[t], 0);
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = close_poly(dv);
|
||||
}
|
||||
int t = parsed_geometry.first;
|
||||
drawvec &dv = parsed_geometry.second;
|
||||
|
||||
if (dv.size() > 0) {
|
||||
mvt_feature feature;
|
||||
|
||||
+3
-1
@@ -11,7 +11,9 @@ extern int geometry_within[GEOM_TYPES];
|
||||
extern int mb_geometry[GEOM_TYPES];
|
||||
|
||||
void json_context(json_object *j);
|
||||
void parse_geometry(int t, json_object *j, drawvec &out, int op, const char *fname, int line, json_object *feature);
|
||||
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 *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);
|
||||
|
||||
serial_val stringify_value(json_object *value, const char *reading, int line, json_object *feature);
|
||||
|
||||
+14
-2
@@ -70,6 +70,20 @@ struct serial_val {
|
||||
type = mvt_string;
|
||||
s = val;
|
||||
}
|
||||
|
||||
size_t get_count() const {
|
||||
size_t found = s.find('\0');
|
||||
if (found == std::string::npos) {
|
||||
return 0;
|
||||
} else {
|
||||
return atoll(s.c_str() + found + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void set_double_count(double v, size_t c) {
|
||||
type = mvt_double;
|
||||
s = milo::dtoa_milo(v) + '\0' + std::to_string(c);
|
||||
}
|
||||
};
|
||||
|
||||
struct key_pool {
|
||||
@@ -151,8 +165,6 @@ struct serial_feature {
|
||||
long long clustered; // does this feature need the clustered/point_count attributes?
|
||||
const char *stringpool; // string pool for keys/values lookup
|
||||
std::shared_ptr<std::string> tile_stringpool; // string pool for mvt_value construction
|
||||
std::set<std::string> need_tilestats;
|
||||
std::unordered_map<std::string, accum_state> attribute_accum_state;
|
||||
|
||||
int z; // tile being produced
|
||||
int tx;
|
||||
|
||||
+47
-47
@@ -83,13 +83,13 @@ bool edges_same(std::pair<std::vector<edge>::iterator, std::vector<edge>::iterat
|
||||
return true;
|
||||
}
|
||||
|
||||
bool find_common_edges(std::vector<serial_feature> &features, int z, int line_detail, double simplification, int maxzoom, double merge_fraction) {
|
||||
bool find_common_edges(std::vector<std::shared_ptr<serial_feature>> &features, int z, int line_detail, double simplification, int maxzoom, double merge_fraction) {
|
||||
size_t merge_count = ceil((1 - merge_fraction) * features.size());
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
if (features[i].t == VT_POLYGON) {
|
||||
if (features[i]->t == VT_POLYGON) {
|
||||
{
|
||||
drawvec &g = features[i].geometry;
|
||||
drawvec &g = features[i]->geometry;
|
||||
drawvec out;
|
||||
|
||||
for (size_t k = 0; k < g.size(); k++) {
|
||||
@@ -100,7 +100,7 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
}
|
||||
}
|
||||
|
||||
features[i].geometry = out;
|
||||
features[i]->geometry = out;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,21 +112,21 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
std::vector<edge> edges;
|
||||
size_t ring = 0;
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
if (features[i].t == VT_POLYGON) {
|
||||
if (features[i]->t == VT_POLYGON) {
|
||||
{
|
||||
for (size_t k = 0; k + 1 < features[i].geometry.size(); k++) {
|
||||
if (features[i].geometry[k].op == VT_MOVETO) {
|
||||
for (size_t k = 0; k + 1 < features[i]->geometry.size(); k++) {
|
||||
if (features[i]->geometry[k].op == VT_MOVETO) {
|
||||
ring++;
|
||||
}
|
||||
|
||||
if (features[i].geometry[k + 1].op == VT_LINETO) {
|
||||
if (features[i]->geometry[k + 1].op == VT_LINETO) {
|
||||
drawvec dv;
|
||||
if (features[i].geometry[k] < features[i].geometry[k + 1]) {
|
||||
dv.push_back(features[i].geometry[k]);
|
||||
dv.push_back(features[i].geometry[k + 1]);
|
||||
if (features[i]->geometry[k] < features[i]->geometry[k + 1]) {
|
||||
dv.push_back(features[i]->geometry[k]);
|
||||
dv.push_back(features[i]->geometry[k + 1]);
|
||||
} else {
|
||||
dv.push_back(features[i].geometry[k + 1]);
|
||||
dv.push_back(features[i].geometry[k]);
|
||||
dv.push_back(features[i]->geometry[k + 1]);
|
||||
dv.push_back(features[i]->geometry[k]);
|
||||
}
|
||||
|
||||
edges.push_back(edge(dv[0].x, dv[0].y, dv[1].x, dv[1].y, ring));
|
||||
@@ -143,9 +143,9 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
// is not the same as the set of rings using the edge on the other side.
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
if (features[i].t == VT_POLYGON) {
|
||||
if (features[i]->t == VT_POLYGON) {
|
||||
{
|
||||
drawvec &g = features[i].geometry;
|
||||
drawvec &g = features[i]->geometry;
|
||||
|
||||
for (size_t k = 0; k < g.size(); k++) {
|
||||
g[k].necessary = 0;
|
||||
@@ -223,9 +223,9 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
// Roll rings that include a necessary point around so they start at one
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
if (features[i].t == VT_POLYGON) {
|
||||
if (features[i]->t == VT_POLYGON) {
|
||||
{
|
||||
drawvec &g = features[i].geometry;
|
||||
drawvec &g = features[i]->geometry;
|
||||
|
||||
for (size_t k = 0; k < g.size(); k++) {
|
||||
if (necessaries.count(g[k]) != 0) {
|
||||
@@ -315,21 +315,21 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
// Add new arc
|
||||
size_t added = arcs.size() + 1;
|
||||
arcs.insert(std::pair<drawvec, size_t>(arc, added));
|
||||
features[i].arc_polygon.push_back(added);
|
||||
features[i]->arc_polygon.push_back(added);
|
||||
merge_candidates.insert(std::pair<ssize_t, size_t>(added, i));
|
||||
} else {
|
||||
features[i].arc_polygon.push_back(-(ssize_t) f2->second);
|
||||
features[i]->arc_polygon.push_back(-(ssize_t) f2->second);
|
||||
merge_candidates.insert(std::pair<ssize_t, size_t>(-(ssize_t) f2->second, i));
|
||||
}
|
||||
} else {
|
||||
features[i].arc_polygon.push_back(f->second);
|
||||
features[i]->arc_polygon.push_back(f->second);
|
||||
merge_candidates.insert(std::pair<ssize_t, size_t>(f->second, i));
|
||||
}
|
||||
|
||||
m = n - 1;
|
||||
}
|
||||
|
||||
features[i].arc_polygon.push_back(0);
|
||||
features[i]->arc_polygon.push_back(0);
|
||||
|
||||
k = l - 1;
|
||||
}
|
||||
@@ -385,10 +385,10 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
if (r1i->second != r2i->second) {
|
||||
merge_order mo;
|
||||
mo.edge = i;
|
||||
if (features[r1i->second].index > features[r2i->second].index) {
|
||||
mo.gap = features[r1i->second].index - features[r2i->second].index;
|
||||
if (features[r1i->second]->index > features[r2i->second]->index) {
|
||||
mo.gap = features[r1i->second]->index - features[r2i->second]->index;
|
||||
} else {
|
||||
mo.gap = features[r2i->second].index - features[r1i->second].index;
|
||||
mo.gap = features[r2i->second]->index - features[r1i->second]->index;
|
||||
}
|
||||
mo.p1 = r1i->second;
|
||||
mo.p2 = r2i->second;
|
||||
@@ -406,19 +406,19 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
}
|
||||
|
||||
size_t i = order[o].p1;
|
||||
while (features[i].renamed >= 0) {
|
||||
i = features[i].renamed;
|
||||
while (features[i]->renamed >= 0) {
|
||||
i = features[i]->renamed;
|
||||
}
|
||||
size_t i2 = order[o].p2;
|
||||
while (features[i2].renamed >= 0) {
|
||||
i2 = features[i2].renamed;
|
||||
while (features[i2]->renamed >= 0) {
|
||||
i2 = features[i2]->renamed;
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < features[i].arc_polygon.size() && merged < merge_count; j++) {
|
||||
if (features[i].arc_polygon[j] == order[o].edge) {
|
||||
for (size_t j = 0; j < features[i]->arc_polygon.size() && merged < merge_count; j++) {
|
||||
if (features[i]->arc_polygon[j] == order[o].edge) {
|
||||
{
|
||||
// XXX snap links
|
||||
if (features[order[o].p2].arc_polygon.size() > 0) {
|
||||
if (features[order[o].p2]->arc_polygon.size() > 0) {
|
||||
// This has to merge the ring that contains the anti-arc to this arc
|
||||
// into the current ring, and then add whatever other rings were in
|
||||
// that feature on to the end.
|
||||
@@ -427,11 +427,11 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
// the rings in order, but Wagyu should sort that out later
|
||||
|
||||
std::vector<ssize_t> additions;
|
||||
std::vector<ssize_t> &here = features[i].arc_polygon;
|
||||
std::vector<ssize_t> &other = features[i2].arc_polygon;
|
||||
std::vector<ssize_t> &here = features[i]->arc_polygon;
|
||||
std::vector<ssize_t> &other = features[i2]->arc_polygon;
|
||||
|
||||
#if 0
|
||||
printf("seeking %zd\n", features[i].arc_polygon[j]);
|
||||
printf("seeking %zd\n", features[i]->arc_polygon[j]);
|
||||
printf("before: ");
|
||||
for (size_t k = 0; k < here.size(); k++) {
|
||||
printf("%zd ", here[k]);
|
||||
@@ -464,7 +464,7 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
|
||||
size_t m;
|
||||
for (m = k; m <= l; m++) {
|
||||
if (other[m] == -features[i].arc_polygon[j]) {
|
||||
if (other[m] == -features[i]->arc_polygon[j]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -494,12 +494,12 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
k = l;
|
||||
}
|
||||
|
||||
features[i2].arc_polygon.clear();
|
||||
features[i2].renamed = i;
|
||||
features[i2]->arc_polygon.clear();
|
||||
features[i2]->renamed = i;
|
||||
merged++;
|
||||
|
||||
for (size_t k = 0; k < additions.size(); k++) {
|
||||
features[i].arc_polygon.push_back(additions[k]);
|
||||
features[i]->arc_polygon.push_back(additions[k]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -528,37 +528,37 @@ bool find_common_edges(std::vector<serial_feature> &features, int z, int line_de
|
||||
// Turn the arc representations of the polygons back into standard polygon geometries
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
if (features[i].t == VT_POLYGON) {
|
||||
features[i].geometry.clear();
|
||||
if (features[i]->t == VT_POLYGON) {
|
||||
features[i]->geometry.clear();
|
||||
bool at_start = true;
|
||||
draw first(-1, 0, 0);
|
||||
|
||||
for (size_t j = 0; j < features[i].arc_polygon.size(); j++) {
|
||||
ssize_t p = features[i].arc_polygon[j];
|
||||
for (size_t j = 0; j < features[i]->arc_polygon.size(); j++) {
|
||||
ssize_t p = features[i]->arc_polygon[j];
|
||||
|
||||
if (p == 0) {
|
||||
if (first.op >= 0) {
|
||||
features[i].geometry.push_back(first);
|
||||
features[i]->geometry.push_back(first);
|
||||
first = draw(-1, 0, 0);
|
||||
}
|
||||
at_start = true;
|
||||
} else if (p > 0) {
|
||||
for (size_t k = 0; k + 1 < simplified_arcs[p].size(); k++) {
|
||||
if (at_start) {
|
||||
features[i].geometry.push_back(draw(VT_MOVETO, simplified_arcs[p][k].x, simplified_arcs[p][k].y));
|
||||
features[i]->geometry.push_back(draw(VT_MOVETO, simplified_arcs[p][k].x, simplified_arcs[p][k].y));
|
||||
first = draw(VT_LINETO, simplified_arcs[p][k].x, simplified_arcs[p][k].y);
|
||||
} else {
|
||||
features[i].geometry.push_back(draw(VT_LINETO, simplified_arcs[p][k].x, simplified_arcs[p][k].y));
|
||||
features[i]->geometry.push_back(draw(VT_LINETO, simplified_arcs[p][k].x, simplified_arcs[p][k].y));
|
||||
}
|
||||
at_start = 0;
|
||||
}
|
||||
} else { /* p < 0 */
|
||||
for (ssize_t k = simplified_arcs[-p].size() - 1; k > 0; k--) {
|
||||
if (at_start) {
|
||||
features[i].geometry.push_back(draw(VT_MOVETO, simplified_arcs[-p][k].x, simplified_arcs[-p][k].y));
|
||||
features[i]->geometry.push_back(draw(VT_MOVETO, simplified_arcs[-p][k].x, simplified_arcs[-p][k].y));
|
||||
first = draw(VT_LINETO, simplified_arcs[-p][k].x, simplified_arcs[-p][k].y);
|
||||
} else {
|
||||
features[i].geometry.push_back(draw(VT_LINETO, simplified_arcs[-p][k].x, simplified_arcs[-p][k].y));
|
||||
features[i]->geometry.push_back(draw(VT_LINETO, simplified_arcs[-p][k].x, simplified_arcs[-p][k].y));
|
||||
}
|
||||
at_start = 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
bool find_common_edges(std::vector<serial_feature> &features, int z, int line_detail, double simplification, int maxzoom, double merge_fraction);
|
||||
bool find_common_edges(std::vector<std::shared_ptr<serial_feature>> &features, int z, int line_detail, double simplification, int maxzoom, double merge_fraction);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"antimeridian_adjusted_bounds": "-100.019531,0.000000,0.966797,0.966751",
|
||||
"bounds": "-100.019531,0.000000,0.966797,0.966751",
|
||||
"center": "0.000000,0.000000,0",
|
||||
"description": "tests/feature-filter/out/all.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-175.781250,-42.032974,180.000000,64.168107",
|
||||
"bounds": "-175.781250,-42.032974,180.000000,64.168107",
|
||||
"antimeridian_adjusted_bounds": "-175.220947,-41.302571,179.217224,64.168107",
|
||||
"bounds": "-175.220947,-41.302571,179.217224,64.168107",
|
||||
"center": "-62.578125,17.307462,8",
|
||||
"description": "tests/feature-filter/out/places.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"antimeridian_adjusted_bounds": "-122.255859,37.718590,-122.080078,37.857507",
|
||||
"bounds": "-122.255859,37.718590,-122.080078,37.857507",
|
||||
"center": "-122.104097,37.695438,0",
|
||||
"description": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.309418,37.881357,-122.280579,37.900865",
|
||||
"bounds": "-122.309418,37.881357,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"bounds": "-122.343750,37.857507,-122.255859,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "237.656250,37.857507,237.744141,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.294655,37.694688,-122.103424,37.833649",
|
||||
"attribution": "macarthur's attribution",
|
||||
"bounds": "-122.343750,37.695438,-122.104097,37.926868",
|
||||
"bounds": "-122.294655,37.694688,-122.103424,37.833649",
|
||||
"center": "-122.299805,37.892187,11",
|
||||
"description": "macarthur description",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.103424,37.833107",
|
||||
"bounds": "-122.294655,37.695231,-122.103424,37.833107",
|
||||
"center": "-122.167969,37.833010,9",
|
||||
"description": "tests/join-population/macarthur.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"antimeridian_adjusted_bounds": "-122.294655,37.695231,-122.103424,37.833107",
|
||||
"bounds": "-122.294655,37.695231,-122.103424,37.833107",
|
||||
"center": "-122.167969,37.833010,9",
|
||||
"description": "tests/join-population/macarthur.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "237.656250,37.857507,237.744141,37.926868",
|
||||
"bounds": "-122.343750,37.695438,-122.104097,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.694688,-122.103424,37.900865",
|
||||
"bounds": "-122.343750,37.694688,-122.103424,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420-folder",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "237.656250,37.857507,237.744141,37.926868",
|
||||
"bounds": "-122.343750,37.695438,-122.104097,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.694688,-122.103424,37.900865",
|
||||
"bounds": "-122.343750,37.694688,-122.103424,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "237.656250,37.857507,237.744141,37.926868",
|
||||
"bounds": "-122.343750,37.695438,-122.104097,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"bounds": "-122.343750,37.874853,-122.280579,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "237.656250,37.857507,237.744141,37.926868",
|
||||
"bounds": "-122.343750,37.695438,-122.104097,37.926868",
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.694688,-122.103424,37.900865",
|
||||
"bounds": "-122.343750,37.694688,-122.103424,37.900865",
|
||||
"center": "-122.299805,37.892187,12",
|
||||
"description": "tests/join-population/tabblock_06001420.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"antimeridian_adjusted_bounds": "-122.294655,37.694688,-122.103424,37.833649",
|
||||
"bounds": "-122.294655,37.694688,-122.103424,37.833649",
|
||||
"center": "-122.167969,37.828608,10",
|
||||
"description": "tests/join-population/macarthur2.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"bounds": "-122.343750,37.439974,-121.992188,37.996163",
|
||||
"antimeridian_adjusted_bounds": "-122.294655,37.694688,-122.103424,37.833649",
|
||||
"bounds": "-122.294655,37.694688,-122.103424,37.833649",
|
||||
"center": "-122.167969,37.833010,10",
|
||||
"description": "tests/join-population/macarthur.mbtiles",
|
||||
"format": "pbf",
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-63.146840,-21.370782,55.854503,55.065334",
|
||||
"bounds": "-63.146840,-21.370782,55.854503,55.065334",
|
||||
"center": "0.000000,0.000000,0",
|
||||
"description": "/tmp/tmp588djzw6/bboxes.pmtiles",
|
||||
"format": "pbf",
|
||||
"generator_options": "tippecanoe '--tile-stats-values-limit=1' -o /tmp/tmp588djzw6/bboxes.pmtiles -l parsed-bboxes -U1 '--smallest-maximum-zoom-guess=7' -Bg --drop-fraction-as-needed -P --hilbert --generate-variable-depth-tile-pyramid -rp -b0 '--extend-zooms-if-still-dropping-maximum=3' '--extra-detail=30' -D10 '--tiny-polygon-size=1' --no-tiny-polygon-reduction-at-maximum-zoom '--simplification=1' '--simplification-at-maximum-zoom=0.25' --detect-longitude-wraparound --preserve-input-order '--maximum-tile-bytes=2621440' '--maximum-string-attribute-length=65536' --preserve-point-density-threshold 64 --set-attribute '{\"felt:cluster_size\": 1}' --accumulate-attribute '{\"felt:cluster_size\": \"sum\"}' --preserve-multiplier-density-threshold 512 '--accumulate-numeric-attributes=felt' /tmp/tmpg9jf8evz/parsed.geojsonseq.gz; ./tile-join --join-count-limit 3 -i -f -o tests/join-sql/countries-limit3.pmtiles --join-sqlite tests/join-sql/countries.gpkg --join-table countries --join-tile-attribute ne10-admin0:name_en --join-table-expression 'lower(country)' tests/join-sql/bboxes.pmtiles",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"parsed-bboxes\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"another\":\"String\",\"country\":\"String\",\"felt:cluster_size\":\"Number\",\"fid\":\"Number\",\"ne10-admin0:iso_a2_eh\":\"String\",\"ne10-admin0:iso_a3_eh\":\"String\",\"ne10-admin0:name_en\":\"String\",\"something\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"parsed-bboxes\",\"count\":7,\"geometry\":\"Polygon\",\"attributeCount\":8,\"attributes\":[{\"attribute\":\"another\",\"count\":6,\"type\":\"string\",\"values\":[\"bar\",\"deux\",\"hey\",\"two\",\"why\",\"yes\"]},{\"attribute\":\"country\",\"count\":4,\"type\":\"string\",\"values\":[\"France\",\"Germany\",\"Italy\",\"saint-martin\"]},{\"attribute\":\"felt:cluster_size\",\"count\":1,\"type\":\"number\",\"values\":[1],\"min\":1,\"max\":1},{\"attribute\":\"fid\",\"count\":6,\"type\":\"number\",\"values\":[1,2,3,4,5,7],\"min\":1,\"max\":7},{\"attribute\":\"ne10-admin0:iso_a2_eh\",\"count\":5,\"type\":\"string\",\"values\":[\"de\",\"fr\",\"it\",\"mf\",\"sx\"]},{\"attribute\":\"ne10-admin0:iso_a3_eh\",\"count\":5,\"type\":\"string\",\"values\":[\"deu\",\"fra\",\"ita\",\"maf\",\"sxm\"]},{\"attribute\":\"ne10-admin0:name_en\",\"count\":4,\"type\":\"string\",\"values\":[\"france\",\"germany\",\"italy\",\"saint-martin\"]},{\"attribute\":\"something\",\"count\":6,\"type\":\"string\",\"values\":[\"blah\",\"foo\",\"hey\",\"one\",\"un\",\"what\"]}]}]}}",
|
||||
"maxzoom": "0",
|
||||
"minzoom": "0",
|
||||
"name": "/tmp/tmp588djzw6/bboxes.pmtiles",
|
||||
"strategies": "[{\"truncated_zooms\":1}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "parsed-bboxes", "version": 2, "extent": 1073741824 }, "features": [
|
||||
{ "type": "Feature", "id": 322, "properties": { "ne10-admin0:name_en": "germany", "ne10-admin0:iso_a2_eh": "de", "ne10-admin0:iso_a3_eh": "deu", "felt:cluster_size": 1, "another": "yes", "country": "Germany", "fid": 1, "something": "blah" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 15.022060, 47.271121 ], [ 5.852490, 47.271121 ], [ 5.852490, 55.065334 ], [ 15.022060, 55.065334 ], [ 15.022060, 47.271121 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 435, "properties": { "ne10-admin0:name_en": "france", "ne10-admin0:iso_a2_eh": "fr", "ne10-admin0:iso_a3_eh": "fra", "felt:cluster_size": 1, "another": "why", "country": "France", "fid": 2, "something": "what" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -61.797841, -21.370782 ], [ -61.797841, 51.087541 ], [ 55.854503, 51.087541 ], [ 55.854503, -21.370782 ], [ -61.797841, -21.370782 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 435, "properties": { "ne10-admin0:name_en": "france", "ne10-admin0:iso_a2_eh": "fr", "ne10-admin0:iso_a3_eh": "fra", "felt:cluster_size": 1, "another": "two", "country": "France", "fid": 4, "something": "one" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -61.797841, -21.370782 ], [ -61.797841, 51.087541 ], [ 55.854503, 51.087541 ], [ 55.854503, -21.370782 ], [ -61.797841, -21.370782 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 435, "properties": { "ne10-admin0:name_en": "france", "ne10-admin0:iso_a2_eh": "fr", "ne10-admin0:iso_a3_eh": "fra", "felt:cluster_size": 1, "another": "deux", "country": "France", "fid": 5, "something": "un" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -61.797841, -21.370782 ], [ -61.797841, 51.087541 ], [ 55.854503, 51.087541 ], [ 55.854503, -21.370782 ], [ -61.797841, -21.370782 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 650, "properties": { "ne10-admin0:name_en": "italy", "ne10-admin0:iso_a2_eh": "it", "ne10-admin0:iso_a3_eh": "ita", "felt:cluster_size": 1, "another": "bar", "country": "Italy", "fid": 3, "something": "foo" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.517426, 35.489244 ], [ 6.602728, 35.489244 ], [ 6.602728, 47.085215 ], [ 18.517426, 47.085215 ], [ 18.517426, 35.489244 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 1546, "properties": { "ne10-admin0:name_en": "saint-martin", "ne10-admin0:iso_a2_eh": "mf", "ne10-admin0:iso_a3_eh": "maf", "felt:cluster_size": 1, "another": "hey", "country": "saint-martin", "fid": 7, "something": "hey" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -63.010731, 18.033391 ], [ -63.146840, 18.033391 ], [ -63.146840, 18.122138 ], [ -63.010731, 18.122138 ], [ -63.010731, 18.033391 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 1611, "properties": { "ne10-admin0:name_en": "saint-martin", "ne10-admin0:iso_a2_eh": "sx", "ne10-admin0:iso_a3_eh": "sxm", "felt:cluster_size": 1, "another": "hey", "country": "saint-martin", "fid": 7, "something": "hey" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -63.017568, 18.019110 ], [ -63.118886, 18.019110 ], [ -63.118886, 18.062120 ], [ -63.017568, 18.062120 ], [ -63.017568, 18.019110 ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-63.146840,-21.370782,55.854503,55.065334",
|
||||
"bounds": "-63.146840,-21.370782,55.854503,55.065334",
|
||||
"center": "0.000000,0.000000,0",
|
||||
"description": "/tmp/tmp588djzw6/bboxes.pmtiles",
|
||||
"format": "pbf",
|
||||
"generator_options": "tippecanoe '--tile-stats-values-limit=1' -o /tmp/tmp588djzw6/bboxes.pmtiles -l parsed-bboxes -U1 '--smallest-maximum-zoom-guess=7' -Bg --drop-fraction-as-needed -P --hilbert --generate-variable-depth-tile-pyramid -rp -b0 '--extend-zooms-if-still-dropping-maximum=3' '--extra-detail=30' -D10 '--tiny-polygon-size=1' --no-tiny-polygon-reduction-at-maximum-zoom '--simplification=1' '--simplification-at-maximum-zoom=0.25' --detect-longitude-wraparound --preserve-input-order '--maximum-tile-bytes=2621440' '--maximum-string-attribute-length=65536' --preserve-point-density-threshold 64 --set-attribute '{\"felt:cluster_size\": 1}' --accumulate-attribute '{\"felt:cluster_size\": \"sum\"}' --preserve-multiplier-density-threshold 512 '--accumulate-numeric-attributes=felt' /tmp/tmpg9jf8evz/parsed.geojsonseq.gz; ./tile-join -i -f -o tests/join-sql/countries.pmtiles --join-sqlite tests/join-sql/countries.gpkg --join-table countries --join-tile-attribute ne10-admin0:name_en --join-table-expression 'lower(country)' tests/join-sql/bboxes.pmtiles",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"parsed-bboxes\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"another\":\"String\",\"country\":\"String\",\"felt:cluster_size\":\"Number\",\"fid\":\"Number\",\"ne10-admin0:iso_a2_eh\":\"String\",\"ne10-admin0:iso_a3_eh\":\"String\",\"ne10-admin0:name_en\":\"String\",\"something\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"parsed-bboxes\",\"count\":5,\"geometry\":\"Polygon\",\"attributeCount\":8,\"attributes\":[{\"attribute\":\"another\",\"count\":4,\"type\":\"string\",\"values\":[\"bar\",\"hey\",\"why\",\"yes\"]},{\"attribute\":\"country\",\"count\":4,\"type\":\"string\",\"values\":[\"France\",\"Germany\",\"Italy\",\"saint-martin\"]},{\"attribute\":\"felt:cluster_size\",\"count\":1,\"type\":\"number\",\"values\":[1],\"min\":1,\"max\":1},{\"attribute\":\"fid\",\"count\":4,\"type\":\"number\",\"values\":[1,2,3,7],\"min\":1,\"max\":7},{\"attribute\":\"ne10-admin0:iso_a2_eh\",\"count\":5,\"type\":\"string\",\"values\":[\"de\",\"fr\",\"it\",\"mf\",\"sx\"]},{\"attribute\":\"ne10-admin0:iso_a3_eh\",\"count\":5,\"type\":\"string\",\"values\":[\"deu\",\"fra\",\"ita\",\"maf\",\"sxm\"]},{\"attribute\":\"ne10-admin0:name_en\",\"count\":4,\"type\":\"string\",\"values\":[\"france\",\"germany\",\"italy\",\"saint-martin\"]},{\"attribute\":\"something\",\"count\":4,\"type\":\"string\",\"values\":[\"blah\",\"foo\",\"hey\",\"what\"]}]}]}}",
|
||||
"maxzoom": "0",
|
||||
"minzoom": "0",
|
||||
"name": "/tmp/tmp588djzw6/bboxes.pmtiles",
|
||||
"strategies": "[{\"truncated_zooms\":1}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "parsed-bboxes", "version": 2, "extent": 1073741824 }, "features": [
|
||||
{ "type": "Feature", "id": 322, "properties": { "ne10-admin0:name_en": "germany", "ne10-admin0:iso_a2_eh": "de", "ne10-admin0:iso_a3_eh": "deu", "felt:cluster_size": 1, "another": "yes", "country": "Germany", "fid": 1, "something": "blah" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 15.022060, 47.271121 ], [ 5.852490, 47.271121 ], [ 5.852490, 55.065334 ], [ 15.022060, 55.065334 ], [ 15.022060, 47.271121 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 435, "properties": { "ne10-admin0:name_en": "france", "ne10-admin0:iso_a2_eh": "fr", "ne10-admin0:iso_a3_eh": "fra", "felt:cluster_size": 1, "another": "why", "country": "France", "fid": 2, "something": "what" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -61.797841, -21.370782 ], [ -61.797841, 51.087541 ], [ 55.854503, 51.087541 ], [ 55.854503, -21.370782 ], [ -61.797841, -21.370782 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 650, "properties": { "ne10-admin0:name_en": "italy", "ne10-admin0:iso_a2_eh": "it", "ne10-admin0:iso_a3_eh": "ita", "felt:cluster_size": 1, "another": "bar", "country": "Italy", "fid": 3, "something": "foo" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.517426, 35.489244 ], [ 6.602728, 35.489244 ], [ 6.602728, 47.085215 ], [ 18.517426, 47.085215 ], [ 18.517426, 35.489244 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 1546, "properties": { "ne10-admin0:name_en": "saint-martin", "ne10-admin0:iso_a2_eh": "mf", "ne10-admin0:iso_a3_eh": "maf", "felt:cluster_size": 1, "another": "hey", "country": "saint-martin", "fid": 7, "something": "hey" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -63.010731, 18.033391 ], [ -63.146840, 18.033391 ], [ -63.146840, 18.122138 ], [ -63.010731, 18.122138 ], [ -63.010731, 18.033391 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 1611, "properties": { "ne10-admin0:name_en": "saint-martin", "ne10-admin0:iso_a2_eh": "sx", "ne10-admin0:iso_a3_eh": "sxm", "felt:cluster_size": 1, "another": "hey", "country": "saint-martin", "fid": 7, "something": "hey" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -63.017568, 18.019110 ], [ -63.118886, 18.019110 ], [ -63.118886, 18.062120 ], [ -63.017568, 18.062120 ], [ -63.017568, 18.019110 ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1,2 @@
|
||||
{"type":"Feature","properties":{"explanation":"in z0, the value at 0,0 will get averaged onto this point at -10,-10 even though the attribute isn't present in this feature"},"geometry":{"type":"Point","coordinates":[-10,-10]}}
|
||||
{"type":"Feature","properties":{"value":5},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
@@ -0,0 +1,47 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-10.000000,-10.000000,0.000000,0.000000",
|
||||
"bounds": "-10.000000,-10.000000,0.000000,0.000000",
|
||||
"center": "-10.000000,-10.000000,1",
|
||||
"description": "tests/mean-accumulation/out/-z1_--accumulate-attribute_value%3amean.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"generator_options": "./tippecanoe -q -a@ -f -o tests/mean-accumulation/out/-z1_--accumulate-attribute_value%3amean.json.check.mbtiles -z1 --accumulate-attribute value:mean tests/mean-accumulation/in.json",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":1,\"fields\":{\"explanation\":\"String\",\"value\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":2,\"geometry\":\"Point\",\"attributeCount\":2,\"attributes\":[{\"attribute\":\"explanation\",\"count\":1,\"type\":\"string\",\"values\":[\"in z0, the value at 0,0 will get averaged onto this point at -10,-10 even though the attribute isn't present in this feature\"]},{\"attribute\":\"value\",\"count\":1,\"type\":\"number\",\"values\":[5],\"min\":5,\"max\":5}]}]}}",
|
||||
"maxzoom": "1",
|
||||
"minzoom": "0",
|
||||
"name": "tests/mean-accumulation/out/-z1_--accumulate-attribute_value%3amean.json.check.mbtiles",
|
||||
"strategies": "[{\"dropped_by_rate\":1},{}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "explanation": "in z0, the value at 0,0 will get averaged onto this point at -10,-10 even though the attribute isn't present in this feature", "value": 5 }, "geometry": { "type": "Point", "coordinates": [ -10.019531, -10.055403 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "explanation": "in z0, the value at 0,0 will get averaged onto this point at -10,-10 even though the attribute isn't present in this feature" }, "geometry": { "type": "Point", "coordinates": [ -10.019531, -10.012130 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "value": 5 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "value": 5 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "value": 5 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "value": 5 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
@@ -1,5 +1,5 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"antimeridian_adjusted_bounds": "0.000000,-85.051129,359.912109,85.051129",
|
||||
"bounds": "-180.000000,-85.051129,180.000000,85.051129",
|
||||
"center": "-45.000000,33.256630,4",
|
||||
"description": "tests/ne_110m_ocean/join/ocean.mbtiles",
|
||||
|
||||
+767
@@ -0,0 +1,767 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-175.220564,-41.299973,179.216647,64.150023",
|
||||
"bounds": "-175.220564,-41.299973,179.216647,64.150023",
|
||||
"center": "90.000000,42.525564,1",
|
||||
"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.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",
|
||||
"strategies": "[{\"dropped_by_rate\":145},{}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "Vancouver", "POP2000": 2597.5 }, "geometry": { "type": "Point", "coordinates": [ -123.134766, 49.267805 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Los Angeles", "POP2000": 6906 }, "geometry": { "type": "Point", "coordinates": [ -118.125000, 33.943360 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Monterrey", "POP2000": 8379 }, "geometry": { "type": "Point", "coordinates": [ -100.283203, 25.641526 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Guatemala", "POP2000": 4620.5 }, "geometry": { "type": "Point", "coordinates": [ -90.527344, 14.604847 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Toronto", "POP2000": 3076 }, "geometry": { "type": "Point", "coordinates": [ -79.365234, 43.707594 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Havana", "POP2000": 3566.5 }, "geometry": { "type": "Point", "coordinates": [ -82.353516, 23.079732 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Washington, D.C.", "POP2000": 10897.5 }, "geometry": { "type": "Point", "coordinates": [ -76.992188, 38.891033 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Belmopan", "POP2000": 793 }, "geometry": { "type": "Point", "coordinates": [ -88.769531, 17.224758 ] } }
|
||||
,
|
||||
{ "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.6666666666667 }, "geometry": { "type": "Point", "coordinates": [ -72.333984, 18.562947 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Basseterre" }, "geometry": { "type": "Point", "coordinates": [ -62.666016, 17.308688 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Roseau" }, "geometry": { "type": "Point", "coordinates": [ -61.347656, 15.284185 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Saint George's" }, "geometry": { "type": "Point", "coordinates": [ -61.699219, 12.039321 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Caracas", "POP2000": 2864 }, "geometry": { "type": "Point", "coordinates": [ -66.884766, 10.487812 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Paramaribo" }, "geometry": { "type": "Point", "coordinates": [ -55.107422, 5.790897 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dublin", "POP2000": 4607 }, "geometry": { "type": "Point", "coordinates": [ -6.240234, 53.330873 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Laayoune", "POP2000": 2672 }, "geometry": { "type": "Point", "coordinates": [ -13.183594, 27.137368 ] } }
|
||||
,
|
||||
{ "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 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nouakchott" }, "geometry": { "type": "Point", "coordinates": [ -15.996094, 18.062312 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Conakry", "POP2000": 953.5 }, "geometry": { "type": "Point", "coordinates": [ -13.623047, 9.535749 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bamako", "POP2000": 924.6666666666666 }, "geometry": { "type": "Point", "coordinates": [ -7.998047, 12.640338 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Yamoussoukro", "POP2000": 3032 }, "geometry": { "type": "Point", "coordinates": [ -5.273438, 6.839170 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Accra", "POP2000": 1674 }, "geometry": { "type": "Point", "coordinates": [ -0.175781, 5.528511 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Quito", "POP2000": 4236.5 }, "geometry": { "type": "Point", "coordinates": [ -78.486328, -0.263671 ] } }
|
||||
,
|
||||
{ "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 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Asuncion", "POP2000": 10151 }, "geometry": { "type": "Point", "coordinates": [ -57.656250, -25.324167 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Montevideo", "POP2000": 6182 }, "geometry": { "type": "Point", "coordinates": [ -56.162109, -34.885931 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Oslo", "POP2000": 990 }, "geometry": { "type": "Point", "coordinates": [ 10.810547, 59.888937 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Amsterdam", "POP2000": 1369 }, "geometry": { "type": "Point", "coordinates": [ 4.921875, 52.321911 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Luxembourg", "POP2000": 9692 }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 49.610710 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Geneva" }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 46.195042 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vaduz", "POP2000": 1077 }, "geometry": { "type": "Point", "coordinates": [ 9.580078, 47.100045 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Berlin", "POP2000": 2278 }, "geometry": { "type": "Point", "coordinates": [ 13.447266, 52.536273 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Warsaw", "POP2000": 1912 }, "geometry": { "type": "Point", "coordinates": [ 21.005859, 52.214339 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zagreb" }, "geometry": { "type": "Point", "coordinates": [ 15.996094, 45.767523 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vatican City", "POP2000": 3385 }, "geometry": { "type": "Point", "coordinates": [ 12.480469, 41.902277 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Budapest", "POP2000": 1787 }, "geometry": { "type": "Point", "coordinates": [ 19.072266, 47.457809 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Podgorica", "POP2000": 1127 }, "geometry": { "type": "Point", "coordinates": [ 19.248047, 42.423457 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pristina" }, "geometry": { "type": "Point", "coordinates": [ 21.181641, 42.682435 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Helsinki", "POP2000": 1019 }, "geometry": { "type": "Point", "coordinates": [ 24.960938, 60.152442 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vilnius", "POP2000": 1700 }, "geometry": { "type": "Point", "coordinates": [ 25.312500, 54.673831 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kiev", "POP2000": 1894.3333333333333 }, "geometry": { "type": "Point", "coordinates": [ 30.498047, 50.401515 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Chisinau", "POP2000": 8744 }, "geometry": { "type": "Point", "coordinates": [ 28.916016, 46.980252 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Moscow", "POP2000": 4623.333333333333 }, "geometry": { "type": "Point", "coordinates": [ 37.617188, 55.727110 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tunis", "POP2000": 1877 }, "geometry": { "type": "Point", "coordinates": [ 10.195312, 36.809285 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Valletta", "POP2000": 851.5 }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 35.889050 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Cotonou", "POP2000": 642 }, "geometry": { "type": "Point", "coordinates": [ 2.548828, 6.402648 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lagos", "POP2000": 4032.5 }, "geometry": { "type": "Point", "coordinates": [ 3.427734, 6.402648 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Malabo" }, "geometry": { "type": "Point", "coordinates": [ 8.789062, 3.688855 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ndjamena", "POP2000": 951.5 }, "geometry": { "type": "Point", "coordinates": [ 15.029297, 12.125264 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Athens", "POP2000": 3179 }, "geometry": { "type": "Point", "coordinates": [ 23.730469, 37.996163 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nicosia", "POP2000": 6643 }, "geometry": { "type": "Point", "coordinates": [ 33.398438, 35.173808 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Beirut", "POP2000": 1765.5 }, "geometry": { "type": "Point", "coordinates": [ 35.507812, 33.870416 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Yerevan", "POP2000": 3155.5 }, "geometry": { "type": "Point", "coordinates": [ 44.560547, 40.178873 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Amman", "POP2000": 2478 }, "geometry": { "type": "Point", "coordinates": [ 35.947266, 31.952162 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Juba", "POP2000": 1097 }, "geometry": { "type": "Point", "coordinates": [ 31.640625, 4.828260 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sanaa", "POP2000": 1365 }, "geometry": { "type": "Point", "coordinates": [ 44.208984, 15.368950 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Addis Ababa", "POP2000": 2493 }, "geometry": { "type": "Point", "coordinates": [ 38.759766, 9.015302 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tashkent", "POP2000": 1452.5 }, "geometry": { "type": "Point", "coordinates": [ 69.345703, 41.310824 ] } }
|
||||
,
|
||||
{ "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 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Manama", "POP2000": 938 }, "geometry": { "type": "Point", "coordinates": [ 50.625000, 26.194877 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Abu Dhabi" }, "geometry": { "type": "Point", "coordinates": [ 54.404297, 24.447150 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Muscat", "POP2000": 1201 }, "geometry": { "type": "Point", "coordinates": [ 58.623047, 23.563987 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kabul", "POP2000": 1278.5 }, "geometry": { "type": "Point", "coordinates": [ 69.169922, 34.524661 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "New Delhi", "POP2000": 644 }, "geometry": { "type": "Point", "coordinates": [ 77.255859, 28.613459 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kolkata", "POP2000": 14572 }, "geometry": { "type": "Point", "coordinates": [ 88.330078, 22.512557 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bangalore", "POP2000": 5567 }, "geometry": { "type": "Point", "coordinates": [ 77.607422, 12.983148 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sri Jawewardenepura Kotte", "POP2000": 763 }, "geometry": { "type": "Point", "coordinates": [ 79.980469, 6.839170 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dhaka", "POP2000": 7102 }, "geometry": { "type": "Point", "coordinates": [ 90.439453, 23.725012 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Rangoon", "POP2000": 4942.5 }, "geometry": { "type": "Point", "coordinates": [ 96.152344, 16.804541 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vientiane", "POP2000": 2456 }, "geometry": { "type": "Point", "coordinates": [ 102.656250, 17.978733 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kuala Lumpur", "POP2000": 1306 }, "geometry": { "type": "Point", "coordinates": [ 101.689453, 3.162456 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Singapore", "POP2000": 6820.333333333333 }, "geometry": { "type": "Point", "coordinates": [ 103.886719, 1.230374 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Shanghai", "POP2000": 7941.5 }, "geometry": { "type": "Point", "coordinates": [ 121.464844, 31.203405 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pyongyang", "POP2000": 6517 }, "geometry": { "type": "Point", "coordinates": [ 125.771484, 39.027719 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Manila", "POP2000": 9958 }, "geometry": { "type": "Point", "coordinates": [ 121.025391, 14.604847 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Melekeok", "POP2000": 6485.5 }, "geometry": { "type": "Point", "coordinates": [ 134.648438, 7.449624 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tokyo", "POP2000": 34450 }, "geometry": { "type": "Point", "coordinates": [ 139.746094, 35.675147 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Majuro", "POP2000": 986 }, "geometry": { "type": "Point", "coordinates": [ 171.386719, 7.100893 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kinshasa", "POP2000": 4038 }, "geometry": { "type": "Point", "coordinates": [ 15.292969, -4.390229 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Windhoek", "POP2000": 1606 }, "geometry": { "type": "Point", "coordinates": [ 17.138672, -22.593726 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bujumbura", "POP2000": 1073 }, "geometry": { "type": "Point", "coordinates": [ 29.355469, -3.425692 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Harare", "POP2000": 1806 }, "geometry": { "type": "Point", "coordinates": [ 31.025391, -17.811456 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dar es Salaam", "POP2000": 2116 }, "geometry": { "type": "Point", "coordinates": [ 39.287109, -6.839170 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Moroni", "POP2000": 2732 }, "geometry": { "type": "Point", "coordinates": [ 43.242188, -11.695273 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bloemfontein" }, "geometry": { "type": "Point", "coordinates": [ 26.279297, -29.152161 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pretoria", "POP2000": 1084 }, "geometry": { "type": "Point", "coordinates": [ 28.212891, -25.720735 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Maputo", "POP2000": 1096 }, "geometry": { "type": "Point", "coordinates": [ 32.607422, -25.958045 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Antananarivo", "POP2000": 4875.5 }, "geometry": { "type": "Point", "coordinates": [ 47.548828, -18.895893 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dili" }, "geometry": { "type": "Point", "coordinates": [ 125.595703, -8.581021 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Melbourne", "POP2000": 3755.5 }, "geometry": { "type": "Point", "coordinates": [ 145.019531, -37.857507 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Honiara" }, "geometry": { "type": "Point", "coordinates": [ 159.960938, -9.449062 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Funafuti", "POP2000": 1063 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 179.208984, -8.581021 ], [ -180.791016, -8.581021 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Wellington" }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 174.814453, -41.310824 ], [ -185.273438, -41.310824 ] ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "Nukualofa" }, "geometry": { "type": "Point", "coordinates": [ -175.209961, -21.125498 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Apia" }, "geometry": { "type": "Point", "coordinates": [ -171.738281, -13.838080 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Quito", "POP2000": 1357 }, "geometry": { "type": "Point", "coordinates": [ -78.486328, -0.219726 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lima", "POP2000": 7116 }, "geometry": { "type": "Point", "coordinates": [ -77.036133, -12.039321 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "La Paz", "POP2000": 1390 }, "geometry": { "type": "Point", "coordinates": [ -68.159180, -16.509833 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Valparaiso", "POP2000": 803 }, "geometry": { "type": "Point", "coordinates": [ -71.630859, -33.063924 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Santiago", "POP2000": 5275 }, "geometry": { "type": "Point", "coordinates": [ -70.664062, -33.431441 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sucre" }, "geometry": { "type": "Point", "coordinates": [ -65.258789, -19.020577 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Brasilia", "POP2000": 2746 }, "geometry": { "type": "Point", "coordinates": [ -47.900391, -15.792254 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Asuncion", "POP2000": 1507 }, "geometry": { "type": "Point", "coordinates": [ -57.656250, -25.284438 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Buenos Aires", "POP2000": 11847 }, "geometry": { "type": "Point", "coordinates": [ -58.403320, -34.597042 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sao Paulo", "POP2000": 17099 }, "geometry": { "type": "Point", "coordinates": [ -46.625977, -23.563987 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Montevideo", "POP2000": 1561 }, "geometry": { "type": "Point", "coordinates": [ -56.162109, -34.849875 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Rio de Janeiro", "POP2000": 10803 }, "geometry": { "type": "Point", "coordinates": [ -43.242188, -22.917923 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Funafuti" }, "geometry": { "type": "Point", "coordinates": [ -180.791016, -8.537565 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Suva" }, "geometry": { "type": "Point", "coordinates": [ -181.538086, -18.145852 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "Vancouver", "POP2000": 1959 }, "geometry": { "type": "Point", "coordinates": [ -123.134766, 49.267805 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "San Francisco", "POP2000": 3236 }, "geometry": { "type": "Point", "coordinates": [ -122.431641, 37.753344 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Los Angeles", "POP2000": 11814 }, "geometry": { "type": "Point", "coordinates": [ -118.168945, 33.979809 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Denver", "POP2000": 1998 }, "geometry": { "type": "Point", "coordinates": [ -104.985352, 39.740986 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Monterrey", "POP2000": 3266 }, "geometry": { "type": "Point", "coordinates": [ -100.327148, 25.681137 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Houston", "POP2000": 3849 }, "geometry": { "type": "Point", "coordinates": [ -95.361328, 29.840644 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mexico City", "POP2000": 18022 }, "geometry": { "type": "Point", "coordinates": [ -99.140625, 19.435514 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Guatemala", "POP2000": 908 }, "geometry": { "type": "Point", "coordinates": [ -90.527344, 14.604847 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Chicago", "POP2000": 8333 }, "geometry": { "type": "Point", "coordinates": [ -87.758789, 41.836828 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Toronto", "POP2000": 4607 }, "geometry": { "type": "Point", "coordinates": [ -79.409180, 43.707594 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ottawa", "POP2000": 1079 }, "geometry": { "type": "Point", "coordinates": [ -75.717773, 45.429299 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Atlanta", "POP2000": 3542 }, "geometry": { "type": "Point", "coordinates": [ -84.418945, 33.833920 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Havana", "POP2000": 2187 }, "geometry": { "type": "Point", "coordinates": [ -82.353516, 23.120154 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Miami", "POP2000": 4946 }, "geometry": { "type": "Point", "coordinates": [ -80.244141, 25.799891 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Washington, D.C.", "POP2000": 3949 }, "geometry": { "type": "Point", "coordinates": [ -76.992188, 38.891033 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "New York", "POP2000": 17846 }, "geometry": { "type": "Point", "coordinates": [ -74.003906, 40.747257 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nassau" }, "geometry": { "type": "Point", "coordinates": [ -77.343750, 25.085599 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Belmopan" }, "geometry": { "type": "Point", "coordinates": [ -88.769531, 17.266728 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tegucigalpa", "POP2000": 793 }, "geometry": { "type": "Point", "coordinates": [ -87.231445, 14.093957 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "San Salvador", "POP2000": 1233 }, "geometry": { "type": "Point", "coordinates": [ -89.208984, 13.710035 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Managua", "POP2000": 887 }, "geometry": { "type": "Point", "coordinates": [ -86.264648, 12.168226 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "San Jose", "POP2000": 1032 }, "geometry": { "type": "Point", "coordinates": [ -84.067383, 9.925566 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Panama City", "POP2000": 1072 }, "geometry": { "type": "Point", "coordinates": [ -79.541016, 8.971897 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kingston" }, "geometry": { "type": "Point", "coordinates": [ -76.772461, 17.978733 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Port-au-Prince", "POP2000": 1653 }, "geometry": { "type": "Point", "coordinates": [ -72.333984, 18.562947 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Santo Domingo", "POP2000": 1854 }, "geometry": { "type": "Point", "coordinates": [ -69.916992, 18.479609 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bogota", "POP2000": 6356 }, "geometry": { "type": "Point", "coordinates": [ -74.091797, 4.609278 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Basseterre" }, "geometry": { "type": "Point", "coordinates": [ -62.709961, 17.308688 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Saint John's" }, "geometry": { "type": "Point", "coordinates": [ -61.831055, 17.098792 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Roseau" }, "geometry": { "type": "Point", "coordinates": [ -61.391602, 15.284185 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Castries" }, "geometry": { "type": "Point", "coordinates": [ -60.996094, 14.008696 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kingstown" }, "geometry": { "type": "Point", "coordinates": [ -61.215820, 13.154376 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Saint George's" }, "geometry": { "type": "Point", "coordinates": [ -61.743164, 12.039321 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bridgetown" }, "geometry": { "type": "Point", "coordinates": [ -59.633789, 13.111580 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Caracas", "POP2000": 2864 }, "geometry": { "type": "Point", "coordinates": [ -66.928711, 10.487812 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Port-of-Spain" }, "geometry": { "type": "Point", "coordinates": [ -61.523438, 10.660608 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Georgetown" }, "geometry": { "type": "Point", "coordinates": [ -58.183594, 6.795535 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Paramaribo" }, "geometry": { "type": "Point", "coordinates": [ -55.151367, 5.834616 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Reykjavík" }, "geometry": { "type": "Point", "coordinates": [ -21.928711, 64.148952 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dublin", "POP2000": 989 }, "geometry": { "type": "Point", "coordinates": [ -6.240234, 53.330873 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "London", "POP2000": 8225 }, "geometry": { "type": "Point", "coordinates": [ -0.131836, 51.508742 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Praia" }, "geometry": { "type": "Point", "coordinates": [ -23.510742, 14.902322 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Laayoune" }, "geometry": { "type": "Point", "coordinates": [ -13.183594, 27.137368 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lisbon", "POP2000": 2672 }, "geometry": { "type": "Point", "coordinates": [ -9.140625, 38.719805 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Casablanca", "POP2000": 3043 }, "geometry": { "type": "Point", "coordinates": [ -7.602539, 33.614619 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Rabat", "POP2000": 1507 }, "geometry": { "type": "Point", "coordinates": [ -6.855469, 34.016242 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Madrid", "POP2000": 5045 }, "geometry": { "type": "Point", "coordinates": [ -3.691406, 40.413496 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bir Lehlou" }, "geometry": { "type": "Point", "coordinates": [ -9.667969, 26.115986 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dakar", "POP2000": 2029 }, "geometry": { "type": "Point", "coordinates": [ -17.490234, 14.732386 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nouakchott" }, "geometry": { "type": "Point", "coordinates": [ -15.996094, 18.104087 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Banjul" }, "geometry": { "type": "Point", "coordinates": [ -16.611328, 13.453737 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bissau" }, "geometry": { "type": "Point", "coordinates": [ -15.600586, 11.867351 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Conakry", "POP2000": 1219 }, "geometry": { "type": "Point", "coordinates": [ -13.666992, 9.535749 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Freetown", "POP2000": 688 }, "geometry": { "type": "Point", "coordinates": [ -13.227539, 8.450639 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bamako", "POP2000": 1110 }, "geometry": { "type": "Point", "coordinates": [ -7.998047, 12.640338 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ouagadougou", "POP2000": 828 }, "geometry": { "type": "Point", "coordinates": [ -1.538086, 12.382928 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Monrovia", "POP2000": 836 }, "geometry": { "type": "Point", "coordinates": [ -10.810547, 6.315299 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Yamoussoukro" }, "geometry": { "type": "Point", "coordinates": [ -5.273438, 6.839170 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Abidjan", "POP2000": 3032 }, "geometry": { "type": "Point", "coordinates": [ -4.042969, 5.309766 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Accra", "POP2000": 1674 }, "geometry": { "type": "Point", "coordinates": [ -0.219727, 5.572250 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Quito", "POP2000": 1357 }, "geometry": { "type": "Point", "coordinates": [ -78.486328, -0.219726 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Paris", "POP2000": 9692 }, "geometry": { "type": "Point", "coordinates": [ 2.329102, 48.864715 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Andorra" }, "geometry": { "type": "Point", "coordinates": [ 1.538086, 42.488302 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Algiers", "POP2000": 2754 }, "geometry": { "type": "Point", "coordinates": [ 3.032227, 36.774092 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Niamey", "POP2000": 680 }, "geometry": { "type": "Point", "coordinates": [ 2.109375, 13.539201 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lome", "POP2000": 1023 }, "geometry": { "type": "Point", "coordinates": [ 1.230469, 6.140555 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Cotonou", "POP2000": 642 }, "geometry": { "type": "Point", "coordinates": [ 2.504883, 6.402648 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Porto-Novo" }, "geometry": { "type": "Point", "coordinates": [ 2.636719, 6.489983 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lagos", "POP2000": 7233 }, "geometry": { "type": "Point", "coordinates": [ 3.383789, 6.446318 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "Sao Tome" }, "geometry": { "type": "Point", "coordinates": [ 6.723633, 0.351560 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Libreville" }, "geometry": { "type": "Point", "coordinates": [ 9.448242, 0.395505 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kampala", "POP2000": 1097 }, "geometry": { "type": "Point", "coordinates": [ 32.563477, 0.307616 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mogadishu", "POP2000": 1201 }, "geometry": { "type": "Point", "coordinates": [ 45.351562, 2.064982 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kuala Lumpur", "POP2000": 1306 }, "geometry": { "type": "Point", "coordinates": [ 101.689453, 3.162456 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Putrajaya" }, "geometry": { "type": "Point", "coordinates": [ 101.689453, 2.899153 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Singapore", "POP2000": 4017 }, "geometry": { "type": "Point", "coordinates": [ 103.842773, 1.274309 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tarawa" }, "geometry": { "type": "Point", "coordinates": [ 173.012695, 1.318243 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Brazzaville", "POP2000": 986 }, "geometry": { "type": "Point", "coordinates": [ 15.292969, -4.258768 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kinshasa", "POP2000": 5485 }, "geometry": { "type": "Point", "coordinates": [ 15.292969, -4.346411 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Luanda", "POP2000": 2591 }, "geometry": { "type": "Point", "coordinates": [ 13.227539, -8.841651 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Windhoek" }, "geometry": { "type": "Point", "coordinates": [ 17.094727, -22.553147 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Cape Town", "POP2000": 2715 }, "geometry": { "type": "Point", "coordinates": [ 18.413086, -33.906896 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kigali", "POP2000": 497 }, "geometry": { "type": "Point", "coordinates": [ 30.058594, -1.933227 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bujumbura" }, "geometry": { "type": "Point", "coordinates": [ 29.355469, -3.381824 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lusaka", "POP2000": 1073 }, "geometry": { "type": "Point", "coordinates": [ 28.300781, -15.411319 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Harare", "POP2000": 1379 }, "geometry": { "type": "Point", "coordinates": [ 31.025391, -17.811456 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nairobi", "POP2000": 2233 }, "geometry": { "type": "Point", "coordinates": [ 36.826172, -1.274309 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dodoma" }, "geometry": { "type": "Point", "coordinates": [ 35.771484, -6.184246 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dar es Salaam", "POP2000": 2116 }, "geometry": { "type": "Point", "coordinates": [ 39.287109, -6.795535 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lilongwe" }, "geometry": { "type": "Point", "coordinates": [ 33.793945, -13.966054 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Moroni" }, "geometry": { "type": "Point", "coordinates": [ 43.242188, -11.695273 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Gaborone" }, "geometry": { "type": "Point", "coordinates": [ 25.927734, -24.647017 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Johannesburg", "POP2000": 2732 }, "geometry": { "type": "Point", "coordinates": [ 28.037109, -26.155438 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bloemfontein" }, "geometry": { "type": "Point", "coordinates": [ 26.235352, -29.113775 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Maseru" }, "geometry": { "type": "Point", "coordinates": [ 27.465820, -29.305561 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pretoria", "POP2000": 1084 }, "geometry": { "type": "Point", "coordinates": [ 28.212891, -25.720735 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mbabane" }, "geometry": { "type": "Point", "coordinates": [ 31.113281, -26.313113 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lobamba" }, "geometry": { "type": "Point", "coordinates": [ 31.201172, -26.470573 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Maputo", "POP2000": 1096 }, "geometry": { "type": "Point", "coordinates": [ 32.607422, -25.958045 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Victoria" }, "geometry": { "type": "Point", "coordinates": [ 55.458984, -4.609278 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Antananarivo", "POP2000": 1361 }, "geometry": { "type": "Point", "coordinates": [ 47.504883, -18.895893 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Port Louis" }, "geometry": { "type": "Point", "coordinates": [ 57.480469, -20.179724 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Jakarta", "POP2000": 8390 }, "geometry": { "type": "Point", "coordinates": [ 106.831055, -6.184246 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dili" }, "geometry": { "type": "Point", "coordinates": [ 125.595703, -8.581021 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Port Moresby" }, "geometry": { "type": "Point", "coordinates": [ 147.172852, -9.449062 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Melbourne", "POP2000": 3433 }, "geometry": { "type": "Point", "coordinates": [ 144.975586, -37.822802 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sydney", "POP2000": 4078 }, "geometry": { "type": "Point", "coordinates": [ 151.171875, -33.906896 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Canberra" }, "geometry": { "type": "Point", "coordinates": [ 149.150391, -35.281501 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Honiara" }, "geometry": { "type": "Point", "coordinates": [ 159.960938, -9.449062 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Port Vila" }, "geometry": { "type": "Point", "coordinates": [ 168.310547, -17.727759 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Funafuti" }, "geometry": { "type": "Point", "coordinates": [ 179.208984, -8.537565 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Suva" }, "geometry": { "type": "Point", "coordinates": [ 178.461914, -18.145852 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Auckland", "POP2000": 1063 }, "geometry": { "type": "Point", "coordinates": [ 174.770508, -36.844461 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Wellington" }, "geometry": { "type": "Point", "coordinates": [ 174.770508, -41.310824 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "London", "POP2000": 8225 }, "geometry": { "type": "Point", "coordinates": [ -0.131836, 51.508742 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ouagadougou", "POP2000": 828 }, "geometry": { "type": "Point", "coordinates": [ -1.538086, 12.382928 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Accra", "POP2000": 1674 }, "geometry": { "type": "Point", "coordinates": [ -0.219727, 5.572250 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Oslo", "POP2000": 774 }, "geometry": { "type": "Point", "coordinates": [ 10.766602, 59.910976 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Stockholm", "POP2000": 1206 }, "geometry": { "type": "Point", "coordinates": [ 18.105469, 59.355596 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "The Hague" }, "geometry": { "type": "Point", "coordinates": [ 4.262695, 52.079506 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Amsterdam", "POP2000": 1005 }, "geometry": { "type": "Point", "coordinates": [ 4.921875, 52.348763 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Brussels", "POP2000": 1733 }, "geometry": { "type": "Point", "coordinates": [ 4.350586, 50.847573 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Luxembourg" }, "geometry": { "type": "Point", "coordinates": [ 6.108398, 49.610710 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Paris", "POP2000": 9692 }, "geometry": { "type": "Point", "coordinates": [ 2.329102, 48.864715 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Andorra" }, "geometry": { "type": "Point", "coordinates": [ 1.538086, 42.488302 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Geneva" }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 46.195042 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bern" }, "geometry": { "type": "Point", "coordinates": [ 7.470703, 46.920255 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vaduz" }, "geometry": { "type": "Point", "coordinates": [ 9.536133, 47.129951 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Monaco" }, "geometry": { "type": "Point", "coordinates": [ 7.426758, 43.739352 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "København", "POP2000": 1077 }, "geometry": { "type": "Point", "coordinates": [ 12.568359, 55.677584 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Berlin", "POP2000": 3384 }, "geometry": { "type": "Point", "coordinates": [ 13.403320, 52.536273 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Prague", "POP2000": 1172 }, "geometry": { "type": "Point", "coordinates": [ 14.458008, 50.092393 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Warsaw", "POP2000": 1666 }, "geometry": { "type": "Point", "coordinates": [ 21.005859, 52.241256 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vienna", "POP2000": 2158 }, "geometry": { "type": "Point", "coordinates": [ 16.347656, 48.195387 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ljubljana" }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 46.042736 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zagreb" }, "geometry": { "type": "Point", "coordinates": [ 15.996094, 45.798170 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "San Marino" }, "geometry": { "type": "Point", "coordinates": [ 12.436523, 43.929550 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vatican City" }, "geometry": { "type": "Point", "coordinates": [ 12.436523, 41.902277 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Rome", "POP2000": 3385 }, "geometry": { "type": "Point", "coordinates": [ 12.480469, 41.902277 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bratislava" }, "geometry": { "type": "Point", "coordinates": [ 17.138672, 48.136767 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Budapest", "POP2000": 1787 }, "geometry": { "type": "Point", "coordinates": [ 19.072266, 47.487513 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sarajevo" }, "geometry": { "type": "Point", "coordinates": [ 18.369141, 43.834527 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Podgorica" }, "geometry": { "type": "Point", "coordinates": [ 19.248047, 42.455888 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Belgrade", "POP2000": 1127 }, "geometry": { "type": "Point", "coordinates": [ 20.478516, 44.809122 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tirana" }, "geometry": { "type": "Point", "coordinates": [ 19.819336, 41.343825 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pristina" }, "geometry": { "type": "Point", "coordinates": [ 21.181641, 42.682435 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Skopje" }, "geometry": { "type": "Point", "coordinates": [ 21.445312, 42.000325 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Helsinki", "POP2000": 1019 }, "geometry": { "type": "Point", "coordinates": [ 24.916992, 60.174306 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tallinn" }, "geometry": { "type": "Point", "coordinates": [ 24.741211, 59.422728 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Riga" }, "geometry": { "type": "Point", "coordinates": [ 24.082031, 56.944974 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vilnius" }, "geometry": { "type": "Point", "coordinates": [ 25.312500, 54.673831 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Minsk", "POP2000": 1700 }, "geometry": { "type": "Point", "coordinates": [ 27.553711, 53.904338 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kiev", "POP2000": 2606 }, "geometry": { "type": "Point", "coordinates": [ 30.498047, 50.429518 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sofia", "POP2000": 1128 }, "geometry": { "type": "Point", "coordinates": [ 23.334961, 42.682435 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bucharest", "POP2000": 1949 }, "geometry": { "type": "Point", "coordinates": [ 26.103516, 44.433780 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Chisinau" }, "geometry": { "type": "Point", "coordinates": [ 28.872070, 47.010226 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Istanbul", "POP2000": 8744 }, "geometry": { "type": "Point", "coordinates": [ 29.003906, 41.112469 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Moscow", "POP2000": 10016 }, "geometry": { "type": "Point", "coordinates": [ 37.617188, 55.751849 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tbilisi", "POP2000": 1100 }, "geometry": { "type": "Point", "coordinates": [ 44.780273, 41.738528 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Algiers", "POP2000": 2754 }, "geometry": { "type": "Point", "coordinates": [ 3.032227, 36.774092 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tunis" }, "geometry": { "type": "Point", "coordinates": [ 10.195312, 36.809285 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tripoli", "POP2000": 1877 }, "geometry": { "type": "Point", "coordinates": [ 13.183594, 32.879587 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Valletta" }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 35.889050 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Niamey", "POP2000": 680 }, "geometry": { "type": "Point", "coordinates": [ 2.109375, 13.539201 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lome", "POP2000": 1023 }, "geometry": { "type": "Point", "coordinates": [ 1.230469, 6.140555 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Cotonou", "POP2000": 642 }, "geometry": { "type": "Point", "coordinates": [ 2.504883, 6.402648 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Porto-Novo" }, "geometry": { "type": "Point", "coordinates": [ 2.636719, 6.489983 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lagos", "POP2000": 7233 }, "geometry": { "type": "Point", "coordinates": [ 3.383789, 6.446318 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Abuja", "POP2000": 832 }, "geometry": { "type": "Point", "coordinates": [ 7.514648, 9.102097 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sao Tome" }, "geometry": { "type": "Point", "coordinates": [ 6.723633, 0.351560 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Malabo" }, "geometry": { "type": "Point", "coordinates": [ 8.789062, 3.732708 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Libreville" }, "geometry": { "type": "Point", "coordinates": [ 9.448242, 0.395505 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ndjamena", "POP2000": 711 }, "geometry": { "type": "Point", "coordinates": [ 15.029297, 12.125264 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Yaounde", "POP2000": 1192 }, "geometry": { "type": "Point", "coordinates": [ 11.513672, 3.864255 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bangui" }, "geometry": { "type": "Point", "coordinates": [ 18.544922, 4.346411 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Athens", "POP2000": 3179 }, "geometry": { "type": "Point", "coordinates": [ 23.730469, 37.996163 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ankara", "POP2000": 3179 }, "geometry": { "type": "Point", "coordinates": [ 32.871094, 39.943436 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nicosia" }, "geometry": { "type": "Point", "coordinates": [ 33.354492, 35.173808 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Cairo", "POP2000": 10534 }, "geometry": { "type": "Point", "coordinates": [ 31.245117, 30.069094 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tel Aviv-Yafo", "POP2000": 2752 }, "geometry": { "type": "Point", "coordinates": [ 34.760742, 32.063956 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Beirut", "POP2000": 1487 }, "geometry": { "type": "Point", "coordinates": [ 35.507812, 33.870416 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Damascus", "POP2000": 2044 }, "geometry": { "type": "Point", "coordinates": [ 36.298828, 33.504759 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Yerevan", "POP2000": 1111 }, "geometry": { "type": "Point", "coordinates": [ 44.516602, 40.178873 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Baghdad", "POP2000": 5200 }, "geometry": { "type": "Point", "coordinates": [ 44.384766, 33.358062 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Jerusalem" }, "geometry": { "type": "Point", "coordinates": [ 35.200195, 31.765537 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Amman", "POP2000": 1007 }, "geometry": { "type": "Point", "coordinates": [ 35.947266, 31.952162 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Khartoum", "POP2000": 3949 }, "geometry": { "type": "Point", "coordinates": [ 32.519531, 15.580711 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Juba" }, "geometry": { "type": "Point", "coordinates": [ 31.596680, 4.828260 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kampala", "POP2000": 1097 }, "geometry": { "type": "Point", "coordinates": [ 32.563477, 0.307616 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Asmara" }, "geometry": { "type": "Point", "coordinates": [ 38.935547, 15.326572 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sanaa", "POP2000": 1365 }, "geometry": { "type": "Point", "coordinates": [ 44.208984, 15.368950 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Djibouti" }, "geometry": { "type": "Point", "coordinates": [ 43.154297, 11.609193 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Addis Ababa", "POP2000": 2493 }, "geometry": { "type": "Point", "coordinates": [ 38.715820, 9.015302 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Hargeysa" }, "geometry": { "type": "Point", "coordinates": [ 44.077148, 9.579084 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Astana" }, "geometry": { "type": "Point", "coordinates": [ 71.411133, 51.179343 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tashkent", "POP2000": 2135 }, "geometry": { "type": "Point", "coordinates": [ 69.301758, 41.310824 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bishkek", "POP2000": 770 }, "geometry": { "type": "Point", "coordinates": [ 74.575195, 42.875964 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Urumqi", "POP2000": 1730 }, "geometry": { "type": "Point", "coordinates": [ 87.583008, 43.802819 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Baku", "POP2000": 1806 }, "geometry": { "type": "Point", "coordinates": [ 49.877930, 40.413496 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tehran", "POP2000": 7128 }, "geometry": { "type": "Point", "coordinates": [ 51.416016, 35.675147 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kuwait", "POP2000": 1499 }, "geometry": { "type": "Point", "coordinates": [ 47.988281, 29.382175 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Riyadh", "POP2000": 3567 }, "geometry": { "type": "Point", "coordinates": [ 46.757812, 24.647017 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Manama" }, "geometry": { "type": "Point", "coordinates": [ 50.581055, 26.234302 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Doha" }, "geometry": { "type": "Point", "coordinates": [ 51.547852, 25.284438 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dubai", "POP2000": 938 }, "geometry": { "type": "Point", "coordinates": [ 55.283203, 25.244696 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Abu Dhabi" }, "geometry": { "type": "Point", "coordinates": [ 54.360352, 24.447150 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ashgabat" }, "geometry": { "type": "Point", "coordinates": [ 58.403320, 37.961523 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Muscat" }, "geometry": { "type": "Point", "coordinates": [ 58.579102, 23.604262 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mogadishu", "POP2000": 1201 }, "geometry": { "type": "Point", "coordinates": [ 45.351562, 2.064982 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dushanbe" }, "geometry": { "type": "Point", "coordinates": [ 68.774414, 38.548165 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kabul", "POP2000": 1963 }, "geometry": { "type": "Point", "coordinates": [ 69.169922, 34.524661 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Islamabad", "POP2000": 594 }, "geometry": { "type": "Point", "coordinates": [ 73.168945, 33.687782 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "New Delhi" }, "geometry": { "type": "Point", "coordinates": [ 77.211914, 28.613459 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kathmandu", "POP2000": 644 }, "geometry": { "type": "Point", "coordinates": [ 85.297852, 27.722436 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Thimphu" }, "geometry": { "type": "Point", "coordinates": [ 89.648438, 27.488781 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kolkata", "POP2000": 13058 }, "geometry": { "type": "Point", "coordinates": [ 88.330078, 22.512557 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mumbai", "POP2000": 16086 }, "geometry": { "type": "Point", "coordinates": [ 72.861328, 19.020577 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bangalore", "POP2000": 5567 }, "geometry": { "type": "Point", "coordinates": [ 77.563477, 12.983148 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Male" }, "geometry": { "type": "Point", "coordinates": [ 73.520508, 4.171115 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Colombo" }, "geometry": { "type": "Point", "coordinates": [ 79.848633, 6.926427 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sri Jawewardenepura Kotte" }, "geometry": { "type": "Point", "coordinates": [ 79.936523, 6.882800 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ulaanbaatar", "POP2000": 763 }, "geometry": { "type": "Point", "coordinates": [ 106.918945, 47.931066 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dhaka", "POP2000": 10285 }, "geometry": { "type": "Point", "coordinates": [ 90.395508, 23.725012 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Chengdu", "POP2000": 3919 }, "geometry": { "type": "Point", "coordinates": [ 104.062500, 30.675715 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Naypyidaw" }, "geometry": { "type": "Point", "coordinates": [ 96.108398, 19.766704 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Rangoon", "POP2000": 3553 }, "geometry": { "type": "Point", "coordinates": [ 96.152344, 16.804541 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bangkok", "POP2000": 6332 }, "geometry": { "type": "Point", "coordinates": [ 100.502930, 13.752725 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vientiane" }, "geometry": { "type": "Point", "coordinates": [ 102.612305, 17.978733 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Hanoi", "POP2000": 3752 }, "geometry": { "type": "Point", "coordinates": [ 105.864258, 21.043491 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Phnom Penh", "POP2000": 1160 }, "geometry": { "type": "Point", "coordinates": [ 104.897461, 11.566144 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kuala Lumpur", "POP2000": 1306 }, "geometry": { "type": "Point", "coordinates": [ 101.689453, 3.162456 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Putrajaya" }, "geometry": { "type": "Point", "coordinates": [ 101.689453, 2.899153 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Singapore", "POP2000": 4017 }, "geometry": { "type": "Point", "coordinates": [ 103.842773, 1.274309 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Beijing", "POP2000": 9782 }, "geometry": { "type": "Point", "coordinates": [ 116.367188, 39.943436 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Hong Kong", "POP2000": 6662 }, "geometry": { "type": "Point", "coordinates": [ 114.169922, 22.309426 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Shanghai", "POP2000": 13243 }, "geometry": { "type": "Point", "coordinates": [ 121.420898, 31.203405 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Taipei", "POP2000": 2640 }, "geometry": { "type": "Point", "coordinates": [ 121.552734, 25.045792 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pyongyang", "POP2000": 3117 }, "geometry": { "type": "Point", "coordinates": [ 125.771484, 39.027719 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Seoul", "POP2000": 9917 }, "geometry": { "type": "Point", "coordinates": [ 127.001953, 37.579413 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Baguio City" }, "geometry": { "type": "Point", "coordinates": [ 120.585938, 16.425548 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Manila", "POP2000": 9958 }, "geometry": { "type": "Point", "coordinates": [ 120.981445, 14.604847 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bandar Seri Begawan" }, "geometry": { "type": "Point", "coordinates": [ 114.916992, 4.872048 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Melekeok" }, "geometry": { "type": "Point", "coordinates": [ 134.648438, 7.493196 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Osaka", "POP2000": 11165 }, "geometry": { "type": "Point", "coordinates": [ 135.439453, 34.741612 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kyoto", "POP2000": 1806 }, "geometry": { "type": "Point", "coordinates": [ 135.747070, 35.029996 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tokyo", "POP2000": 34450 }, "geometry": { "type": "Point", "coordinates": [ 139.746094, 35.675147 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Palikir" }, "geometry": { "type": "Point", "coordinates": [ 158.159180, 6.926427 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Majuro" }, "geometry": { "type": "Point", "coordinates": [ 171.386719, 7.100893 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tarawa" }, "geometry": { "type": "Point", "coordinates": [ 173.012695, 1.318243 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kigali", "POP2000": 497 }, "geometry": { "type": "Point", "coordinates": [ 30.058594, -1.933227 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bujumbura" }, "geometry": { "type": "Point", "coordinates": [ 29.355469, -3.381824 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nairobi", "POP2000": 2233 }, "geometry": { "type": "Point", "coordinates": [ 36.826172, -1.274309 ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
||||
{"type":"Feature","properties":{"what":"no id"},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
{"type":"Feature","id":12345,"properties":{"what":"will survive"},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
{"type":"Feature","id":12346,"properties":{"what":"will win over the duplicate"},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
@@ -0,0 +1,3 @@
|
||||
{"type":"Feature","properties":{"what":"no id again"},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
{"type":"Feature","id":12346,"properties":{"what":"will be lost as a duplicate"},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
{"type":"Feature","id":12347,"properties":{"what":"will be added"},"geometry":{"type":"Point","coordinates":[0,0]}}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 11, "x": 327, "y": 791 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "parsed", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "bin-ids": "236,237,510,514", "ZCTA5CE10": "94129", "GEOID10": "94129", "CLASSFP10": "B5", "MTFCC10": "G6350", "FUNCSTAT10": "S", "ALAND10": 5968455, "AWATER10": 14697, "INTPTLAT10": "+37.7973402", "INTPTLON10": "-122.4644664", "tippecanoe:count": 4 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.448120, 37.806936 ], [ -122.448120, 37.806393 ], [ -122.448463, 37.806122 ], [ -122.448292, 37.804766 ], [ -122.451553, 37.803409 ], [ -122.450180, 37.802867 ], [ -122.450008, 37.802460 ], [ -122.447605, 37.800697 ], [ -122.447262, 37.798527 ], [ -122.448120, 37.798255 ], [ -122.448292, 37.797848 ], [ -122.447948, 37.797441 ], [ -122.448635, 37.797441 ], [ -122.448635, 37.797034 ], [ -122.447948, 37.796899 ], [ -122.447948, 37.796492 ], [ -122.448978, 37.796356 ], [ -122.447433, 37.795814 ], [ -122.447433, 37.795542 ], [ -122.447777, 37.795407 ], [ -122.448635, 37.795542 ], [ -122.448978, 37.795000 ], [ -122.448635, 37.794728 ], [ -122.447948, 37.793101 ], [ -122.448463, 37.792829 ], [ -122.448635, 37.791880 ], [ -122.458334, 37.789879 ], [ -122.454300, 37.806495 ], [ -122.452412, 37.806258 ], [ -122.448120, 37.806936 ] ], [ [ -122.452583, 37.803274 ], [ -122.452412, 37.803138 ], [ -122.450008, 37.802460 ], [ -122.451210, 37.803138 ], [ -122.452583, 37.803274 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "bin-ids": "529,531", "ZCTA5CE10": "94123", "GEOID10": "94123", "CLASSFP10": "B5", "MTFCC10": "G6350", "FUNCSTAT10": "S", "ALAND10": 2646572, "AWATER10": 218721, "INTPTLAT10": "+37.8009336", "INTPTLON10": "-122.4383664", "tippecanoe:count": 2 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.447004, 37.808936 ], [ -122.428250, 37.796051 ], [ -122.433529, 37.795407 ], [ -122.433357, 37.794457 ], [ -122.434902, 37.794322 ], [ -122.435074, 37.795271 ], [ -122.436790, 37.795000 ], [ -122.436619, 37.794050 ], [ -122.440739, 37.793508 ], [ -122.440910, 37.794457 ], [ -122.441769, 37.794322 ], [ -122.441597, 37.793372 ], [ -122.446404, 37.792829 ], [ -122.446232, 37.791880 ], [ -122.447605, 37.791744 ], [ -122.448635, 37.794728 ], [ -122.448978, 37.795000 ], [ -122.448635, 37.795542 ], [ -122.447777, 37.795407 ], [ -122.447433, 37.795542 ], [ -122.447433, 37.795814 ], [ -122.448978, 37.796356 ], [ -122.447948, 37.796492 ], [ -122.447948, 37.796899 ], [ -122.448635, 37.797034 ], [ -122.448635, 37.797441 ], [ -122.447948, 37.797441 ], [ -122.448292, 37.797848 ], [ -122.448120, 37.798255 ], [ -122.447262, 37.798527 ], [ -122.447605, 37.800697 ], [ -122.450008, 37.802460 ], [ -122.450180, 37.802867 ], [ -122.451553, 37.803409 ], [ -122.448292, 37.804766 ], [ -122.448463, 37.806122 ], [ -122.448120, 37.806393 ], [ -122.448120, 37.806936 ], [ -122.448635, 37.808563 ], [ -122.447004, 37.808936 ] ] ], [ [ [ -122.452583, 37.803274 ], [ -122.451210, 37.803138 ], [ -122.450008, 37.802460 ], [ -122.452583, 37.803274 ] ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1,7 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 11, "x": 327, "y": 791 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "parsed", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "ZCTA5CE10": "94129", "tippecanoe:count": 4 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.477818, 37.811005 ], [ -122.476444, 37.810869 ], [ -122.476101, 37.809648 ], [ -122.474728, 37.809241 ], [ -122.472668, 37.808970 ], [ -122.470608, 37.808563 ], [ -122.469234, 37.807750 ], [ -122.468719, 37.807071 ], [ -122.468376, 37.806800 ], [ -122.468204, 37.806936 ], [ -122.468204, 37.806665 ], [ -122.466660, 37.805851 ], [ -122.463570, 37.804901 ], [ -122.461681, 37.804901 ], [ -122.458420, 37.805444 ], [ -122.454472, 37.806529 ], [ -122.452412, 37.806258 ], [ -122.448120, 37.806936 ], [ -122.448120, 37.806393 ], [ -122.448463, 37.806122 ], [ -122.448292, 37.804766 ], [ -122.451553, 37.803409 ], [ -122.450180, 37.802867 ], [ -122.450008, 37.802460 ], [ -122.447605, 37.800697 ], [ -122.447262, 37.798527 ], [ -122.448120, 37.798255 ], [ -122.448292, 37.797848 ], [ -122.447948, 37.797441 ], [ -122.448635, 37.797441 ], [ -122.448635, 37.797034 ], [ -122.447948, 37.796899 ], [ -122.447948, 37.796492 ], [ -122.448978, 37.796356 ], [ -122.447433, 37.795814 ], [ -122.447433, 37.795542 ], [ -122.447777, 37.795407 ], [ -122.448635, 37.795542 ], [ -122.448978, 37.795000 ], [ -122.448635, 37.794728 ], [ -122.447948, 37.793101 ], [ -122.448463, 37.792829 ], [ -122.448635, 37.791880 ], [ -122.470951, 37.787267 ], [ -122.473354, 37.787132 ], [ -122.475586, 37.786725 ], [ -122.479877, 37.786860 ], [ -122.483826, 37.787674 ], [ -122.484512, 37.789167 ], [ -122.483997, 37.789709 ], [ -122.484341, 37.790116 ], [ -122.484341, 37.789709 ], [ -122.485027, 37.789574 ], [ -122.485886, 37.790795 ], [ -122.483654, 37.794050 ], [ -122.482109, 37.798527 ], [ -122.481766, 37.798527 ], [ -122.481937, 37.798798 ], [ -122.481594, 37.798798 ], [ -122.481766, 37.798933 ], [ -122.480221, 37.801375 ], [ -122.479877, 37.802867 ], [ -122.478676, 37.805444 ], [ -122.478333, 37.808156 ], [ -122.477818, 37.808428 ], [ -122.477989, 37.810598 ], [ -122.477646, 37.810598 ], [ -122.477818, 37.811005 ] ], [ [ -122.452583, 37.803274 ], [ -122.452412, 37.803138 ], [ -122.450008, 37.802460 ], [ -122.451210, 37.803138 ], [ -122.452583, 37.803274 ] ] ], [ [ [ -122.466145, 37.806393 ], [ -122.465973, 37.806258 ], [ -122.466660, 37.805851 ], [ -122.466145, 37.806393 ] ] ], [ [ [ -122.469921, 37.809377 ], [ -122.469406, 37.809106 ], [ -122.470093, 37.809241 ], [ -122.469921, 37.809377 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "ZCTA5CE10": "94123", "tippecanoe:count": 2 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -122.443142, 37.809784 ], [ -122.439537, 37.808835 ], [ -122.440910, 37.806936 ], [ -122.435760, 37.807614 ], [ -122.435589, 37.807207 ], [ -122.435589, 37.806936 ], [ -122.433014, 37.807343 ], [ -122.433014, 37.807071 ], [ -122.434387, 37.806936 ], [ -122.434044, 37.806800 ], [ -122.433014, 37.806936 ], [ -122.432842, 37.806800 ], [ -122.434044, 37.806665 ], [ -122.434044, 37.806393 ], [ -122.433872, 37.806122 ], [ -122.433872, 37.805851 ], [ -122.433701, 37.805580 ], [ -122.432671, 37.805715 ], [ -122.432327, 37.805986 ], [ -122.431641, 37.803274 ], [ -122.425289, 37.804088 ], [ -122.424946, 37.803138 ], [ -122.426491, 37.803003 ], [ -122.426319, 37.802053 ], [ -122.424774, 37.802324 ], [ -122.424603, 37.801239 ], [ -122.426147, 37.801104 ], [ -122.425976, 37.800154 ], [ -122.424431, 37.800426 ], [ -122.423744, 37.796628 ], [ -122.433529, 37.795407 ], [ -122.433357, 37.794457 ], [ -122.434902, 37.794322 ], [ -122.435074, 37.795271 ], [ -122.436790, 37.795000 ], [ -122.436619, 37.794050 ], [ -122.440739, 37.793508 ], [ -122.440910, 37.794457 ], [ -122.441769, 37.794322 ], [ -122.441597, 37.793372 ], [ -122.446404, 37.792829 ], [ -122.446232, 37.791880 ], [ -122.447605, 37.791744 ], [ -122.448635, 37.794728 ], [ -122.448978, 37.795000 ], [ -122.448635, 37.795542 ], [ -122.447777, 37.795407 ], [ -122.447433, 37.795542 ], [ -122.447433, 37.795814 ], [ -122.448978, 37.796356 ], [ -122.447948, 37.796492 ], [ -122.447948, 37.796899 ], [ -122.448635, 37.797034 ], [ -122.448635, 37.797441 ], [ -122.447948, 37.797441 ], [ -122.448292, 37.797848 ], [ -122.448120, 37.798255 ], [ -122.447262, 37.798527 ], [ -122.447605, 37.800697 ], [ -122.450008, 37.802460 ], [ -122.450180, 37.802867 ], [ -122.451553, 37.803409 ], [ -122.448292, 37.804766 ], [ -122.448463, 37.806122 ], [ -122.448120, 37.806393 ], [ -122.448120, 37.806936 ], [ -122.448635, 37.808563 ], [ -122.443142, 37.809784 ] ] ], [ [ [ -122.432842, 37.805986 ], [ -122.432842, 37.805851 ], [ -122.433872, 37.805851 ], [ -122.432842, 37.805986 ] ] ], [ [ [ -122.433529, 37.807614 ], [ -122.433529, 37.807478 ], [ -122.435589, 37.807207 ], [ -122.433529, 37.807614 ] ] ], [ [ [ -122.452583, 37.803274 ], [ -122.451210, 37.803138 ], [ -122.450008, 37.802460 ], [ -122.452583, 37.803274 ] ] ], [ [ [ -122.432842, 37.806393 ], [ -122.432842, 37.806122 ], [ -122.433872, 37.806122 ], [ -122.432842, 37.806393 ] ] ], [ [ [ -122.432842, 37.806665 ], [ -122.432842, 37.806529 ], [ -122.434044, 37.806393 ], [ -122.432842, 37.806665 ] ] ], [ [ [ -122.433701, 37.808156 ], [ -122.433701, 37.807885 ], [ -122.433872, 37.807885 ], [ -122.433701, 37.808156 ] ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1 @@
|
||||
{"coordinates":[[[-122.4527379,37.8128815],[-122.4598853,37.7834743],[-122.4280914,37.7959397],[-122.4527379,37.8128815]]],"type":"Polygon"}
|
||||
@@ -0,0 +1,73 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 12.392578, 50.007739 ], [ 12.392578, 49.951220 ], [ 12.480469, 49.553726 ], [ 13.007812, 49.325122 ], [ 13.623047, 48.864715 ], [ 13.271484, 48.400032 ], [ 12.919922, 48.283193 ], [ 13.007812, 47.635784 ], [ 12.919922, 47.457809 ], [ 12.656250, 47.694974 ], [ 12.128906, 47.694974 ], [ 11.425781, 47.517201 ], [ 10.546875, 47.576526 ], [ 10.371094, 47.279229 ], [ 9.931641, 47.576526 ], [ 9.580078, 47.517201 ], [ 8.525391, 47.813155 ], [ 8.349609, 47.635784 ], [ 7.470703, 47.635784 ], [ 7.558594, 48.341646 ], [ 8.085938, 49.037868 ], [ 6.679688, 49.210420 ], [ 6.152344, 49.439557 ], [ 6.240234, 49.894634 ], [ 6.152344, 50.007739 ], [ 12.392578, 50.007739 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 5.800781, 50.007739 ], [ 5.712891, 49.553726 ], [ 5.009766, 49.894634 ], [ 5.009766, 50.007739 ], [ 5.800781, 50.007739 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 6.152344, 50.007739 ], [ 6.240234, 49.894634 ], [ 6.152344, 49.439557 ], [ 5.888672, 49.439557 ], [ 5.712891, 49.553726 ], [ 5.800781, 50.007739 ], [ 6.152344, 50.007739 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 9.404297, 43.004647 ], [ 9.580078, 42.163403 ], [ 9.228516, 41.376809 ], [ 8.789062, 41.574361 ], [ 8.525391, 42.228517 ], [ 8.789062, 42.617791 ], [ 9.404297, 43.004647 ] ] ], [ [ [ 5.009766, 49.894634 ], [ 5.712891, 49.553726 ], [ 5.888672, 49.439557 ], [ 6.152344, 49.439557 ], [ 6.679688, 49.210420 ], [ 8.085938, 49.037868 ], [ 7.558594, 48.341646 ], [ 7.470703, 47.635784 ], [ 7.207031, 47.457809 ], [ 6.767578, 47.517201 ], [ 6.767578, 47.279229 ], [ 6.064453, 46.739861 ], [ 6.064453, 46.255847 ], [ 6.503906, 46.437857 ], [ 6.855469, 46.012224 ], [ 6.767578, 45.706179 ], [ 7.119141, 45.336702 ], [ 6.767578, 45.026950 ], [ 7.031250, 44.276671 ], [ 7.558594, 44.150681 ], [ 7.470703, 43.707594 ], [ 6.503906, 43.133061 ], [ 5.009766, 43.325178 ], [ 5.009766, 49.894634 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 8.525391, 47.813155 ], [ 9.580078, 47.517201 ], [ 9.667969, 47.338823 ], [ 9.492188, 47.100045 ], [ 9.931641, 46.920255 ], [ 10.458984, 46.920255 ], [ 10.371094, 46.498392 ], [ 9.931641, 46.316584 ], [ 9.140625, 46.437857 ], [ 8.964844, 46.012224 ], [ 8.525391, 46.012224 ], [ 8.349609, 46.134170 ], [ 7.734375, 45.828799 ], [ 7.294922, 45.767523 ], [ 6.855469, 46.012224 ], [ 6.503906, 46.437857 ], [ 6.064453, 46.255847 ], [ 6.064453, 46.739861 ], [ 6.767578, 47.279229 ], [ 6.767578, 47.517201 ], [ 7.207031, 47.457809 ], [ 7.470703, 47.635784 ], [ 8.349609, 47.635784 ], [ 8.525391, 47.813155 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 23.115234, 50.007739 ], [ 22.500000, 49.496675 ], [ 22.763672, 49.037868 ], [ 22.587891, 49.095452 ], [ 21.621094, 49.496675 ], [ 20.917969, 49.325122 ], [ 20.390625, 49.439557 ], [ 19.863281, 49.210420 ], [ 19.335938, 49.553726 ], [ 18.896484, 49.439557 ], [ 18.896484, 49.496675 ], [ 18.369141, 50.007739 ], [ 23.115234, 50.007739 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 15.292969, 49.037868 ], [ 15.996094, 48.748945 ], [ 16.523438, 48.806863 ], [ 16.962891, 48.574790 ], [ 16.875000, 48.458352 ], [ 16.962891, 48.107431 ], [ 16.875000, 47.694974 ], [ 16.347656, 47.694974 ], [ 16.523438, 47.517201 ], [ 16.171875, 46.860191 ], [ 15.996094, 46.679594 ], [ 15.117188, 46.679594 ], [ 14.589844, 46.437857 ], [ 13.798828, 46.498392 ], [ 12.392578, 46.739861 ], [ 12.128906, 47.100045 ], [ 11.162109, 46.920255 ], [ 11.074219, 46.739861 ], [ 10.458984, 46.920255 ], [ 9.931641, 46.920255 ], [ 9.492188, 47.100045 ], [ 9.667969, 47.338823 ], [ 9.580078, 47.517201 ], [ 9.931641, 47.576526 ], [ 10.371094, 47.279229 ], [ 10.546875, 47.576526 ], [ 11.425781, 47.517201 ], [ 12.128906, 47.694974 ], [ 12.656250, 47.694974 ], [ 12.919922, 47.457809 ], [ 13.007812, 47.635784 ], [ 12.919922, 48.283193 ], [ 13.271484, 48.400032 ], [ 13.623047, 48.864715 ], [ 14.326172, 48.574790 ], [ 14.941406, 48.980217 ], [ 15.292969, 49.037868 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.369141, 50.007739 ], [ 18.896484, 49.496675 ], [ 18.544922, 49.496675 ], [ 18.369141, 49.325122 ], [ 18.193359, 49.267805 ], [ 18.105469, 49.037868 ], [ 17.929688, 48.980217 ], [ 17.929688, 48.922499 ], [ 17.578125, 48.806863 ], [ 17.138672, 48.806863 ], [ 16.962891, 48.574790 ], [ 16.523438, 48.806863 ], [ 15.996094, 48.748945 ], [ 15.292969, 49.037868 ], [ 14.941406, 48.980217 ], [ 14.326172, 48.574790 ], [ 13.623047, 48.864715 ], [ 13.007812, 49.325122 ], [ 12.480469, 49.553726 ], [ 12.392578, 49.951220 ], [ 12.392578, 50.007739 ], [ 18.369141, 50.007739 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 16.347656, 46.860191 ], [ 16.523438, 46.498392 ], [ 15.732422, 46.255847 ], [ 15.644531, 45.828799 ], [ 15.292969, 45.706179 ], [ 15.292969, 45.460131 ], [ 14.941406, 45.460131 ], [ 14.589844, 45.644768 ], [ 14.414062, 45.460131 ], [ 13.710938, 45.521744 ], [ 13.974609, 45.583290 ], [ 13.710938, 46.012224 ], [ 13.798828, 46.498392 ], [ 14.589844, 46.437857 ], [ 15.117188, 46.679594 ], [ 15.996094, 46.679594 ], [ 16.171875, 46.860191 ], [ 16.347656, 46.860191 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.335938, 49.553726 ], [ 19.863281, 49.210420 ], [ 20.390625, 49.439557 ], [ 20.917969, 49.325122 ], [ 21.621094, 49.496675 ], [ 22.587891, 49.095452 ], [ 22.324219, 48.806863 ], [ 22.060547, 48.400032 ], [ 21.884766, 48.341646 ], [ 20.830078, 48.632909 ], [ 20.478516, 48.574790 ], [ 20.214844, 48.341646 ], [ 19.775391, 48.224673 ], [ 19.687500, 48.283193 ], [ 19.160156, 48.107431 ], [ 18.808594, 48.107431 ], [ 18.720703, 47.872144 ], [ 17.841797, 47.754098 ], [ 17.490234, 47.872144 ], [ 16.962891, 48.107431 ], [ 16.875000, 48.458352 ], [ 17.138672, 48.806863 ], [ 17.578125, 48.806863 ], [ 17.929688, 48.922499 ], [ 17.929688, 48.980217 ], [ 18.105469, 49.037868 ], [ 18.193359, 49.267805 ], [ 18.369141, 49.325122 ], [ 18.544922, 49.496675 ], [ 18.896484, 49.496675 ], [ 18.896484, 49.439557 ], [ 19.335938, 49.553726 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 16.523438, 46.498392 ], [ 16.875000, 46.377254 ], [ 17.666016, 45.951150 ], [ 18.457031, 45.767523 ], [ 18.808594, 45.890008 ], [ 19.072266, 45.521744 ], [ 19.423828, 45.213004 ], [ 18.984375, 44.840291 ], [ 18.544922, 45.089036 ], [ 17.841797, 45.089036 ], [ 16.962891, 45.213004 ], [ 16.523438, 45.213004 ], [ 16.347656, 45.026950 ], [ 15.996094, 45.213004 ], [ 15.732422, 44.840291 ], [ 16.259766, 44.339565 ], [ 16.435547, 44.024422 ], [ 16.875000, 43.644026 ], [ 17.314453, 43.452919 ], [ 17.666016, 43.004647 ], [ 18.544922, 42.617791 ], [ 18.457031, 42.488302 ], [ 17.490234, 42.875964 ], [ 16.962891, 43.197167 ], [ 15.996094, 43.516689 ], [ 15.205078, 44.213710 ], [ 15.380859, 44.339565 ], [ 14.941406, 44.715514 ], [ 14.941406, 45.089036 ], [ 14.238281, 45.213004 ], [ 13.974609, 44.777936 ], [ 13.623047, 45.151053 ], [ 13.710938, 45.460131 ], [ 13.710938, 45.521744 ], [ 14.414062, 45.460131 ], [ 14.589844, 45.644768 ], [ 14.941406, 45.460131 ], [ 15.292969, 45.460131 ], [ 15.292969, 45.706179 ], [ 15.644531, 45.828799 ], [ 15.732422, 46.255847 ], [ 16.523438, 46.498392 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 16.962891, 45.213004 ], [ 17.841797, 45.089036 ], [ 18.544922, 45.089036 ], [ 18.984375, 44.840291 ], [ 19.335938, 44.840291 ], [ 19.160156, 44.402392 ], [ 19.599609, 44.024422 ], [ 19.423828, 43.580391 ], [ 19.072266, 43.452919 ], [ 18.720703, 43.197167 ], [ 18.544922, 42.617791 ], [ 17.666016, 43.004647 ], [ 17.314453, 43.452919 ], [ 16.875000, 43.644026 ], [ 16.435547, 44.024422 ], [ 16.259766, 44.339565 ], [ 15.732422, 44.840291 ], [ 15.996094, 45.213004 ], [ 16.347656, 45.026950 ], [ 16.523438, 45.213004 ], [ 16.962891, 45.213004 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.248047, 43.516689 ], [ 19.511719, 43.325178 ], [ 19.599609, 43.197167 ], [ 19.951172, 43.133061 ], [ 20.302734, 42.875964 ], [ 20.214844, 42.811522 ], [ 20.039062, 42.617791 ], [ 19.775391, 42.488302 ], [ 19.775391, 42.682435 ], [ 19.335938, 42.163403 ], [ 19.335938, 41.902277 ], [ 19.160156, 41.967659 ], [ 18.896484, 42.293564 ], [ 18.457031, 42.488302 ], [ 18.544922, 42.617791 ], [ 18.720703, 43.197167 ], [ 19.072266, 43.452919 ], [ 19.248047, 43.516689 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 20.830078, 43.261206 ], [ 20.917969, 43.133061 ], [ 21.181641, 43.068888 ], [ 21.269531, 42.940339 ], [ 21.445312, 42.875964 ], [ 21.621094, 42.682435 ], [ 21.796875, 42.682435 ], [ 21.533203, 42.293564 ], [ 21.533203, 42.228517 ], [ 21.357422, 42.228517 ], [ 20.742188, 42.032974 ], [ 20.742188, 41.836828 ], [ 20.566406, 41.836828 ], [ 20.566406, 42.228517 ], [ 20.302734, 42.293564 ], [ 20.039062, 42.617791 ], [ 20.214844, 42.811522 ], [ 20.478516, 42.875964 ], [ 20.654297, 43.197167 ], [ 20.830078, 43.261206 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.775391, 42.682435 ], [ 19.775391, 42.488302 ], [ 20.039062, 42.617791 ], [ 20.302734, 42.293564 ], [ 20.566406, 42.228517 ], [ 20.566406, 41.836828 ], [ 20.478516, 41.508577 ], [ 20.566406, 41.112469 ], [ 21.005859, 40.847060 ], [ 21.005859, 40.580585 ], [ 20.654297, 40.446947 ], [ 20.654297, 40.111689 ], [ 20.126953, 39.639538 ], [ 19.951172, 39.707187 ], [ 19.951172, 39.909736 ], [ 19.423828, 40.245992 ], [ 19.335938, 40.713956 ], [ 19.423828, 41.376809 ], [ 19.511719, 41.705729 ], [ 19.335938, 41.902277 ], [ 19.335938, 42.163403 ], [ 19.775391, 42.682435 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 20.302734, 42.875964 ], [ 19.951172, 43.133061 ], [ 19.599609, 43.197167 ], [ 19.511719, 43.325178 ], [ 19.248047, 43.516689 ], [ 19.423828, 43.580391 ], [ 19.599609, 44.024422 ], [ 19.160156, 44.402392 ], [ 19.335938, 44.840291 ], [ 18.984375, 44.840291 ], [ 19.423828, 45.213004 ], [ 19.072266, 45.521744 ], [ 18.808594, 45.890008 ], [ 19.599609, 46.195042 ], [ 20.214844, 46.134170 ], [ 20.742188, 45.706179 ], [ 20.917969, 45.398450 ], [ 21.445312, 45.151053 ], [ 21.533203, 44.777936 ], [ 22.148438, 44.465151 ], [ 22.500000, 44.715514 ], [ 22.675781, 44.590467 ], [ 22.500000, 44.402392 ], [ 22.675781, 44.213710 ], [ 22.412109, 44.024422 ], [ 22.500000, 43.644026 ], [ 23.027344, 43.197167 ], [ 22.587891, 42.875964 ], [ 22.412109, 42.553080 ], [ 22.587891, 42.488302 ], [ 22.412109, 42.293564 ], [ 21.884766, 42.293564 ], [ 21.533203, 42.228517 ], [ 21.533203, 42.293564 ], [ 21.796875, 42.682435 ], [ 21.621094, 42.682435 ], [ 21.445312, 42.875964 ], [ 21.269531, 42.940339 ], [ 21.181641, 43.068888 ], [ 20.917969, 43.133061 ], [ 20.830078, 43.261206 ], [ 20.654297, 43.197167 ], [ 20.478516, 42.875964 ], [ 20.302734, 42.875964 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 25.664062, 50.007739 ], [ 25.664062, 47.931066 ], [ 25.224609, 47.872144 ], [ 24.873047, 47.754098 ], [ 24.433594, 47.989922 ], [ 23.730469, 47.989922 ], [ 23.115234, 48.107431 ], [ 22.675781, 47.872144 ], [ 22.675781, 48.166085 ], [ 22.060547, 48.400032 ], [ 22.324219, 48.806863 ], [ 22.587891, 49.095452 ], [ 22.763672, 49.037868 ], [ 22.500000, 49.496675 ], [ 23.115234, 50.007739 ], [ 25.664062, 50.007739 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 20.830078, 48.632909 ], [ 21.884766, 48.341646 ], [ 22.060547, 48.400032 ], [ 22.675781, 48.166085 ], [ 22.675781, 47.872144 ], [ 22.060547, 47.694974 ], [ 21.621094, 46.980252 ], [ 21.005859, 46.316584 ], [ 20.214844, 46.134170 ], [ 19.599609, 46.195042 ], [ 18.808594, 45.890008 ], [ 18.457031, 45.767523 ], [ 17.666016, 45.951150 ], [ 16.875000, 46.377254 ], [ 16.523438, 46.498392 ], [ 16.347656, 46.860191 ], [ 16.171875, 46.860191 ], [ 16.523438, 47.517201 ], [ 16.347656, 47.694974 ], [ 16.875000, 47.694974 ], [ 16.962891, 48.107431 ], [ 17.490234, 47.872144 ], [ 17.841797, 47.754098 ], [ 18.720703, 47.872144 ], [ 18.808594, 48.107431 ], [ 19.160156, 48.107431 ], [ 19.687500, 48.283193 ], [ 19.775391, 48.224673 ], [ 20.214844, 48.341646 ], [ 20.478516, 48.574790 ], [ 20.830078, 48.632909 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 23.730469, 35.675147 ], [ 24.257812, 35.389050 ], [ 25.048828, 35.460670 ], [ 25.664062, 35.389050 ], [ 25.664062, 34.957995 ], [ 24.697266, 34.885931 ], [ 24.697266, 35.101934 ], [ 23.554688, 35.245619 ], [ 23.730469, 35.675147 ] ] ], [ [ [ 24.521484, 41.574361 ], [ 25.224609, 41.244772 ], [ 25.664062, 41.310824 ], [ 25.664062, 40.847060 ], [ 25.488281, 40.847060 ], [ 24.960938, 40.979898 ], [ 23.730469, 40.713956 ], [ 24.433594, 40.111689 ], [ 23.906250, 39.977120 ], [ 23.378906, 39.977120 ], [ 22.851562, 40.446947 ], [ 22.587891, 40.245992 ], [ 22.851562, 39.639538 ], [ 23.378906, 39.164141 ], [ 22.939453, 38.959409 ], [ 23.554688, 38.479395 ], [ 23.994141, 38.203655 ], [ 24.082031, 37.649034 ], [ 23.115234, 37.926868 ], [ 23.378906, 37.439974 ], [ 22.763672, 37.300275 ], [ 23.115234, 36.456636 ], [ 22.500000, 36.385913 ], [ 21.708984, 36.879621 ], [ 21.269531, 37.649034 ], [ 21.093750, 38.341656 ], [ 20.214844, 39.368279 ], [ 20.126953, 39.639538 ], [ 20.654297, 40.111689 ], [ 20.654297, 40.446947 ], [ 21.005859, 40.580585 ], [ 21.005859, 40.847060 ], [ 21.708984, 40.913513 ], [ 22.060547, 41.178654 ], [ 22.587891, 41.112469 ], [ 22.763672, 41.310824 ], [ 23.730469, 41.310824 ], [ 24.521484, 41.574361 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 22.675781, 44.213710 ], [ 22.939453, 43.834527 ], [ 23.291016, 43.897892 ], [ 24.082031, 43.771094 ], [ 25.576172, 43.707594 ], [ 25.664062, 43.771094 ], [ 25.664062, 41.310824 ], [ 25.224609, 41.244772 ], [ 24.521484, 41.574361 ], [ 23.730469, 41.310824 ], [ 22.939453, 41.310824 ], [ 22.851562, 41.967659 ], [ 22.412109, 42.293564 ], [ 22.587891, 42.488302 ], [ 22.412109, 42.553080 ], [ 22.587891, 42.875964 ], [ 23.027344, 43.197167 ], [ 22.500000, 43.644026 ], [ 22.412109, 44.024422 ], [ 22.675781, 44.213710 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 23.115234, 48.107431 ], [ 23.730469, 47.989922 ], [ 24.433594, 47.989922 ], [ 24.873047, 47.754098 ], [ 25.224609, 47.872144 ], [ 25.664062, 47.931066 ], [ 25.664062, 43.771094 ], [ 25.576172, 43.707594 ], [ 24.082031, 43.771094 ], [ 23.291016, 43.897892 ], [ 22.939453, 43.834527 ], [ 22.675781, 44.213710 ], [ 22.500000, 44.402392 ], [ 22.675781, 44.590467 ], [ 22.500000, 44.715514 ], [ 22.148438, 44.465151 ], [ 21.533203, 44.777936 ], [ 21.445312, 45.151053 ], [ 20.917969, 45.398450 ], [ 20.742188, 45.706179 ], [ 20.214844, 46.134170 ], [ 21.005859, 46.316584 ], [ 21.621094, 46.980252 ], [ 22.060547, 47.694974 ], [ 22.675781, 47.872144 ], [ 23.115234, 48.107431 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 9.492188, 37.370157 ], [ 10.195312, 37.230328 ], [ 10.195312, 36.738884 ], [ 10.986328, 37.090240 ], [ 11.074219, 36.879621 ], [ 10.634766, 36.385913 ], [ 10.634766, 35.960223 ], [ 10.898438, 35.675147 ], [ 10.810547, 34.813803 ], [ 10.107422, 34.307144 ], [ 10.371094, 33.797409 ], [ 10.898438, 33.797409 ], [ 11.074219, 33.284620 ], [ 11.513672, 33.137551 ], [ 11.425781, 32.398516 ], [ 10.986328, 32.101190 ], [ 10.634766, 31.728167 ], [ 9.931641, 31.353637 ], [ 10.019531, 30.977609 ], [ 9.931641, 30.524413 ], [ 9.492188, 30.297018 ], [ 9.052734, 32.101190 ], [ 8.437500, 32.472695 ], [ 8.437500, 32.768800 ], [ 7.646484, 33.358062 ], [ 7.558594, 34.089061 ], [ 8.173828, 34.669359 ], [ 8.349609, 35.460670 ], [ 8.261719, 36.456636 ], [ 8.437500, 36.949892 ], [ 9.492188, 37.370157 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 7.294922, 37.090240 ], [ 7.734375, 36.879621 ], [ 8.437500, 36.949892 ], [ 8.261719, 36.456636 ], [ 8.349609, 35.460670 ], [ 8.173828, 34.669359 ], [ 7.558594, 34.089061 ], [ 7.646484, 33.358062 ], [ 8.437500, 32.768800 ], [ 8.437500, 32.472695 ], [ 9.052734, 32.101190 ], [ 9.492188, 30.297018 ], [ 9.843750, 29.458731 ], [ 9.843750, 28.921631 ], [ 9.667969, 28.149503 ], [ 9.755859, 27.683528 ], [ 9.667969, 27.137368 ], [ 9.755859, 26.509905 ], [ 9.316406, 26.115986 ], [ 9.931641, 25.403585 ], [ 9.931641, 24.926295 ], [ 10.283203, 24.367114 ], [ 10.810547, 24.527135 ], [ 11.601562, 24.126702 ], [ 12.041016, 23.483401 ], [ 8.613281, 21.534847 ], [ 5.712891, 19.642588 ], [ 5.009766, 19.394068 ], [ 5.009766, 36.809285 ], [ 5.361328, 36.738884 ], [ 6.240234, 37.090240 ], [ 7.294922, 37.090240 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 15.556641, 38.203655 ], [ 15.117188, 37.439974 ], [ 15.292969, 37.160317 ], [ 15.117188, 36.597889 ], [ 14.326172, 37.020098 ], [ 13.798828, 37.090240 ], [ 12.392578, 37.579413 ], [ 12.568359, 38.134557 ], [ 13.710938, 38.065392 ], [ 14.765625, 38.134557 ], [ 15.556641, 38.203655 ] ] ], [ [ [ 12.128906, 47.100045 ], [ 12.392578, 46.739861 ], [ 13.798828, 46.498392 ], [ 13.710938, 46.012224 ], [ 13.974609, 45.583290 ], [ 13.183594, 45.706179 ], [ 12.304688, 45.398450 ], [ 12.392578, 44.902578 ], [ 12.304688, 44.590467 ], [ 12.568359, 44.087585 ], [ 13.535156, 43.580391 ], [ 14.062500, 42.747012 ], [ 15.117188, 41.967659 ], [ 15.908203, 41.967659 ], [ 16.171875, 41.771312 ], [ 15.908203, 41.508577 ], [ 16.787109, 41.178654 ], [ 17.490234, 40.847060 ], [ 18.369141, 40.380028 ], [ 18.457031, 40.178873 ], [ 18.281250, 39.842286 ], [ 17.753906, 40.245992 ], [ 16.875000, 40.446947 ], [ 16.435547, 39.774769 ], [ 17.138672, 39.436193 ], [ 17.050781, 38.891033 ], [ 16.611328, 38.822591 ], [ 16.083984, 37.996163 ], [ 15.644531, 37.926868 ], [ 15.644531, 38.203655 ], [ 15.908203, 38.754083 ], [ 16.083984, 38.959409 ], [ 15.732422, 39.571822 ], [ 15.380859, 40.044438 ], [ 15.029297, 40.178873 ], [ 14.677734, 40.580585 ], [ 14.062500, 40.780541 ], [ 13.623047, 41.178654 ], [ 12.919922, 41.244772 ], [ 12.128906, 41.705729 ], [ 11.162109, 42.358544 ], [ 10.546875, 42.940339 ], [ 10.195312, 43.897892 ], [ 9.667969, 44.024422 ], [ 8.876953, 44.339565 ], [ 8.437500, 44.213710 ], [ 7.822266, 43.771094 ], [ 7.470703, 43.707594 ], [ 7.558594, 44.150681 ], [ 7.031250, 44.276671 ], [ 6.767578, 45.026950 ], [ 7.119141, 45.336702 ], [ 6.767578, 45.706179 ], [ 6.855469, 46.012224 ], [ 7.294922, 45.767523 ], [ 7.734375, 45.828799 ], [ 8.349609, 46.134170 ], [ 8.525391, 46.012224 ], [ 8.964844, 46.012224 ], [ 9.140625, 46.437857 ], [ 9.931641, 46.316584 ], [ 10.371094, 46.498392 ], [ 10.458984, 46.920255 ], [ 11.074219, 46.739861 ], [ 11.162109, 46.920255 ], [ 12.128906, 47.100045 ] ] ], [ [ [ 9.228516, 41.178654 ], [ 9.843750, 40.513799 ], [ 9.667969, 39.164141 ], [ 9.228516, 39.232253 ], [ 8.789062, 38.891033 ], [ 8.437500, 39.164141 ], [ 8.349609, 40.380028 ], [ 8.173828, 40.979898 ], [ 8.701172, 40.913513 ], [ 9.228516, 41.178654 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 22.412109, 42.293564 ], [ 22.851562, 41.967659 ], [ 22.939453, 41.310824 ], [ 22.763672, 41.310824 ], [ 22.587891, 41.112469 ], [ 22.060547, 41.178654 ], [ 21.708984, 40.913513 ], [ 21.005859, 40.847060 ], [ 20.566406, 41.112469 ], [ 20.478516, 41.508577 ], [ 20.566406, 41.836828 ], [ 20.742188, 41.836828 ], [ 20.742188, 42.032974 ], [ 21.357422, 42.228517 ], [ 21.533203, 42.228517 ], [ 21.884766, 42.293564 ], [ 22.412109, 42.293564 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 11.513672, 33.137551 ], [ 12.656250, 32.768800 ], [ 13.095703, 32.842674 ], [ 13.886719, 32.694866 ], [ 15.205078, 32.249974 ], [ 15.732422, 31.353637 ], [ 16.611328, 31.203405 ], [ 18.017578, 30.751278 ], [ 19.072266, 30.297018 ], [ 19.599609, 30.524413 ], [ 20.039062, 30.977609 ], [ 19.863281, 31.728167 ], [ 20.126953, 32.249974 ], [ 20.830078, 32.694866 ], [ 21.533203, 32.842674 ], [ 22.939453, 32.620870 ], [ 23.203125, 32.175612 ], [ 23.642578, 32.175612 ], [ 23.906250, 32.026706 ], [ 24.960938, 31.877558 ], [ 25.136719, 31.578535 ], [ 24.785156, 31.052934 ], [ 24.960938, 30.675715 ], [ 24.697266, 30.069094 ], [ 24.960938, 29.228890 ], [ 24.960938, 19.973349 ], [ 23.818359, 19.973349 ], [ 23.818359, 19.559790 ], [ 19.863281, 21.534847 ], [ 15.820312, 23.402765 ], [ 14.853516, 22.836946 ], [ 14.150391, 22.512557 ], [ 13.623047, 23.079732 ], [ 12.041016, 23.483401 ], [ 11.601562, 24.126702 ], [ 10.810547, 24.527135 ], [ 10.283203, 24.367114 ], [ 9.931641, 24.926295 ], [ 9.931641, 25.403585 ], [ 9.316406, 26.115986 ], [ 9.755859, 26.509905 ], [ 9.667969, 27.137368 ], [ 9.755859, 27.683528 ], [ 9.667969, 28.149503 ], [ 9.843750, 28.921631 ], [ 9.843750, 29.458731 ], [ 9.492188, 30.297018 ], [ 9.931641, 30.524413 ], [ 10.019531, 30.977609 ], [ 9.931641, 31.353637 ], [ 10.634766, 31.728167 ], [ 10.986328, 32.101190 ], [ 11.425781, 32.398516 ], [ 11.513672, 33.137551 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 12.041016, 23.483401 ], [ 13.623047, 23.079732 ], [ 14.150391, 22.512557 ], [ 14.853516, 22.836946 ], [ 15.117188, 21.289374 ], [ 15.468750, 21.043491 ], [ 15.468750, 20.715015 ], [ 15.908203, 20.385825 ], [ 15.644531, 19.973349 ], [ 15.292969, 17.895114 ], [ 15.205078, 16.636192 ], [ 13.974609, 15.707663 ], [ 13.535156, 14.349548 ], [ 13.974609, 14.008696 ], [ 13.974609, 13.325485 ], [ 14.589844, 13.325485 ], [ 14.501953, 12.897489 ], [ 14.238281, 12.811801 ], [ 14.150391, 12.468760 ], [ 13.974609, 12.468760 ], [ 13.359375, 13.581921 ], [ 13.095703, 13.581921 ], [ 12.304688, 13.068777 ], [ 11.513672, 13.325485 ], [ 10.986328, 13.410994 ], [ 10.722656, 13.239945 ], [ 10.107422, 13.239945 ], [ 9.492188, 12.811801 ], [ 9.052734, 12.811801 ], [ 7.822266, 13.325485 ], [ 7.294922, 13.068777 ], [ 6.855469, 13.154376 ], [ 6.416016, 13.496473 ], [ 5.449219, 13.838080 ], [ 5.009766, 13.838080 ], [ 5.009766, 19.394068 ], [ 5.712891, 19.642588 ], [ 8.613281, 21.534847 ], [ 12.041016, 23.483401 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 5.449219, 13.838080 ], [ 6.416016, 13.496473 ], [ 6.855469, 13.154376 ], [ 7.294922, 13.068777 ], [ 7.822266, 13.325485 ], [ 9.052734, 12.811801 ], [ 9.492188, 12.811801 ], [ 10.107422, 13.239945 ], [ 10.722656, 13.239945 ], [ 10.986328, 13.410994 ], [ 11.513672, 13.325485 ], [ 12.304688, 13.068777 ], [ 13.095703, 13.581921 ], [ 13.359375, 13.581921 ], [ 13.974609, 12.468760 ], [ 14.150391, 12.468760 ], [ 14.589844, 12.125264 ], [ 14.414062, 11.609193 ], [ 13.535156, 10.833306 ], [ 13.271484, 10.141932 ], [ 13.183594, 9.622414 ], [ 12.919922, 9.449062 ], [ 12.744141, 8.754795 ], [ 12.216797, 8.320212 ], [ 12.041016, 7.798079 ], [ 11.865234, 7.362467 ], [ 11.777344, 7.013668 ], [ 11.074219, 6.664608 ], [ 10.458984, 7.013668 ], [ 10.107422, 7.013668 ], [ 9.492188, 6.489983 ], [ 9.228516, 6.402648 ], [ 8.789062, 5.441022 ], [ 8.613281, 5.003394 ], [ 5.273438, 5.003394 ], [ 5.009766, 5.615986 ], [ 5.009766, 13.838080 ], [ 5.449219, 13.838080 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 14.501953, 12.897489 ], [ 14.853516, 12.211180 ], [ 14.941406, 11.523088 ], [ 14.941406, 10.919618 ], [ 15.468750, 9.968851 ], [ 14.941406, 9.968851 ], [ 14.589844, 9.882275 ], [ 14.150391, 10.055403 ], [ 13.974609, 9.535749 ], [ 14.501953, 8.928487 ], [ 14.941406, 8.754795 ], [ 15.468750, 7.710992 ], [ 15.292969, 7.449624 ], [ 14.765625, 6.402648 ], [ 14.501953, 6.227934 ], [ 14.501953, 5.441022 ], [ 14.589844, 5.003394 ], [ 8.613281, 5.003394 ], [ 8.789062, 5.441022 ], [ 9.228516, 6.402648 ], [ 9.492188, 6.489983 ], [ 10.107422, 7.013668 ], [ 10.458984, 7.013668 ], [ 11.074219, 6.664608 ], [ 11.777344, 7.013668 ], [ 11.865234, 7.362467 ], [ 12.041016, 7.798079 ], [ 12.216797, 8.320212 ], [ 12.744141, 8.754795 ], [ 12.919922, 9.449062 ], [ 13.183594, 9.622414 ], [ 13.271484, 10.141932 ], [ 13.535156, 10.833306 ], [ 14.414062, 11.609193 ], [ 14.589844, 12.125264 ], [ 14.150391, 12.468760 ], [ 14.238281, 12.811801 ], [ 14.501953, 12.897489 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 22.851562, 11.178402 ], [ 22.939453, 10.746969 ], [ 23.554688, 10.055403 ], [ 23.554688, 9.709057 ], [ 23.378906, 9.275622 ], [ 23.466797, 8.928487 ], [ 23.818359, 8.667918 ], [ 24.609375, 8.233237 ], [ 25.136719, 7.798079 ], [ 25.136719, 7.536764 ], [ 25.664062, 7.013668 ], [ 25.664062, 5.266008 ], [ 25.312500, 5.178482 ], [ 25.136719, 5.003394 ], [ 24.609375, 5.003394 ], [ 24.433594, 5.090944 ], [ 24.169922, 5.003394 ], [ 14.589844, 5.003394 ], [ 14.501953, 5.441022 ], [ 14.501953, 6.227934 ], [ 14.765625, 6.402648 ], [ 15.292969, 7.449624 ], [ 16.083984, 7.536764 ], [ 16.259766, 7.710992 ], [ 16.435547, 7.710992 ], [ 16.699219, 7.536764 ], [ 17.929688, 7.885147 ], [ 18.369141, 8.320212 ], [ 18.896484, 8.667918 ], [ 18.808594, 9.015302 ], [ 19.072266, 9.102097 ], [ 20.039062, 9.015302 ], [ 21.005859, 9.449062 ], [ 21.708984, 10.574222 ], [ 22.236328, 11.005904 ], [ 22.851562, 11.178402 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 25.664062, 31.578535 ], [ 25.664062, 22.024546 ], [ 24.960938, 22.024546 ], [ 24.960938, 29.228890 ], [ 24.697266, 30.069094 ], [ 24.960938, 30.675715 ], [ 24.785156, 31.052934 ], [ 25.136719, 31.578535 ], [ 25.664062, 31.578535 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 15.820312, 23.402765 ], [ 19.863281, 21.534847 ], [ 23.818359, 19.559790 ], [ 23.906250, 15.623037 ], [ 23.027344, 15.707663 ], [ 22.587891, 14.944785 ], [ 22.324219, 14.349548 ], [ 22.500000, 14.093957 ], [ 22.148438, 13.752725 ], [ 22.324219, 13.410994 ], [ 22.060547, 12.983148 ], [ 21.972656, 12.554564 ], [ 22.324219, 12.640338 ], [ 22.500000, 12.297068 ], [ 22.500000, 11.695273 ], [ 22.851562, 11.350797 ], [ 22.851562, 11.178402 ], [ 22.236328, 11.005904 ], [ 21.708984, 10.574222 ], [ 21.005859, 9.449062 ], [ 20.039062, 9.015302 ], [ 19.072266, 9.102097 ], [ 18.808594, 9.015302 ], [ 18.896484, 8.667918 ], [ 18.369141, 8.320212 ], [ 17.929688, 7.885147 ], [ 16.699219, 7.536764 ], [ 16.435547, 7.710992 ], [ 16.259766, 7.710992 ], [ 16.083984, 7.536764 ], [ 15.292969, 7.449624 ], [ 15.468750, 7.710992 ], [ 14.941406, 8.754795 ], [ 14.501953, 8.928487 ], [ 13.974609, 9.535749 ], [ 14.150391, 10.055403 ], [ 14.589844, 9.882275 ], [ 14.941406, 9.968851 ], [ 15.468750, 9.968851 ], [ 14.941406, 10.919618 ], [ 14.941406, 11.523088 ], [ 14.853516, 12.211180 ], [ 14.501953, 12.897489 ], [ 14.589844, 13.325485 ], [ 13.974609, 13.325485 ], [ 13.974609, 14.008696 ], [ 13.535156, 14.349548 ], [ 13.974609, 15.707663 ], [ 15.205078, 16.636192 ], [ 15.292969, 17.895114 ], [ 15.644531, 19.973349 ], [ 15.908203, 20.385825 ], [ 15.468750, 20.715015 ], [ 15.468750, 21.043491 ], [ 15.117188, 21.289374 ], [ 14.853516, 22.836946 ], [ 15.820312, 23.402765 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 25.664062, 22.024546 ], [ 25.664062, 10.401378 ], [ 25.048828, 10.314919 ], [ 24.785156, 9.795678 ], [ 24.521484, 8.928487 ], [ 24.169922, 8.754795 ], [ 23.906250, 8.581021 ], [ 23.818359, 8.667918 ], [ 23.466797, 8.928487 ], [ 23.378906, 9.275622 ], [ 23.554688, 9.709057 ], [ 23.554688, 10.055403 ], [ 22.939453, 10.746969 ], [ 22.851562, 11.178402 ], [ 22.851562, 11.350797 ], [ 22.500000, 11.695273 ], [ 22.500000, 12.297068 ], [ 22.324219, 12.640338 ], [ 21.972656, 12.554564 ], [ 22.060547, 12.983148 ], [ 22.324219, 13.410994 ], [ 22.148438, 13.752725 ], [ 22.500000, 14.093957 ], [ 22.324219, 14.349548 ], [ 22.587891, 14.944785 ], [ 23.027344, 15.707663 ], [ 23.906250, 15.623037 ], [ 23.818359, 19.559790 ], [ 23.818359, 19.973349 ], [ 24.960938, 19.973349 ], [ 24.960938, 22.024546 ], [ 25.664062, 22.024546 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 25.664062, 10.401378 ], [ 25.664062, 7.013668 ], [ 25.136719, 7.536764 ], [ 25.136719, 7.798079 ], [ 24.609375, 8.233237 ], [ 23.906250, 8.581021 ], [ 24.169922, 8.754795 ], [ 24.521484, 8.928487 ], [ 24.785156, 9.795678 ], [ 25.048828, 10.314919 ], [ 25.664062, 10.401378 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 24.433594, 5.090944 ], [ 24.609375, 5.003394 ], [ 24.169922, 5.003394 ], [ 24.433594, 5.090944 ] ] ], [ [ [ 25.136719, 5.003394 ], [ 25.312500, 5.178482 ], [ 25.664062, 5.266008 ], [ 25.664062, 5.003394 ], [ 25.136719, 5.003394 ] ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1,35 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "ne_10m_admin_0_countries", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "France" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 4.790039, 49.979488 ], [ 4.790039, 49.979488 ], [ 4.877930, 49.922935 ], [ 4.833984, 49.781264 ], [ 4.965820, 49.809632 ], [ 5.141602, 49.696062 ], [ 5.273438, 49.696062 ], [ 5.273438, 49.610710 ], [ 5.361328, 49.639177 ], [ 5.449219, 49.496675 ], [ 5.800781, 49.553726 ], [ 5.800781, 49.496675 ], [ 5.976562, 49.439557 ], [ 6.064453, 49.439557 ], [ 6.108398, 49.496675 ], [ 6.416016, 49.468124 ], [ 6.591797, 49.353756 ], [ 6.547852, 49.325122 ], [ 6.723633, 49.210420 ], [ 6.723633, 49.152970 ], [ 6.855469, 49.152970 ], [ 6.811523, 49.210420 ], [ 6.943359, 49.210420 ], [ 7.031250, 49.181703 ], [ 7.031250, 49.095452 ], [ 7.075195, 49.152970 ], [ 7.294922, 49.095452 ], [ 7.426758, 49.181703 ], [ 7.646484, 49.037868 ], [ 7.910156, 49.037868 ], [ 8.217773, 48.951366 ], [ 7.866211, 48.661943 ], [ 7.822266, 48.516604 ], [ 7.734375, 48.458352 ], [ 7.690430, 48.224673 ], [ 7.558594, 48.107431 ], [ 7.602539, 47.901614 ], [ 7.514648, 47.665387 ], [ 7.602539, 47.576526 ], [ 7.470703, 47.546872 ], [ 7.514648, 47.517201 ], [ 7.426758, 47.487513 ], [ 7.426758, 47.428087 ], [ 6.987305, 47.487513 ], [ 6.987305, 47.428087 ], [ 6.855469, 47.368594 ], [ 7.031250, 47.368594 ], [ 7.031250, 47.309034 ], [ 6.855469, 47.159840 ], [ 6.723633, 47.129951 ], [ 6.767578, 47.100045 ], [ 6.679688, 47.070122 ], [ 6.679688, 47.010226 ], [ 6.416016, 46.920255 ], [ 6.416016, 46.739861 ], [ 6.108398, 46.589069 ], [ 6.152344, 46.558860 ], [ 6.064453, 46.407564 ], [ 6.152344, 46.346928 ], [ 6.108398, 46.255847 ], [ 5.976562, 46.225453 ], [ 5.976562, 46.134170 ], [ 6.108398, 46.134170 ], [ 6.284180, 46.225453 ], [ 6.196289, 46.316584 ], [ 6.284180, 46.407564 ], [ 6.547852, 46.468133 ], [ 6.767578, 46.437857 ], [ 6.767578, 46.134170 ], [ 6.855469, 46.134170 ], [ 6.855469, 46.042736 ], [ 7.031250, 45.951150 ], [ 6.987305, 45.859412 ], [ 6.855469, 45.859412 ], [ 6.767578, 45.767523 ], [ 6.899414, 45.614037 ], [ 4.965820, 45.828799 ], [ 3.383789, 47.338823 ], [ 4.218750, 49.922935 ], [ 4.350586, 49.922935 ], [ 4.482422, 49.922935 ], [ 4.614258, 49.979488 ], [ 4.790039, 49.979488 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Belgium" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 5.932617, 50.148746 ], [ 5.888672, 50.120578 ], [ 5.712891, 49.894634 ], [ 5.712891, 49.809632 ], [ 5.888672, 49.667628 ], [ 5.844727, 49.553726 ], [ 5.625000, 49.553726 ], [ 5.449219, 49.496675 ], [ 5.361328, 49.639177 ], [ 5.273438, 49.610710 ], [ 5.273438, 49.696062 ], [ 5.141602, 49.696062 ], [ 4.965820, 49.809632 ], [ 4.833984, 49.781264 ], [ 4.877930, 49.922935 ], [ 4.790039, 49.979488 ], [ 4.790039, 49.979488 ], [ 5.932617, 50.148746 ] ] ], [ [ [ 4.614258, 49.979488 ], [ 4.482422, 49.922935 ], [ 4.350586, 49.922935 ], [ 4.614258, 49.979488 ] ] ], [ [ [ 6.108398, 50.148746 ], [ 6.108398, 50.120578 ], [ 6.020508, 50.148746 ], [ 6.108398, 50.148746 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Luxembourg" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 6.064453, 50.148746 ], [ 6.108398, 50.148746 ], [ 6.108398, 50.007739 ], [ 6.240234, 49.866317 ], [ 6.503906, 49.809632 ], [ 6.503906, 49.696062 ], [ 6.416016, 49.667628 ], [ 6.328125, 49.468124 ], [ 6.108398, 49.496675 ], [ 6.064453, 49.439557 ], [ 5.976562, 49.439557 ], [ 5.800781, 49.496675 ], [ 5.888672, 49.667628 ], [ 5.800781, 49.724479 ], [ 5.712891, 49.894634 ], [ 5.888672, 50.120578 ], [ 5.932617, 50.148746 ], [ 6.064453, 50.148746 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Liechtenstein" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 9.492188, 47.249407 ], [ 9.624023, 47.129951 ], [ 9.580078, 47.040182 ], [ 9.492188, 47.070122 ], [ 9.492188, 47.249407 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Switzerland" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 8.569336, 47.813155 ], [ 8.613281, 47.754098 ], [ 8.701172, 47.754098 ], [ 8.701172, 47.694974 ], [ 8.789062, 47.724545 ], [ 8.876953, 47.694974 ], [ 8.833008, 47.665387 ], [ 9.228516, 47.665387 ], [ 9.667969, 47.457809 ], [ 9.492188, 47.249407 ], [ 9.492188, 47.070122 ], [ 9.667969, 47.040182 ], [ 8.525391, 46.164614 ], [ 8.437500, 46.225453 ], [ 8.437500, 46.437857 ], [ 8.305664, 46.437857 ], [ 8.305664, 46.377254 ], [ 8.173828, 46.286224 ], [ 8.085938, 46.286224 ], [ 8.129883, 46.134170 ], [ 7.998047, 46.073231 ], [ 7.998047, 45.981695 ], [ 7.866211, 45.981695 ], [ 7.866211, 45.920587 ], [ 7.514648, 45.981695 ], [ 7.250977, 45.890008 ], [ 7.075195, 45.890008 ], [ 6.855469, 46.042736 ], [ 6.855469, 46.134170 ], [ 6.767578, 46.134170 ], [ 6.767578, 46.437857 ], [ 6.591797, 46.468133 ], [ 6.284180, 46.407564 ], [ 6.196289, 46.316584 ], [ 6.284180, 46.225453 ], [ 6.108398, 46.134170 ], [ 5.976562, 46.134170 ], [ 5.976562, 46.225453 ], [ 6.108398, 46.255847 ], [ 6.152344, 46.346928 ], [ 6.064453, 46.407564 ], [ 6.152344, 46.558860 ], [ 6.108398, 46.589069 ], [ 6.416016, 46.739861 ], [ 6.416016, 46.920255 ], [ 6.679688, 47.010226 ], [ 6.679688, 47.070122 ], [ 6.767578, 47.100045 ], [ 6.723633, 47.129951 ], [ 6.855469, 47.159840 ], [ 7.031250, 47.309034 ], [ 7.031250, 47.368594 ], [ 6.855469, 47.368594 ], [ 6.987305, 47.428087 ], [ 6.987305, 47.487513 ], [ 7.426758, 47.428087 ], [ 7.426758, 47.487513 ], [ 7.514648, 47.517201 ], [ 7.470703, 47.546872 ], [ 7.646484, 47.606163 ], [ 7.646484, 47.546872 ], [ 7.778320, 47.546872 ], [ 7.822266, 47.606163 ], [ 7.910156, 47.546872 ], [ 8.041992, 47.546872 ], [ 8.217773, 47.635784 ], [ 8.305664, 47.576526 ], [ 8.437500, 47.576526 ], [ 8.525391, 47.635784 ], [ 8.569336, 47.576526 ], [ 8.613281, 47.665387 ], [ 8.437500, 47.635784 ], [ 8.393555, 47.694974 ], [ 8.569336, 47.813155 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Czechia" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 16.347656, 50.652943 ], [ 16.435547, 50.569283 ], [ 16.347656, 50.485474 ], [ 16.171875, 50.429518 ], [ 16.435547, 50.317408 ], [ 16.567383, 50.120578 ], [ 16.655273, 50.092393 ], [ 16.962891, 50.233152 ], [ 17.006836, 50.205033 ], [ 17.006836, 50.289339 ], [ 16.918945, 50.317408 ], [ 16.875000, 50.429518 ], [ 17.094727, 50.401515 ], [ 17.226562, 50.317408 ], [ 17.358398, 50.317408 ], [ 17.314453, 50.261254 ], [ 17.402344, 50.233152 ], [ 17.666016, 50.261254 ], [ 17.709961, 50.317408 ], [ 17.753906, 50.205033 ], [ 17.578125, 50.176898 ], [ 17.622070, 50.092393 ], [ 17.753906, 50.092393 ], [ 17.709961, 50.064192 ], [ 17.841797, 49.979488 ], [ 18.017578, 50.035974 ], [ 18.281250, 49.951220 ], [ 18.281250, 49.894634 ], [ 18.544922, 49.922935 ], [ 18.544922, 49.809632 ], [ 18.632812, 49.696062 ], [ 18.808594, 49.667628 ], [ 18.852539, 49.496675 ], [ 18.544922, 49.496675 ], [ 18.457031, 49.382373 ], [ 18.369141, 49.382373 ], [ 18.369141, 49.325122 ], [ 18.149414, 49.267805 ], [ 18.105469, 49.066668 ], [ 17.929688, 49.009051 ], [ 17.885742, 48.922499 ], [ 17.797852, 48.922499 ], [ 17.753906, 48.864715 ], [ 17.534180, 48.806863 ], [ 17.358398, 48.806863 ], [ 17.270508, 48.864715 ], [ 17.094727, 48.835797 ], [ 16.962891, 48.603858 ], [ 16.875000, 48.719961 ], [ 16.655273, 48.719961 ], [ 16.655273, 48.777913 ], [ 16.567383, 48.806863 ], [ 16.435547, 48.806863 ], [ 16.391602, 48.719961 ], [ 16.040039, 48.748945 ], [ 15.908203, 48.835797 ], [ 15.556641, 48.893615 ], [ 15.468750, 48.951366 ], [ 15.161133, 48.951366 ], [ 14.985352, 49.009051 ], [ 14.941406, 48.748945 ], [ 14.809570, 48.777913 ], [ 14.677734, 48.574790 ], [ 14.589844, 48.632909 ], [ 14.458008, 48.632909 ], [ 14.326172, 48.545705 ], [ 14.018555, 48.603858 ], [ 14.018555, 48.690960 ], [ 13.623047, 48.893615 ], [ 13.623047, 48.951366 ], [ 13.447266, 48.951366 ], [ 12.963867, 49.325122 ], [ 12.788086, 49.325122 ], [ 12.700195, 49.382373 ], [ 14.194336, 49.325122 ], [ 16.040039, 50.625073 ], [ 16.040039, 50.625073 ], [ 16.083984, 50.652943 ], [ 16.347656, 50.652943 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Germany" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 14.282227, 53.041213 ], [ 14.150391, 52.961875 ], [ 14.106445, 52.855864 ], [ 14.633789, 52.589701 ], [ 14.545898, 52.375599 ], [ 14.589844, 52.268157 ], [ 14.721680, 52.241256 ], [ 14.677734, 52.106505 ], [ 14.765625, 52.079506 ], [ 14.589844, 51.781436 ], [ 14.721680, 51.672555 ], [ 12.480469, 51.618017 ], [ 11.206055, 50.792047 ], [ 11.337891, 49.979488 ], [ 12.436523, 49.382373 ], [ 12.700195, 49.382373 ], [ 12.788086, 49.325122 ], [ 12.963867, 49.325122 ], [ 13.139648, 49.152970 ], [ 13.315430, 49.095452 ], [ 13.447266, 48.951366 ], [ 13.623047, 48.951366 ], [ 13.623047, 48.893615 ], [ 13.798828, 48.777913 ], [ 13.798828, 48.574790 ], [ 13.710938, 48.516604 ], [ 13.623047, 48.574790 ], [ 13.447266, 48.574790 ], [ 13.447266, 48.429201 ], [ 13.315430, 48.312428 ], [ 13.007812, 48.253941 ], [ 12.875977, 48.195387 ], [ 10.722656, 47.813155 ], [ 10.063477, 47.368594 ], [ 10.063477, 47.368594 ], [ 9.931641, 47.546872 ], [ 9.711914, 47.576526 ], [ 9.711914, 47.517201 ], [ 9.624023, 47.517201 ], [ 9.228516, 47.665387 ], [ 8.833008, 47.665387 ], [ 8.876953, 47.694974 ], [ 8.701172, 47.694974 ], [ 8.701172, 47.754098 ], [ 8.613281, 47.754098 ], [ 8.569336, 47.813155 ], [ 8.393555, 47.694974 ], [ 8.437500, 47.635784 ], [ 8.525391, 47.635784 ], [ 8.437500, 47.576526 ], [ 8.305664, 47.576526 ], [ 8.217773, 47.635784 ], [ 8.041992, 47.546872 ], [ 7.910156, 47.546872 ], [ 7.822266, 47.606163 ], [ 7.778320, 47.546872 ], [ 7.646484, 47.546872 ], [ 7.646484, 47.606163 ], [ 7.602539, 47.576526 ], [ 7.514648, 47.665387 ], [ 7.602539, 47.901614 ], [ 7.558594, 48.107431 ], [ 7.690430, 48.224673 ], [ 7.734375, 48.458352 ], [ 7.822266, 48.516604 ], [ 7.866211, 48.661943 ], [ 8.217773, 48.951366 ], [ 7.910156, 49.037868 ], [ 7.646484, 49.037868 ], [ 7.426758, 49.181703 ], [ 7.294922, 49.095452 ], [ 7.075195, 49.152970 ], [ 7.031250, 49.095452 ], [ 7.031250, 49.181703 ], [ 6.943359, 49.210420 ], [ 6.811523, 49.210420 ], [ 6.855469, 49.152970 ], [ 6.723633, 49.152970 ], [ 6.503906, 49.439557 ], [ 6.328125, 49.468124 ], [ 6.416016, 49.667628 ], [ 6.503906, 49.696062 ], [ 6.503906, 49.809632 ], [ 6.240234, 49.866317 ], [ 6.108398, 50.007739 ], [ 6.108398, 50.148746 ], [ 8.217773, 50.429518 ], [ 10.722656, 52.749594 ], [ 13.579102, 53.173119 ], [ 14.282227, 53.041213 ] ] ], [ [ [ 8.613281, 47.665387 ], [ 8.569336, 47.576526 ], [ 8.525391, 47.635784 ], [ 8.613281, 47.665387 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Italy" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 8.437500, 46.437857 ], [ 8.437500, 46.225453 ], [ 8.525391, 46.164614 ], [ 7.690430, 45.552525 ], [ 6.987305, 45.614037 ], [ 6.767578, 45.767523 ], [ 6.855469, 45.859412 ], [ 6.987305, 45.859412 ], [ 6.987305, 45.920587 ], [ 7.250977, 45.890008 ], [ 7.514648, 45.981695 ], [ 7.866211, 45.920587 ], [ 7.866211, 45.981695 ], [ 7.998047, 45.981695 ], [ 7.998047, 46.073231 ], [ 8.129883, 46.134170 ], [ 8.085938, 46.286224 ], [ 8.173828, 46.286224 ], [ 8.305664, 46.377254 ], [ 8.305664, 46.437857 ], [ 8.437500, 46.437857 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Croatia" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.940430, 45.736860 ], [ 18.984375, 45.675482 ], [ 18.896484, 45.583290 ], [ 19.116211, 45.521744 ], [ 18.984375, 45.460131 ], [ 18.984375, 45.367584 ], [ 19.423828, 45.213004 ], [ 19.204102, 45.151053 ], [ 19.160156, 45.213004 ], [ 19.160156, 45.151053 ], [ 19.028320, 45.151053 ], [ 19.116211, 45.026950 ], [ 19.116211, 44.933696 ], [ 18.984375, 44.902578 ], [ 19.028320, 44.871443 ], [ 18.764648, 44.902578 ], [ 18.808594, 44.995883 ], [ 18.676758, 45.089036 ], [ 18.544922, 45.058001 ], [ 18.544922, 45.151053 ], [ 18.940430, 45.736860 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Austria" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 9.711914, 47.576526 ], [ 9.931641, 47.546872 ], [ 10.063477, 47.368594 ], [ 10.063477, 47.368594 ], [ 9.667969, 47.070122 ], [ 9.667969, 47.070122 ], [ 9.580078, 47.040182 ], [ 9.624023, 47.129951 ], [ 9.536133, 47.189712 ], [ 9.536133, 47.309034 ], [ 9.667969, 47.398349 ], [ 9.667969, 47.457809 ], [ 9.536133, 47.546872 ], [ 9.711914, 47.517201 ], [ 9.711914, 47.576526 ] ] ], [ [ [ 14.985352, 49.009051 ], [ 15.161133, 48.951366 ], [ 15.468750, 48.951366 ], [ 15.556641, 48.893615 ], [ 15.908203, 48.835797 ], [ 16.040039, 48.748945 ], [ 16.391602, 48.719961 ], [ 16.435547, 48.806863 ], [ 16.567383, 48.806863 ], [ 16.655273, 48.777913 ], [ 16.655273, 48.719961 ], [ 16.875000, 48.719961 ], [ 16.962891, 48.603858 ], [ 16.831055, 48.370848 ], [ 16.918945, 48.341646 ], [ 16.962891, 48.166085 ], [ 17.094727, 48.107431 ], [ 17.050781, 48.048710 ], [ 17.138672, 48.019324 ], [ 17.094727, 47.901614 ], [ 17.006836, 47.872144 ], [ 17.094727, 47.694974 ], [ 16.831055, 47.724545 ], [ 16.787109, 47.665387 ], [ 16.523438, 47.754098 ], [ 16.523438, 47.694974 ], [ 16.391602, 47.665387 ], [ 16.611328, 47.635784 ], [ 16.699219, 47.546872 ], [ 16.611328, 47.428087 ], [ 16.479492, 47.398349 ], [ 13.710938, 48.341646 ], [ 12.875977, 48.195387 ], [ 13.007812, 48.253941 ], [ 13.315430, 48.312428 ], [ 13.447266, 48.429201 ], [ 13.447266, 48.574790 ], [ 13.623047, 48.574790 ], [ 13.710938, 48.516604 ], [ 13.798828, 48.574790 ], [ 13.798828, 48.777913 ], [ 14.018555, 48.690960 ], [ 14.018555, 48.603858 ], [ 14.326172, 48.545705 ], [ 14.458008, 48.632909 ], [ 14.589844, 48.632909 ], [ 14.677734, 48.574790 ], [ 14.809570, 48.777913 ], [ 14.941406, 48.748945 ], [ 14.985352, 49.009051 ] ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Serbia" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 20.302734, 46.042736 ], [ 20.390625, 45.951150 ], [ 20.654297, 45.828799 ], [ 20.698242, 45.736860 ], [ 20.786133, 45.767523 ], [ 20.742188, 45.490946 ], [ 21.093750, 45.274886 ], [ 21.137695, 45.305803 ], [ 21.489258, 45.151053 ], [ 21.445312, 45.026950 ], [ 21.357422, 44.995883 ], [ 21.533203, 44.933696 ], [ 21.533203, 44.871443 ], [ 21.357422, 44.871443 ], [ 21.401367, 44.777936 ], [ 21.577148, 44.777936 ], [ 21.665039, 44.684277 ], [ 22.016602, 44.653024 ], [ 22.104492, 44.496505 ], [ 22.192383, 44.496505 ], [ 22.324219, 44.621754 ], [ 22.324219, 44.119142 ], [ 19.907227, 43.197167 ], [ 19.291992, 43.580391 ], [ 19.335938, 43.612217 ], [ 19.423828, 43.548548 ], [ 19.511719, 43.580391 ], [ 19.467773, 43.771094 ], [ 19.248047, 43.992815 ], [ 19.291992, 44.024422 ], [ 19.379883, 43.961191 ], [ 19.511719, 43.961191 ], [ 19.599609, 43.992815 ], [ 19.599609, 44.056012 ], [ 19.335938, 44.213710 ], [ 19.335938, 44.276671 ], [ 19.160156, 44.276671 ], [ 19.116211, 44.339565 ], [ 19.116211, 44.527843 ], [ 19.335938, 44.715514 ], [ 19.379883, 44.902578 ], [ 18.984375, 44.902578 ], [ 19.116211, 44.933696 ], [ 19.028320, 45.151053 ], [ 19.160156, 45.151053 ], [ 19.160156, 45.213004 ], [ 19.204102, 45.151053 ], [ 19.423828, 45.213004 ], [ 18.984375, 45.367584 ], [ 18.984375, 45.460131 ], [ 19.116211, 45.521744 ], [ 18.896484, 45.583290 ], [ 18.984375, 45.675482 ], [ 18.896484, 45.706179 ], [ 18.984375, 45.798170 ], [ 20.302734, 46.042736 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Slovakia" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.379883, 49.582226 ], [ 19.291992, 48.253941 ], [ 18.105469, 47.754098 ], [ 17.753906, 47.754098 ], [ 17.358398, 47.989922 ], [ 17.050781, 48.048710 ], [ 17.094727, 48.107431 ], [ 16.962891, 48.166085 ], [ 16.962891, 48.283193 ], [ 16.831055, 48.370848 ], [ 17.094727, 48.835797 ], [ 17.270508, 48.864715 ], [ 17.358398, 48.806863 ], [ 17.534180, 48.806863 ], [ 17.753906, 48.864715 ], [ 17.797852, 48.922499 ], [ 17.885742, 48.922499 ], [ 17.929688, 49.009051 ], [ 18.105469, 49.066668 ], [ 18.149414, 49.267805 ], [ 18.369141, 49.325122 ], [ 18.369141, 49.382373 ], [ 18.457031, 49.382373 ], [ 18.544922, 49.496675 ], [ 18.940430, 49.496675 ], [ 18.940430, 49.382373 ], [ 19.160156, 49.382373 ], [ 19.204102, 49.496675 ], [ 19.335938, 49.525208 ], [ 19.379883, 49.582226 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Hungary" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 17.138672, 48.019324 ], [ 17.358398, 47.989922 ], [ 17.753906, 47.754098 ], [ 18.105469, 47.754098 ], [ 16.918945, 47.249407 ], [ 16.479492, 47.398349 ], [ 16.611328, 47.428087 ], [ 16.699219, 47.517201 ], [ 16.611328, 47.635784 ], [ 16.391602, 47.665387 ], [ 16.523438, 47.694974 ], [ 16.523438, 47.754098 ], [ 16.787109, 47.665387 ], [ 16.831055, 47.724545 ], [ 17.094727, 47.694974 ], [ 17.006836, 47.872144 ], [ 17.094727, 47.901614 ], [ 17.138672, 48.019324 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bosnia and Herz." }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.676758, 45.089036 ], [ 18.808594, 44.995883 ], [ 18.764648, 44.902578 ], [ 18.852539, 44.871443 ], [ 19.072266, 44.871443 ], [ 19.160156, 44.933696 ], [ 19.379883, 44.902578 ], [ 19.335938, 44.715514 ], [ 19.116211, 44.527843 ], [ 19.116211, 44.339565 ], [ 19.160156, 44.276671 ], [ 19.335938, 44.276671 ], [ 19.335938, 44.213710 ], [ 19.599609, 44.056012 ], [ 19.599609, 43.992815 ], [ 19.511719, 43.961191 ], [ 19.379883, 43.961191 ], [ 19.291992, 44.024422 ], [ 19.248047, 43.992815 ], [ 19.511719, 43.675818 ], [ 19.467773, 43.548548 ], [ 19.335938, 43.612217 ], [ 19.248047, 43.580391 ], [ 18.588867, 43.992815 ], [ 18.544922, 45.058001 ], [ 18.676758, 45.089036 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Poland" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 14.282227, 53.041213 ], [ 16.699219, 52.536273 ], [ 19.511719, 50.986099 ], [ 19.379883, 49.582226 ], [ 19.204102, 49.496675 ], [ 19.160156, 49.382373 ], [ 18.940430, 49.382373 ], [ 18.940430, 49.496675 ], [ 18.852539, 49.496675 ], [ 18.808594, 49.667628 ], [ 18.632812, 49.696062 ], [ 18.544922, 49.809632 ], [ 18.544922, 49.922935 ], [ 18.281250, 49.894634 ], [ 18.281250, 49.951220 ], [ 18.017578, 50.035974 ], [ 17.929688, 49.979488 ], [ 17.753906, 50.007739 ], [ 17.753906, 50.092393 ], [ 17.622070, 50.092393 ], [ 17.578125, 50.148746 ], [ 17.753906, 50.205033 ], [ 17.709961, 50.317408 ], [ 17.666016, 50.261254 ], [ 17.402344, 50.233152 ], [ 17.314453, 50.261254 ], [ 17.358398, 50.317408 ], [ 17.226562, 50.317408 ], [ 17.094727, 50.401515 ], [ 16.875000, 50.429518 ], [ 16.918945, 50.317408 ], [ 17.006836, 50.289339 ], [ 17.006836, 50.205033 ], [ 16.962891, 50.233152 ], [ 16.655273, 50.092393 ], [ 16.567383, 50.120578 ], [ 16.435547, 50.317408 ], [ 16.171875, 50.429518 ], [ 16.347656, 50.485474 ], [ 16.435547, 50.569283 ], [ 16.347656, 50.652943 ], [ 16.083984, 50.652943 ], [ 16.040039, 50.625073 ], [ 14.765625, 51.672555 ], [ 14.721680, 51.672555 ], [ 14.589844, 51.781436 ], [ 14.765625, 52.079506 ], [ 14.677734, 52.106505 ], [ 14.721680, 52.241256 ], [ 14.589844, 52.268157 ], [ 14.545898, 52.375599 ], [ 14.633789, 52.589701 ], [ 14.106445, 52.855864 ], [ 14.150391, 52.961875 ], [ 14.282227, 53.041213 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Romania" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 21.049805, 46.164614 ], [ 22.324219, 45.274886 ], [ 22.324219, 44.621754 ], [ 22.192383, 44.496505 ], [ 22.104492, 44.496505 ], [ 22.016602, 44.653024 ], [ 21.665039, 44.684277 ], [ 21.577148, 44.777936 ], [ 21.401367, 44.777936 ], [ 21.357422, 44.871443 ], [ 21.533203, 44.871443 ], [ 21.533203, 44.933696 ], [ 21.357422, 44.995883 ], [ 21.445312, 45.026950 ], [ 21.489258, 45.151053 ], [ 21.137695, 45.305803 ], [ 21.093750, 45.274886 ], [ 20.742188, 45.490946 ], [ 20.786133, 45.767523 ], [ 20.698242, 45.736860 ], [ 20.654297, 45.828799 ], [ 20.346680, 45.981695 ], [ 20.302734, 46.042736 ], [ 21.049805, 46.164614 ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 8, "x": 135, "y": 86 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "ne_10m_admin_0_countries", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "Germany" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 11.210518, 50.771208 ], [ 11.304932, 50.271568 ], [ 11.304932, 49.802541 ], [ 9.788818, 49.802541 ], [ 9.788818, 50.771208 ], [ 11.210518, 50.771208 ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1,13 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "layer", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "what": "no id" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12345, "properties": { "what": "will survive" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12346, "properties": { "what": "will win over the duplicate" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "what": "no id again" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12347, "properties": { "what": "will be added" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1,15 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "layer", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "what": "no id" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12345, "properties": { "what": "will survive" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12346, "properties": { "what": "will win over the duplicate" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "what": "no id again" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12346, "properties": { "what": "will be lost as a duplicate" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 12347, "properties": { "what": "will be added" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -0,0 +1,211 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "ne_10m_populated_places", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "NAME": "Reims" }, "geometry": { "type": "Point", "coordinates": [ 4.042969, 49.239121 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Diekirch" }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 49.894634 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Arlon" }, "geometry": { "type": "Point", "coordinates": [ 5.800781, 49.696062 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Luxembourg" }, "geometry": { "type": "Point", "coordinates": [ 6.108398, 49.610710 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Metz" }, "geometry": { "type": "Point", "coordinates": [ 6.196289, 49.124219 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Grevenmacher" }, "geometry": { "type": "Point", "coordinates": [ 6.416016, 49.667628 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Saarbrücken" }, "geometry": { "type": "Point", "coordinates": [ 6.987305, 49.239121 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Koblenz" }, "geometry": { "type": "Point", "coordinates": [ 7.602539, 50.345460 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Wiesbaden" }, "geometry": { "type": "Point", "coordinates": [ 8.261719, 50.092393 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mainz" }, "geometry": { "type": "Point", "coordinates": [ 8.261719, 49.979488 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Karlsruhe" }, "geometry": { "type": "Point", "coordinates": [ 8.393555, 49.009051 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kassel" }, "geometry": { "type": "Point", "coordinates": [ 9.492188, 51.289406 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Braunschweig" }, "geometry": { "type": "Point", "coordinates": [ 10.502930, 52.241256 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Göttingen" }, "geometry": { "type": "Point", "coordinates": [ 9.931641, 51.508742 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Erfurt" }, "geometry": { "type": "Point", "coordinates": [ 11.030273, 50.958427 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Gießen" }, "geometry": { "type": "Point", "coordinates": [ 8.657227, 50.597186 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Frankfurt" }, "geometry": { "type": "Point", "coordinates": [ 8.657227, 50.092393 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mannheim" }, "geometry": { "type": "Point", "coordinates": [ 8.481445, 49.496675 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Heidelberg" }, "geometry": { "type": "Point", "coordinates": [ 8.701172, 49.410973 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Coburg" }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 50.261254 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Würzburg" }, "geometry": { "type": "Point", "coordinates": [ 9.931641, 49.809632 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Fürth" }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 49.468124 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nürnberg" }, "geometry": { "type": "Point", "coordinates": [ 11.074219, 49.439557 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Troyes" }, "geometry": { "type": "Point", "coordinates": [ 4.086914, 48.341646 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Auxerre" }, "geometry": { "type": "Point", "coordinates": [ 3.559570, 47.813155 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Dijon" }, "geometry": { "type": "Point", "coordinates": [ 5.009766, 47.338823 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Nancy" }, "geometry": { "type": "Point", "coordinates": [ 6.196289, 48.690960 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Besançon" }, "geometry": { "type": "Point", "coordinates": [ 6.020508, 47.219568 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Strasbourg" }, "geometry": { "type": "Point", "coordinates": [ 7.734375, 48.574790 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Freiburg" }, "geometry": { "type": "Point", "coordinates": [ 7.866211, 47.989922 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Mulhouse" }, "geometry": { "type": "Point", "coordinates": [ 7.338867, 47.754098 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Basel" }, "geometry": { "type": "Point", "coordinates": [ 7.602539, 47.576526 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Delémont" }, "geometry": { "type": "Point", "coordinates": [ 7.338867, 47.368594 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Biel" }, "geometry": { "type": "Point", "coordinates": [ 7.250977, 47.159840 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Solothurn" }, "geometry": { "type": "Point", "coordinates": [ 7.558594, 47.219568 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Liestal" }, "geometry": { "type": "Point", "coordinates": [ 7.734375, 47.487513 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Aarau" }, "geometry": { "type": "Point", "coordinates": [ 8.041992, 47.398349 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Luzern" }, "geometry": { "type": "Point", "coordinates": [ 8.261719, 47.040182 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Geneva" }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 46.195042 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Neuchâtel" }, "geometry": { "type": "Point", "coordinates": [ 6.943359, 47.010226 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Lausanne" }, "geometry": { "type": "Point", "coordinates": [ 6.635742, 46.528635 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Annecy" }, "geometry": { "type": "Point", "coordinates": [ 6.108398, 45.890008 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Fribourg" }, "geometry": { "type": "Point", "coordinates": [ 7.163086, 46.800059 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bern" }, "geometry": { "type": "Point", "coordinates": [ 7.470703, 46.920255 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sion" }, "geometry": { "type": "Point", "coordinates": [ 7.338867, 46.225453 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Sarnen" }, "geometry": { "type": "Point", "coordinates": [ 8.261719, 46.890232 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Stans" }, "geometry": { "type": "Point", "coordinates": [ 8.393555, 46.950262 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Aosta" }, "geometry": { "type": "Point", "coordinates": [ 7.294922, 45.736860 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Stuttgart" }, "geometry": { "type": "Point", "coordinates": [ 9.184570, 48.777913 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Schaffhausen" }, "geometry": { "type": "Point", "coordinates": [ 8.613281, 47.694974 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Frauenfeld" }, "geometry": { "type": "Point", "coordinates": [ 8.920898, 47.546872 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zürich" }, "geometry": { "type": "Point", "coordinates": [ 8.569336, 47.368594 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zug" }, "geometry": { "type": "Point", "coordinates": [ 8.481445, 47.189712 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Glarus" }, "geometry": { "type": "Point", "coordinates": [ 9.052734, 47.040182 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Herisau" }, "geometry": { "type": "Point", "coordinates": [ 9.272461, 47.368594 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Saint Gallen" }, "geometry": { "type": "Point", "coordinates": [ 9.360352, 47.428087 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Appenzell" }, "geometry": { "type": "Point", "coordinates": [ 9.404297, 47.338823 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bregenz" }, "geometry": { "type": "Point", "coordinates": [ 9.755859, 47.517201 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vaduz" }, "geometry": { "type": "Point", "coordinates": [ 9.536133, 47.129951 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ulm" }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 48.400032 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Augsburg" }, "geometry": { "type": "Point", "coordinates": [ 10.898438, 48.341646 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Schwyz" }, "geometry": { "type": "Point", "coordinates": [ 8.657227, 47.010226 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Altdorf" }, "geometry": { "type": "Point", "coordinates": [ 8.657227, 46.890232 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Berlin" }, "geometry": { "type": "Point", "coordinates": [ 13.403320, 52.536273 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Magdeburg" }, "geometry": { "type": "Point", "coordinates": [ 11.601562, 52.133488 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Potsdam" }, "geometry": { "type": "Point", "coordinates": [ 13.051758, 52.402419 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Regensburg" }, "geometry": { "type": "Point", "coordinates": [ 12.128906, 49.009051 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Cottbus" }, "geometry": { "type": "Point", "coordinates": [ 14.326172, 51.781436 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zielona Góra" }, "geometry": { "type": "Point", "coordinates": [ 15.512695, 51.944265 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "České Budějovice" }, "geometry": { "type": "Point", "coordinates": [ 14.458008, 48.980217 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Hradec Králové" }, "geometry": { "type": "Point", "coordinates": [ 15.820312, 50.205033 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Pardubice" }, "geometry": { "type": "Point", "coordinates": [ 15.776367, 50.035974 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Jihlava" }, "geometry": { "type": "Point", "coordinates": [ 15.600586, 49.410973 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Brno" }, "geometry": { "type": "Point", "coordinates": [ 16.611328, 49.210420 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Poznań" }, "geometry": { "type": "Point", "coordinates": [ 16.918945, 52.402419 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Wrocław" }, "geometry": { "type": "Point", "coordinates": [ 17.050781, 51.124213 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Opole" }, "geometry": { "type": "Point", "coordinates": [ 17.929688, 50.680797 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Olomouc" }, "geometry": { "type": "Point", "coordinates": [ 17.270508, 49.582226 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ostrava" }, "geometry": { "type": "Point", "coordinates": [ 18.237305, 49.837982 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zlín" }, "geometry": { "type": "Point", "coordinates": [ 17.666016, 49.239121 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Gliwice" }, "geometry": { "type": "Point", "coordinates": [ 18.676758, 50.317408 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bytom" }, "geometry": { "type": "Point", "coordinates": [ 18.896484, 50.345460 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Katowice" }, "geometry": { "type": "Point", "coordinates": [ 19.028320, 50.261254 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Žilina" }, "geometry": { "type": "Point", "coordinates": [ 18.764648, 49.210420 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Ingolstadt" }, "geometry": { "type": "Point", "coordinates": [ 11.469727, 48.777913 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Munich" }, "geometry": { "type": "Point", "coordinates": [ 11.557617, 48.136767 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Passau" }, "geometry": { "type": "Point", "coordinates": [ 13.447266, 48.574790 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Linz" }, "geometry": { "type": "Point", "coordinates": [ 14.282227, 48.312428 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Vienna" }, "geometry": { "type": "Point", "coordinates": [ 16.347656, 48.195387 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Wiener Neustadt" }, "geometry": { "type": "Point", "coordinates": [ 16.259766, 47.813155 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Eisenstadt" }, "geometry": { "type": "Point", "coordinates": [ 16.523438, 47.842658 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Bratislava" }, "geometry": { "type": "Point", "coordinates": [ 17.138672, 48.136767 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Trnava" }, "geometry": { "type": "Point", "coordinates": [ 17.578125, 48.370848 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Győr" }, "geometry": { "type": "Point", "coordinates": [ 17.622070, 47.694974 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Banská Bystrica" }, "geometry": { "type": "Point", "coordinates": [ 19.160156, 48.719961 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zvolen" }, "geometry": { "type": "Point", "coordinates": [ 19.116211, 48.574790 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Novi Sad" }, "geometry": { "type": "Point", "coordinates": [ 19.863281, 45.243953 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Zrenjanin" }, "geometry": { "type": "Point", "coordinates": [ 20.390625, 45.367584 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Timișoara" }, "geometry": { "type": "Point", "coordinates": [ 21.225586, 45.767523 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Reșița" }, "geometry": { "type": "Point", "coordinates": [ 21.884766, 45.305803 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Tuzla" }, "geometry": { "type": "Point", "coordinates": [ 18.676758, 44.559163 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Belgrade" }, "geometry": { "type": "Point", "coordinates": [ 20.478516, 44.809122 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Čačak" }, "geometry": { "type": "Point", "coordinates": [ 20.346680, 43.897892 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "NAME": "Kragujevac" }, "geometry": { "type": "Point", "coordinates": [ 20.917969, 44.024422 ] } }
|
||||
] }
|
||||
] }
|
||||
Binary file not shown.
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
[
|
||||
13.577060272719763,
|
||||
53.17369971291083
|
||||
],
|
||||
[
|
||||
10.704205888641951,
|
||||
52.74867374387799
|
||||
],
|
||||
[
|
||||
8.234559137417222,
|
||||
50.4321686022941
|
||||
],
|
||||
[
|
||||
4.20248280888643,
|
||||
49.91569934015271
|
||||
],
|
||||
[
|
||||
3.3960675431802656,
|
||||
47.351710786357756
|
||||
],
|
||||
[
|
||||
4.958497120486356,
|
||||
45.82785468647634
|
||||
],
|
||||
[
|
||||
7.680148642243836,
|
||||
45.54618382040567
|
||||
],
|
||||
[
|
||||
10.704205888641951,
|
||||
47.82759699398349
|
||||
],
|
||||
[
|
||||
13.728263135039242,
|
||||
48.332677316517476
|
||||
],
|
||||
[
|
||||
16.903523243756865,
|
||||
47.24917200504791
|
||||
],
|
||||
[
|
||||
19.272368086768267,
|
||||
48.26561972235635
|
||||
],
|
||||
[
|
||||
19.52437285730184,
|
||||
50.97481113632679
|
||||
],
|
||||
[
|
||||
16.701919427330296,
|
||||
52.53459175523133
|
||||
],
|
||||
[
|
||||
13.577060272719763,
|
||||
53.17369971291083
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
14.78668317127898,
|
||||
51.66775442536286
|
||||
],
|
||||
[
|
||||
12.46823928237373,
|
||||
51.6051918576735
|
||||
],
|
||||
[
|
||||
11.208215429708275,
|
||||
50.78400718973347
|
||||
],
|
||||
[
|
||||
11.359418292027812,
|
||||
49.980563422399655
|
||||
],
|
||||
[
|
||||
12.417838328266726,
|
||||
49.39363856874314
|
||||
],
|
||||
[
|
||||
14.181871721999357,
|
||||
49.32798696801095
|
||||
],
|
||||
[
|
||||
16.046707023944435,
|
||||
50.62440671313237
|
||||
],
|
||||
[
|
||||
14.78668317127898,
|
||||
51.66775442536286
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
21.055284848897287,
|
||||
46.16048194834923
|
||||
],
|
||||
[
|
||||
18.988845730525668,
|
||||
45.81027671022295
|
||||
],
|
||||
[
|
||||
18.53523714356635,
|
||||
45.13878150945956
|
||||
],
|
||||
[
|
||||
18.585638097672586,
|
||||
43.989754759795915
|
||||
],
|
||||
[
|
||||
19.896062904445103,
|
||||
43.18663878167516
|
||||
],
|
||||
[
|
||||
22.31530870156351,
|
||||
44.134624205316555
|
||||
],
|
||||
[
|
||||
22.31530870156351,
|
||||
45.280813880909534
|
||||
],
|
||||
[
|
||||
21.055284848897287,
|
||||
46.16048194834923
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
"type": "MultiPolygon"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"*":["SCALERANK","eq",0]}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"coordinates":[[[-73.9722549,40.7904659],[-73.9755817,40.7674848],[-73.938783,40.767022],[-73.9457082,40.7791562],[-73.9628855,40.7760201],[-73.9629534,40.7914425],[-73.9722549,40.7904659]]],"crs":{"properties":{"name":"EPSG:4326"},"type":"name"},"type":"Polygon"}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "parsed", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "id": 510, "properties": { "bldgsqft": 1765, "felt:sum:bldgsqft": 4857699 }, "geometry": { "type": "Point", "coordinates": [ -122.343750, 37.718590 ] } }
|
||||
,
|
||||
{ "type": "Feature", "id": 514, "properties": { "bldgsqft": 3050 }, "geometry": { "type": "Point", "coordinates": [ -122.343750, 37.718590 ] } }
|
||||
] }
|
||||
] }
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "-123.750000,45.089036,-120.937500,47.040182",
|
||||
"bounds": "-123.750000,45.089036,-120.937500,47.040182",
|
||||
"antimeridian_adjusted_bounds": "-122.682953,45.512121,-122.654800,45.569832",
|
||||
"bounds": "-122.682953,45.512121,-122.654800,45.569832",
|
||||
"center": "-122.662354,45.514045,7",
|
||||
"description": "tests/raw-tiles/raw-tiles",
|
||||
"format": "pbf",
|
||||
|
||||
+445
-184
@@ -43,6 +43,7 @@
|
||||
#include "errors.hpp"
|
||||
#include "geometry.hpp"
|
||||
#include "thread.hpp"
|
||||
#include "platform.hpp"
|
||||
|
||||
int pk = false;
|
||||
int pC = false;
|
||||
@@ -54,7 +55,13 @@ int maxzoom = 32;
|
||||
int minzoom = 0;
|
||||
std::map<std::string, std::string> renames;
|
||||
bool exclude_all = false;
|
||||
bool exclude_all_tile_attributes = false;
|
||||
std::vector<std::string> unidecode_data;
|
||||
std::string join_tile_attribute;
|
||||
std::string join_table_expression;
|
||||
std::string join_table;
|
||||
size_t join_count_limit = 1;
|
||||
std::string attribute_for_id;
|
||||
|
||||
bool want_overzoom = false;
|
||||
int buffer = 5;
|
||||
@@ -72,7 +79,115 @@ struct stats {
|
||||
std::vector<struct strategy> strategies{};
|
||||
};
|
||||
|
||||
void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<std::string, layermap_entry> &layermap, std::vector<std::string> &header, std::map<std::string, std::vector<std::string>> &mapping, std::set<std::string> &exclude, std::set<std::string> &include, std::set<std::string> &keep_layers, std::set<std::string> &remove_layers, int ifmatched, mvt_tile &outtile, json_object *filter) {
|
||||
// list, per feature in the tile,
|
||||
// of lists of features in the sqlite response,
|
||||
// each of which is a mapping from keys to values
|
||||
std::vector<std::vector<std::map<std::string, mvt_value>>> get_joined_rows(sqlite3 *db, const std::vector<mvt_value> &join_keys) {
|
||||
std::vector<std::vector<std::map<std::string, mvt_value>>> ret;
|
||||
ret.resize(join_keys.size());
|
||||
|
||||
// double quotes for table and column identifiers
|
||||
const char *s = sqlite3_mprintf("select %s, * from \"%w\" where %s in (",
|
||||
join_table_expression.c_str(), join_table.c_str(), join_table_expression.c_str());
|
||||
std::string query = s;
|
||||
sqlite3_free((void *) s);
|
||||
|
||||
std::multimap<std::string, size_t> key_to_row;
|
||||
for (size_t i = 0; i < join_keys.size(); i++) {
|
||||
const mvt_value &v = join_keys[i];
|
||||
|
||||
// single quotes for literals
|
||||
if (v.type == mvt_string) {
|
||||
s = sqlite3_mprintf("'%q'", v.c_str());
|
||||
query += s;
|
||||
sqlite3_free((void *) s);
|
||||
key_to_row.emplace(v.get_string_value(), i);
|
||||
} else {
|
||||
std::string stringified = v.toString();
|
||||
key_to_row.emplace(stringified, i);
|
||||
query += stringified;
|
||||
}
|
||||
|
||||
if (i + 1 < join_keys.size()) {
|
||||
query += ", ";
|
||||
}
|
||||
}
|
||||
|
||||
// this doesn't add a LIMIT to the query because our limit
|
||||
// is per tiled feature, not a limit on the entire query response.
|
||||
query += ");";
|
||||
|
||||
sqlite3_stmt *stmt;
|
||||
if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, NULL) != SQLITE_OK) {
|
||||
fprintf(stderr, "sqlite3 query %s failed: %s\n", query.c_str(), sqlite3_errmsg(db));
|
||||
exit(EXIT_SQLITE);
|
||||
}
|
||||
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
int count = sqlite3_column_count(stmt);
|
||||
std::map<std::string, mvt_value> row;
|
||||
|
||||
if (count > 0) {
|
||||
// join key is 0th column of query
|
||||
std::string key = (const char *) sqlite3_column_text(stmt, 0);
|
||||
auto f = key_to_row.equal_range(key);
|
||||
if (f.first == f.second) {
|
||||
fprintf(stderr, "Unexpected join key: %s\n", key.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
for (auto ff = f.first; ff != f.second; ++ff) {
|
||||
if (ret[ff->second].size() < join_count_limit) {
|
||||
for (int i = 1; i < count; i++) {
|
||||
int type = sqlite3_column_type(stmt, i);
|
||||
mvt_value v;
|
||||
v.type = mvt_null;
|
||||
|
||||
if (type == SQLITE_INTEGER || type == SQLITE_FLOAT) {
|
||||
v = mvt_value(sqlite3_column_double(stmt, i));
|
||||
} else if (type == SQLITE_TEXT || type == SQLITE_BLOB) {
|
||||
v.set_string_value((const char *) sqlite3_column_text(stmt, i));
|
||||
}
|
||||
|
||||
const char *name = sqlite3_column_name(stmt, i);
|
||||
row.emplace(name, v);
|
||||
}
|
||||
|
||||
ret[ff->second].push_back(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sqlite3_finalize(stmt) != SQLITE_OK) {
|
||||
fprintf(stderr, "sqlite3 finalize failed: %s\n", sqlite3_errmsg(db));
|
||||
exit(EXIT_SQLITE);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct arg {
|
||||
std::map<zxy, std::vector<std::string>> inputs{};
|
||||
std::map<zxy, std::string> outputs{};
|
||||
|
||||
std::map<std::string, layermap_entry> *layermap = NULL;
|
||||
|
||||
std::vector<std::string> *header = NULL;
|
||||
std::map<std::string, std::vector<std::string>> *mapping = NULL;
|
||||
sqlite3 *db = NULL;
|
||||
std::set<std::string> *exclude = NULL;
|
||||
std::set<std::string> *include = NULL;
|
||||
std::set<std::string> *keep_layers = NULL;
|
||||
std::set<std::string> *remove_layers = NULL;
|
||||
int ifmatched = 0;
|
||||
json_object *filter = NULL;
|
||||
struct tileset_reader *readers = NULL;
|
||||
|
||||
double minlat, minlon;
|
||||
double maxlat, maxlon;
|
||||
double minlon2, maxlon2;
|
||||
};
|
||||
|
||||
void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<std::string, layermap_entry> &layermap, std::vector<std::string> &header, std::map<std::string, std::vector<std::string>> &mapping, sqlite3 *db, std::set<std::string> &exclude, std::set<std::string> &include, std::set<std::string> &keep_layers, std::set<std::string> &remove_layers, int ifmatched, mvt_tile &outtile, json_object *filter, struct arg *a) {
|
||||
mvt_tile tile;
|
||||
int features_added = 0;
|
||||
bool was_compressed;
|
||||
@@ -138,96 +253,210 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
}
|
||||
}
|
||||
|
||||
auto tilestats = layermap.find(layer.name);
|
||||
std::vector<std::vector<std::map<std::string, mvt_value>>> joined;
|
||||
if (db != NULL) {
|
||||
// collect join keys for sql query
|
||||
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature feat = layer.features[f];
|
||||
std::set<std::string> exclude_attributes;
|
||||
std::vector<mvt_value> join_keys;
|
||||
join_keys.resize(layer.features.size());
|
||||
|
||||
if (filter != NULL && !evaluate(feat, layer, filter, exclude_attributes, z, unidecode_data)) {
|
||||
continue;
|
||||
}
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature &feat = layer.features[f];
|
||||
join_keys[f].type = mvt_no_such_key;
|
||||
|
||||
mvt_feature outfeature;
|
||||
int matched = 0;
|
||||
|
||||
if (feat.has_id) {
|
||||
outfeature.has_id = true;
|
||||
outfeature.id = feat.id;
|
||||
}
|
||||
|
||||
std::map<std::string, std::pair<mvt_value, serial_val>> attributes;
|
||||
std::vector<std::string> key_order;
|
||||
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
const char *key = layer.keys[feat.tags[t]].c_str();
|
||||
mvt_value &val = layer.values[feat.tags[t + 1]];
|
||||
serial_val sv = mvt_value_to_serial_val(val);
|
||||
|
||||
if (sv.type == mvt_null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (include.count(std::string(key)) || (!exclude_all && exclude.count(std::string(key)) == 0 && exclude_attributes.count(std::string(key)) == 0)) {
|
||||
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
|
||||
key_order.push_back(key);
|
||||
}
|
||||
|
||||
if (header.size() > 0 && strcmp(key, header[0].c_str()) == 0) {
|
||||
std::map<std::string, std::vector<std::string>>::iterator ii = mapping.find(sv.s);
|
||||
|
||||
if (ii != mapping.end()) {
|
||||
std::vector<std::string> fields = ii->second;
|
||||
matched = 1;
|
||||
|
||||
for (size_t i = 1; i < fields.size(); i++) {
|
||||
std::string joinkey = header[i];
|
||||
std::string joinval = fields[i];
|
||||
int attr_type = mvt_string;
|
||||
|
||||
if (joinval.size() > 0) {
|
||||
if (joinval[0] == '"') {
|
||||
joinval = csv_dequote(joinval);
|
||||
} else if (is_number(joinval)) {
|
||||
attr_type = mvt_double;
|
||||
}
|
||||
} else if (pe) {
|
||||
attr_type = mvt_null;
|
||||
}
|
||||
|
||||
const char *sjoinkey = joinkey.c_str();
|
||||
|
||||
if (include.count(joinkey) || (!exclude_all && exclude.count(joinkey) == 0 && exclude_attributes.count(joinkey) == 0 && attr_type != mvt_null)) {
|
||||
mvt_value outval;
|
||||
if (attr_type == mvt_string) {
|
||||
outval.type = mvt_string;
|
||||
outval.set_string_value(joinval);
|
||||
} else {
|
||||
outval.type = mvt_double;
|
||||
outval.numeric_value.double_value = atof(joinval.c_str());
|
||||
}
|
||||
|
||||
auto fa = attributes.find(sjoinkey);
|
||||
if (fa != attributes.end()) {
|
||||
attributes.erase(fa);
|
||||
}
|
||||
|
||||
serial_val outsv;
|
||||
outsv.type = outval.type;
|
||||
outsv.s = joinval;
|
||||
|
||||
// Convert from double to int if the joined attribute is an integer
|
||||
outval = stringified_to_mvt_value(outval.type, joinval.c_str(), tile_stringpool);
|
||||
|
||||
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(joinkey, std::pair<mvt_value, serial_val>(outval, outsv)));
|
||||
key_order.push_back(joinkey);
|
||||
}
|
||||
}
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
const std::string &key = layer.keys[feat.tags[t]];
|
||||
if (key == join_tile_attribute) {
|
||||
const mvt_value &val = layer.values[feat.tags[t + 1]];
|
||||
join_keys[f] = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (matched || !ifmatched) {
|
||||
joined = get_joined_rows(db, join_keys);
|
||||
}
|
||||
|
||||
auto tilestats = layermap.find(layer.name);
|
||||
|
||||
long long minx = LLONG_MAX;
|
||||
long long miny = LLONG_MAX;
|
||||
long long maxx = LLONG_MIN;
|
||||
long long maxy = LLONG_MIN;
|
||||
|
||||
long long minx2 = LLONG_MAX;
|
||||
long long maxx2 = LLONG_MIN;
|
||||
bool features_added_to_layer = false;
|
||||
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature &feat = layer.features[f];
|
||||
|
||||
std::set<std::string> exclude_attributes;
|
||||
if (filter != NULL && !evaluate(feat, layer, filter, exclude_attributes, z, unidecode_data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
struct match {
|
||||
bool has_id = false;
|
||||
unsigned long long id;
|
||||
std::map<std::string, std::pair<mvt_value, serial_val>> attributes;
|
||||
std::vector<std::string> key_order;
|
||||
};
|
||||
|
||||
std::vector<match> matches;
|
||||
bool matched = false;
|
||||
|
||||
// start filling out sql matches
|
||||
|
||||
if (f < joined.size()) {
|
||||
if (joined[f].size() > 0) {
|
||||
matched = true;
|
||||
}
|
||||
|
||||
for (auto const &joined_feature : joined[f]) {
|
||||
match m;
|
||||
m.has_id = feat.has_id;
|
||||
m.id = feat.id;
|
||||
|
||||
if (!exclude_all_tile_attributes) {
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
const std::string &key = layer.keys[feat.tags[t]];
|
||||
mvt_value &val = layer.values[feat.tags[t + 1]];
|
||||
serial_val sv = mvt_value_to_serial_val(val);
|
||||
|
||||
if (include.count(key) || (!exclude_all && exclude.count(key) == 0 && exclude_attributes.count(key) == 0)) {
|
||||
m.attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
|
||||
m.key_order.push_back(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto const &kv : joined_feature) {
|
||||
if (kv.first == attribute_for_id) {
|
||||
m.has_id = true;
|
||||
m.id = mvt_value_to_long_long(kv.second);
|
||||
} else if (include.count(kv.first) || (!exclude_all && exclude.count(kv.first) == 0 && exclude_attributes.count(kv.first) == 0)) {
|
||||
if (kv.second.type != mvt_null) {
|
||||
m.attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(kv.first, std::pair<mvt_value, serial_val>(kv.second, mvt_value_to_serial_val(kv.second))));
|
||||
m.key_order.push_back(kv.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matches.push_back(m);
|
||||
}
|
||||
}
|
||||
|
||||
// look for csv matches and start filling them out
|
||||
|
||||
if (!matched) {
|
||||
match m;
|
||||
m.id = feat.id;
|
||||
m.has_id = feat.has_id;
|
||||
// populate attributes and key_order as we look for matches,
|
||||
// because apparently at some point i thought it was important
|
||||
// to insert the joined attributes at the point in the sequence
|
||||
// where the join key had been
|
||||
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
const std::string &key = layer.keys[feat.tags[t]];
|
||||
mvt_value &val = layer.values[feat.tags[t + 1]];
|
||||
serial_val sv = mvt_value_to_serial_val(val);
|
||||
|
||||
if (val.type == mvt_null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!exclude_all_tile_attributes) {
|
||||
if (include.count(std::string(key)) || (!exclude_all && exclude.count(std::string(key)) == 0 && exclude_attributes.count(std::string(key)) == 0)) {
|
||||
m.attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
|
||||
m.key_order.push_back(key);
|
||||
}
|
||||
}
|
||||
|
||||
if (header.size() > 0 && key == header[0]) {
|
||||
std::map<std::string, std::vector<std::string>>::iterator ii = mapping.find(sv.s);
|
||||
|
||||
if (ii != mapping.end()) {
|
||||
std::vector<std::string> fields = ii->second;
|
||||
matched = true;
|
||||
|
||||
for (size_t i = 1; i < fields.size(); i++) {
|
||||
std::string joinkey = header[i];
|
||||
std::string joinval = fields[i];
|
||||
int attr_type = mvt_string;
|
||||
|
||||
if (joinval.size() > 0) {
|
||||
if (joinval[0] == '"') {
|
||||
joinval = csv_dequote(joinval);
|
||||
} else if (is_number(joinval)) {
|
||||
attr_type = mvt_double;
|
||||
}
|
||||
} else if (pe) {
|
||||
attr_type = mvt_null;
|
||||
}
|
||||
|
||||
const char *sjoinkey = joinkey.c_str();
|
||||
|
||||
if (include.count(joinkey) || (!exclude_all && exclude.count(joinkey) == 0 && exclude_attributes.count(joinkey) == 0 && attr_type != mvt_null)) {
|
||||
mvt_value outval;
|
||||
if (attr_type == mvt_string) {
|
||||
outval.type = mvt_string;
|
||||
outval.set_string_value(joinval);
|
||||
} else {
|
||||
outval.type = mvt_double;
|
||||
outval.numeric_value.double_value = atof(joinval.c_str());
|
||||
}
|
||||
|
||||
auto fa = m.attributes.find(sjoinkey);
|
||||
if (fa != m.attributes.end()) {
|
||||
m.attributes.erase(fa);
|
||||
}
|
||||
|
||||
serial_val outsv;
|
||||
outsv.type = outval.type;
|
||||
outsv.s = joinval;
|
||||
|
||||
outval = stringified_to_mvt_value(outval.type, joinval.c_str(), tile_stringpool);
|
||||
|
||||
m.attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(joinkey, std::pair<mvt_value, serial_val>(outval, outsv)));
|
||||
m.key_order.push_back(joinkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (matched) {
|
||||
matches.push_back(m);
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched && !ifmatched) {
|
||||
// no matches, but they said to keep even unmatched tile features,
|
||||
// so make one that is just the original feature
|
||||
|
||||
match m;
|
||||
m.id = feat.id;
|
||||
m.has_id = feat.has_id;
|
||||
|
||||
if (!exclude_all_tile_attributes) {
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
const std::string &key = layer.keys[feat.tags[t]];
|
||||
mvt_value &val = layer.values[feat.tags[t + 1]];
|
||||
serial_val sv = mvt_value_to_serial_val(val);
|
||||
|
||||
if (include.count(key) || (!exclude_all && exclude.count(key) == 0 && exclude_attributes.count(key) == 0)) {
|
||||
m.attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
|
||||
m.key_order.push_back(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matches.push_back(m);
|
||||
}
|
||||
|
||||
for (auto &m : matches) {
|
||||
if (tilestats == layermap.end()) {
|
||||
layermap.insert(std::pair<std::string, layermap_entry>(layer.name, layermap_entry(layermap.size())));
|
||||
tilestats = layermap.find(layer.name);
|
||||
@@ -235,14 +464,18 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
tilestats->second.maxzoom = z;
|
||||
}
|
||||
|
||||
// To keep attributes in their original order instead of alphabetical
|
||||
for (auto k : key_order) {
|
||||
auto fa = attributes.find(k);
|
||||
mvt_feature outfeature;
|
||||
outfeature.id = m.id;
|
||||
outfeature.has_id = m.has_id;
|
||||
|
||||
if (fa != attributes.end()) {
|
||||
// To keep attributes in their original order instead of alphabetical
|
||||
for (auto k : m.key_order) {
|
||||
auto fa = m.attributes.find(k);
|
||||
|
||||
if (fa != m.attributes.end()) {
|
||||
outlayer.tag(outfeature, k, fa->second.first);
|
||||
add_to_tilestats(tilestats->second.tilestats, k, fa->second.second);
|
||||
attributes.erase(fa);
|
||||
m.attributes.erase(fa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +489,37 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
}
|
||||
}
|
||||
|
||||
for (auto const &g : outfeature.geometry) {
|
||||
if (g.op == mvt_moveto || g.op == mvt_lineto) {
|
||||
// pin to the tile extent, since we don't want bounds bigger than the earth
|
||||
long long gx = std::min((long long) outlayer.extent, std::max(0LL, g.x));
|
||||
long long gy = std::min((long long) outlayer.extent, std::max(0LL, g.y));
|
||||
|
||||
// to world scale
|
||||
gx = gx * (1LL << (32 - z)) / outlayer.extent;
|
||||
gy = gy * (1LL << (32 - z)) / outlayer.extent;
|
||||
|
||||
// to world offset
|
||||
gx += (1LL << (32 - z)) * x;
|
||||
gy += (1LL << (32 - z)) * y;
|
||||
|
||||
minx = std::min(minx, gx);
|
||||
miny = std::min(miny, gy);
|
||||
maxx = std::max(maxx, gx);
|
||||
maxy = std::max(maxy, gy);
|
||||
|
||||
// if in the western hemisphere, try shifting to east
|
||||
if (gx < (1LL << 31)) {
|
||||
gx += 1LL << 32;
|
||||
}
|
||||
|
||||
minx2 = std::min(minx2, gx);
|
||||
maxx2 = std::max(maxx2, gx);
|
||||
}
|
||||
}
|
||||
|
||||
features_added++;
|
||||
features_added_to_layer = true;
|
||||
outlayer.features.push_back(outfeature);
|
||||
|
||||
if (z < tilestats->second.minzoom) {
|
||||
@@ -275,6 +538,24 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (features_added_to_layer) {
|
||||
double lat1, lon1;
|
||||
double lat2, lon2;
|
||||
tile2lonlat(minx, maxy, 32, &lon1, &lat1);
|
||||
tile2lonlat(maxx, miny, 32, &lon2, &lat2);
|
||||
|
||||
a->minlat = std::min(a->minlat, std::min(lat1, lat2));
|
||||
a->minlon = std::min(a->minlon, std::min(lon1, lon2));
|
||||
a->maxlat = std::max(a->maxlat, std::max(lat1, lat2));
|
||||
a->maxlon = std::max(a->maxlon, std::max(lon1, lon2));
|
||||
|
||||
tile2lonlat(minx2, maxy, 32, &lon1, &lat1);
|
||||
tile2lonlat(maxx2, miny, 32, &lon2, &lat2);
|
||||
|
||||
a->minlon2 = std::min(a->minlon2, std::min(lon1, lon2));
|
||||
a->maxlon2 = std::max(a->maxlon2, std::max(lon1, lon2));
|
||||
}
|
||||
}
|
||||
|
||||
if (features_added == 0) {
|
||||
@@ -282,22 +563,6 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
}
|
||||
}
|
||||
|
||||
double min(double a, double b) {
|
||||
if (a < b) {
|
||||
return a;
|
||||
} else {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
double max(double a, double b) {
|
||||
if (a > b) {
|
||||
return a;
|
||||
} else {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
struct tilecmp {
|
||||
bool operator()(std::pair<unsigned, unsigned> const &a, std::pair<unsigned, unsigned> const &b) {
|
||||
// must match behavior of tileset_reader::operator<()
|
||||
@@ -716,7 +981,8 @@ struct tileset_reader {
|
||||
std::set<std::string>(), std::set<std::string>(), std::vector<std::string>(),
|
||||
false, &next_overzoomed_tiles, false, NULL, false,
|
||||
std::unordered_map<std::string, attribute_op>(), unidecode_data, 0, 0,
|
||||
std::vector<mvt_layer>(), "", "", SIZE_MAX);
|
||||
std::vector<mvt_layer>(), "", "", SIZE_MAX,
|
||||
std::vector<clipbbox>(), false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -734,23 +1000,6 @@ struct tileset_reader *begin_reading(char *fname) {
|
||||
return r;
|
||||
}
|
||||
|
||||
struct arg {
|
||||
std::map<zxy, std::vector<std::string>> inputs{};
|
||||
std::map<zxy, std::string> outputs{};
|
||||
|
||||
std::map<std::string, layermap_entry> *layermap = NULL;
|
||||
|
||||
std::vector<std::string> *header = NULL;
|
||||
std::map<std::string, std::vector<std::string>> *mapping = NULL;
|
||||
std::set<std::string> *exclude = NULL;
|
||||
std::set<std::string> *include = NULL;
|
||||
std::set<std::string> *keep_layers = NULL;
|
||||
std::set<std::string> *remove_layers = NULL;
|
||||
int ifmatched = 0;
|
||||
json_object *filter = NULL;
|
||||
struct tileset_reader *readers = NULL;
|
||||
};
|
||||
|
||||
void *join_worker(void *v) {
|
||||
arg *a = (arg *) v;
|
||||
|
||||
@@ -758,7 +1007,7 @@ void *join_worker(void *v) {
|
||||
mvt_tile tile;
|
||||
|
||||
for (size_t i = 0; i < ai->second.size(); i++) {
|
||||
append_tile(ai->second[i], ai->first.z, ai->first.x, ai->first.y, *(a->layermap), *(a->header), *(a->mapping), *(a->exclude), *(a->include), *(a->keep_layers), *(a->remove_layers), a->ifmatched, tile, a->filter);
|
||||
append_tile(ai->second[i], ai->first.z, ai->first.x, ai->first.y, *(a->layermap), *(a->header), *(a->mapping), a->db, *(a->exclude), *(a->include), *(a->keep_layers), *(a->remove_layers), a->ifmatched, tile, a->filter, a);
|
||||
}
|
||||
|
||||
ai->second.clear();
|
||||
@@ -793,7 +1042,7 @@ void *join_worker(void *v) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void dispatch_tasks(std::map<zxy, std::vector<std::string>> &tasks, std::vector<std::map<std::string, layermap_entry>> &layermaps, sqlite3 *outdb, const char *outdir, std::vector<std::string> &header, std::map<std::string, std::vector<std::string>> &mapping, std::set<std::string> &exclude, std::set<std::string> &include, int ifmatched, std::set<std::string> &keep_layers, std::set<std::string> &remove_layers, json_object *filter, struct tileset_reader *readers) {
|
||||
void dispatch_tasks(std::map<zxy, std::vector<std::string>> &tasks, std::vector<std::map<std::string, layermap_entry>> &layermaps, sqlite3 *outdb, const char *outdir, std::vector<std::string> &header, std::map<std::string, std::vector<std::string>> &mapping, sqlite3 *db, std::set<std::string> &exclude, std::set<std::string> &include, int ifmatched, std::set<std::string> &keep_layers, std::set<std::string> &remove_layers, json_object *filter, struct tileset_reader *readers, double *minlat, double *minlon, double *maxlat, double *maxlon, double *minlon2, double *maxlon2) {
|
||||
pthread_t pthreads[CPUS];
|
||||
std::vector<arg> args;
|
||||
|
||||
@@ -803,6 +1052,7 @@ void dispatch_tasks(std::map<zxy, std::vector<std::string>> &tasks, std::vector<
|
||||
args[i].layermap = &layermaps[i];
|
||||
args[i].header = &header;
|
||||
args[i].mapping = &mapping;
|
||||
args[i].db = db;
|
||||
args[i].exclude = &exclude;
|
||||
args[i].include = &include;
|
||||
args[i].keep_layers = &keep_layers;
|
||||
@@ -810,6 +1060,12 @@ void dispatch_tasks(std::map<zxy, std::vector<std::string>> &tasks, std::vector<
|
||||
args[i].ifmatched = ifmatched;
|
||||
args[i].filter = filter;
|
||||
args[i].readers = readers;
|
||||
args[i].minlat = *minlat;
|
||||
args[i].minlon = *minlon;
|
||||
args[i].maxlat = *maxlat;
|
||||
args[i].maxlon = *maxlon;
|
||||
args[i].minlon2 = *minlon2;
|
||||
args[i].maxlon2 = *maxlon2;
|
||||
}
|
||||
|
||||
size_t count = 0;
|
||||
@@ -842,6 +1098,13 @@ void dispatch_tasks(std::map<zxy, std::vector<std::string>> &tasks, std::vector<
|
||||
perror("pthread_join");
|
||||
}
|
||||
|
||||
*minlat = std::min(*minlat, args[i].minlat);
|
||||
*minlon = std::min(*minlon, args[i].minlon);
|
||||
*maxlat = std::max(*maxlat, args[i].maxlat);
|
||||
*maxlon = std::max(*maxlon, args[i].maxlon);
|
||||
*minlon2 = std::min(*minlon2, args[i].minlon2);
|
||||
*maxlon2 = std::max(*maxlon2, args[i].maxlon2);
|
||||
|
||||
for (auto ai = args[i].outputs.begin(); ai != args[i].outputs.end(); ++ai) {
|
||||
if (outdb != NULL) {
|
||||
mbtiles_write_tile(outdb, ai->first.z, ai->first.x, ai->first.y, ai->second.data(), ai->second.size());
|
||||
@@ -943,7 +1206,7 @@ void handle_vector_layers(json_object *vector_layers, std::map<std::string, laye
|
||||
}
|
||||
}
|
||||
|
||||
void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry> &layermap, sqlite3 *outdb, const char *outdir, struct stats *st, std::vector<std::string> &header, std::map<std::string, std::vector<std::string>> &mapping, std::set<std::string> &exclude, std::set<std::string> &include, int ifmatched, std::string &attribution, std::string &description, std::set<std::string> &keep_layers, std::set<std::string> &remove_layers, std::string &name, json_object *filter, std::map<std::string, std::string> &attribute_descriptions, std::string &generator_options, std::vector<strategy> *strategies) {
|
||||
void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry> &layermap, sqlite3 *outdb, const char *outdir, struct stats *st, std::vector<std::string> &header, std::map<std::string, std::vector<std::string>> &mapping, sqlite3 *db, std::set<std::string> &exclude, std::set<std::string> &include, int ifmatched, std::string &attribution, std::string &description, std::set<std::string> &keep_layers, std::set<std::string> &remove_layers, std::string &name, json_object *filter, std::map<std::string, std::string> &attribute_descriptions, std::string &generator_options, std::vector<strategy> *strategies) {
|
||||
std::vector<std::map<std::string, layermap_entry>> layermaps;
|
||||
for (size_t i = 0; i < CPUS; i++) {
|
||||
layermaps.push_back(std::map<std::string, layermap_entry>());
|
||||
@@ -956,36 +1219,10 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
|
||||
double maxlon = INT_MIN;
|
||||
double minlon2 = INT_MAX;
|
||||
double maxlon2 = INT_MIN;
|
||||
int zoom_for_bbox = -1;
|
||||
|
||||
while (readers != NULL && !readers->all_done()) {
|
||||
std::pair<zxy, std::string> current = readers->current();
|
||||
|
||||
if (current.first.z != zoom_for_bbox) {
|
||||
// Only use highest zoom for bbox calculation
|
||||
// to avoid z0 always covering the world
|
||||
|
||||
minlat = minlon = minlon2 = INT_MAX;
|
||||
maxlat = maxlon = maxlon2 = INT_MIN;
|
||||
zoom_for_bbox = current.first.z;
|
||||
}
|
||||
|
||||
double lat1, lon1, lat2, lon2;
|
||||
tile2lonlat(current.first.x, current.first.y, current.first.z, &lon1, &lat1);
|
||||
tile2lonlat(current.first.x + 1, current.first.y + 1, current.first.z, &lon2, &lat2);
|
||||
minlat = min(lat2, minlat);
|
||||
minlon = min(lon1, minlon);
|
||||
maxlat = max(lat1, maxlat);
|
||||
maxlon = max(lon2, maxlon);
|
||||
|
||||
if (lon1 < 0) {
|
||||
lon1 += 360;
|
||||
lon2 += 360;
|
||||
}
|
||||
|
||||
minlon2 = min(lon1, minlon2);
|
||||
maxlon2 = max(lon2, maxlon2);
|
||||
|
||||
if (current.first.z >= minzoom && current.first.z <= maxzoom) {
|
||||
zxy tile = current.first;
|
||||
if (tasks.count(tile) == 0) {
|
||||
@@ -1012,7 +1249,7 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
|
||||
|
||||
if (readers == NULL || readers->zoom != current.first.z || readers->x != current.first.x || readers->y != current.first.y) {
|
||||
if (tasks.size() > 100 * CPUS) {
|
||||
dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers);
|
||||
dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, db, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers, &minlat, &minlon, &maxlat, &maxlon, &minlon2, &maxlon2);
|
||||
tasks.clear();
|
||||
}
|
||||
}
|
||||
@@ -1031,19 +1268,19 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
|
||||
*rr = r;
|
||||
}
|
||||
|
||||
st->minlon = min(minlon, st->minlon);
|
||||
st->maxlon = max(maxlon, st->maxlon);
|
||||
st->minlat = min(minlat, st->minlat);
|
||||
st->maxlat = max(maxlat, st->maxlat);
|
||||
|
||||
st->minlon2 = min(minlon2, st->minlon2);
|
||||
st->maxlon2 = max(maxlon2, st->maxlon2);
|
||||
st->minlat2 = min(minlat, st->minlat2);
|
||||
st->maxlat2 = max(maxlat, st->maxlat2);
|
||||
|
||||
dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers);
|
||||
dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, db, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers, &minlat, &minlon, &maxlat, &maxlon, &minlon2, &maxlon2);
|
||||
layermap = merge_layermaps(layermaps);
|
||||
|
||||
st->minlon = std::min(minlon, st->minlon);
|
||||
st->maxlon = std::max(maxlon, st->maxlon);
|
||||
st->minlat = std::min(minlat, st->minlat);
|
||||
st->maxlat = std::max(maxlat, st->maxlat);
|
||||
|
||||
st->minlon2 = std::min(minlon2, st->minlon2);
|
||||
st->maxlon2 = std::max(maxlon2, st->maxlon2);
|
||||
st->minlat2 = std::min(minlat, st->minlat2);
|
||||
st->maxlat2 = std::max(maxlat, st->maxlat2);
|
||||
|
||||
struct tileset_reader *next;
|
||||
for (struct tileset_reader *r = readers; r != NULL; r = next) {
|
||||
next = r->next;
|
||||
@@ -1052,14 +1289,14 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
|
||||
sqlite3_stmt *stmt;
|
||||
if (sqlite3_prepare_v2(r->db, "SELECT value from metadata where name = 'minzoom'", -1, &stmt, NULL) == SQLITE_OK) {
|
||||
if (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
int minz = max(sqlite3_column_int(stmt, 0), minzoom);
|
||||
st->minzoom = min(st->minzoom, minz);
|
||||
int minz = std::max(sqlite3_column_int(stmt, 0), minzoom);
|
||||
st->minzoom = std::min(st->minzoom, minz);
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
if (sqlite3_prepare_v2(r->db, "SELECT value from metadata where name = 'maxzoom'", -1, &stmt, NULL) == SQLITE_OK) {
|
||||
if (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
int maxz = min(sqlite3_column_int(stmt, 0), maxzoom);
|
||||
int maxz = std::min(sqlite3_column_int(stmt, 0), maxzoom);
|
||||
|
||||
if (!want_overzoom) {
|
||||
if (st->maxzoom >= 0 && maxz != st->maxzoom) {
|
||||
@@ -1067,7 +1304,7 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
|
||||
}
|
||||
}
|
||||
|
||||
st->maxzoom = max(st->maxzoom, maxz);
|
||||
st->maxzoom = std::max(st->maxzoom, maxz);
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
@@ -1114,20 +1351,6 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
if (sqlite3_prepare_v2(r->db, "SELECT value from metadata where name = 'bounds'", -1, &stmt, NULL) == SQLITE_OK) {
|
||||
if (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
const unsigned char *s = sqlite3_column_text(stmt, 0);
|
||||
if (s != NULL) {
|
||||
if (sscanf((char *) s, "%lf,%lf,%lf,%lf", &minlon, &minlat, &maxlon, &maxlat) == 4) {
|
||||
st->minlon = min(minlon, st->minlon);
|
||||
st->maxlon = max(maxlon, st->maxlon);
|
||||
st->minlat = min(minlat, st->minlat);
|
||||
st->maxlat = max(maxlat, st->maxlat);
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
if (sqlite3_prepare_v2(r->db, "SELECT value from metadata where name = 'json'", -1, &stmt, NULL) == SQLITE_OK) {
|
||||
if (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
const unsigned char *s = sqlite3_column_text(stmt, 0);
|
||||
@@ -1196,9 +1419,11 @@ int main(int argc, char **argv) {
|
||||
int filearg = 0;
|
||||
json_object *filter = NULL;
|
||||
|
||||
std::string join_sqlite_fname;
|
||||
|
||||
struct tileset_reader *readers = NULL;
|
||||
|
||||
CPUS = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
CPUS = get_num_avail_cpus();
|
||||
|
||||
const char *TIPPECANOE_MAX_THREADS = getenv("TIPPECANOE_MAX_THREADS");
|
||||
if (TIPPECANOE_MAX_THREADS != NULL) {
|
||||
@@ -1208,8 +1433,14 @@ int main(int argc, char **argv) {
|
||||
CPUS = 1;
|
||||
}
|
||||
|
||||
if (sqlite3_config(SQLITE_CONFIG_SERIALIZED) != SQLITE_OK) {
|
||||
fprintf(stderr, "Could not enable sqlite3 serialized multithreading\n");
|
||||
exit(EXIT_SQLITE);
|
||||
}
|
||||
|
||||
std::vector<std::string> header;
|
||||
std::map<std::string, std::vector<std::string>> mapping;
|
||||
sqlite3 *db = NULL;
|
||||
|
||||
std::set<std::string> exclude;
|
||||
std::set<std::string> include;
|
||||
@@ -1233,6 +1464,7 @@ int main(int argc, char **argv) {
|
||||
{"exclude", required_argument, 0, 'x'},
|
||||
{"exclude-all", no_argument, 0, 'X'},
|
||||
{"include", required_argument, 0, 'y'},
|
||||
{"exclude-all-tile-attributes", no_argument, 0, '~'},
|
||||
{"layer", required_argument, 0, 'l'},
|
||||
{"exclude-layer", required_argument, 0, 'L'},
|
||||
{"quiet", no_argument, 0, 'q'},
|
||||
@@ -1243,6 +1475,13 @@ int main(int argc, char **argv) {
|
||||
{"rename-layer", required_argument, 0, 'R'},
|
||||
{"read-from", required_argument, 0, 'r'},
|
||||
|
||||
{"join-sqlite", required_argument, 0, '~'},
|
||||
{"join-tile-attribute", required_argument, 0, '~'},
|
||||
{"join-table-expression", required_argument, 0, '~'},
|
||||
{"join-table", required_argument, 0, '~'},
|
||||
{"join-count-limit", required_argument, 0, '~'},
|
||||
{"use-attribute-for-id", required_argument, 0, '~'},
|
||||
|
||||
{"no-tile-size-limit", no_argument, &pk, 1},
|
||||
{"no-tile-compression", no_argument, &pC, 1},
|
||||
{"empty-csv-columns-are-null", no_argument, &pe, 1},
|
||||
@@ -1427,6 +1666,24 @@ int main(int argc, char **argv) {
|
||||
max_tilestats_values = atoi(optarg);
|
||||
} else if (strcmp(opt, "unidecode-data") == 0) {
|
||||
unidecode_data = read_unidecode(optarg);
|
||||
} else if (strcmp(opt, "join-sqlite") == 0) {
|
||||
join_sqlite_fname = optarg;
|
||||
if (sqlite3_open(optarg, &db) != SQLITE_OK) {
|
||||
fprintf(stderr, "%s: %s\n", optarg, sqlite3_errmsg(db));
|
||||
exit(EXIT_SQLITE);
|
||||
}
|
||||
} else if (strcmp(opt, "join-table") == 0) {
|
||||
join_table = optarg;
|
||||
} else if (strcmp(opt, "join-table-expression") == 0) {
|
||||
join_table_expression = optarg;
|
||||
} else if (strcmp(opt, "join-tile-attribute") == 0) {
|
||||
join_tile_attribute = optarg;
|
||||
} else if (strcmp(opt, "use-attribute-for-id") == 0) {
|
||||
attribute_for_id = optarg;
|
||||
} else if (strcmp(opt, "exclude-all-tile-attributes") == 0) {
|
||||
exclude_all_tile_attributes = true;
|
||||
} else if (strcmp(opt, "join-count-limit") == 0) {
|
||||
join_count_limit = atoi(optarg);
|
||||
} else {
|
||||
fprintf(stderr, "%s: Unrecognized option --%s\n", argv[0], opt);
|
||||
exit(EXIT_ARGS);
|
||||
@@ -1508,7 +1765,7 @@ int main(int argc, char **argv) {
|
||||
std::string generator_options;
|
||||
std::vector<strategy> strategies;
|
||||
|
||||
decode(readers, layermap, outdb, out_dir, &st, header, mapping, exclude, include, ifmatched, attribution, description, keep_layers, remove_layers, name, filter, 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;
|
||||
@@ -1539,6 +1796,10 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (st.maxlon < st.minlon) {
|
||||
st.maxlon = st.minlon = st.maxlat = st.minlat = st.minlon2 = st.maxlon2 = st.minlat2 = st.maxlat2 = 0;
|
||||
}
|
||||
|
||||
if (st.maxlon - st.minlon <= st.maxlon2 - st.minlon2) {
|
||||
st.minlon2 = st.minlon;
|
||||
st.maxlon2 = st.maxlon;
|
||||
|
||||
@@ -92,13 +92,17 @@ static bool draws_something(drawvec const &geom) {
|
||||
|
||||
// comparator for --preserve-input-order, to reorder features back to their original input sequence
|
||||
static struct preservecmp {
|
||||
bool operator()(const std::vector<serial_feature> &a, const std::vector<serial_feature> &b) {
|
||||
bool operator()(const std::vector<std::shared_ptr<serial_feature>> &a, const std::vector<std::shared_ptr<serial_feature>> &b) {
|
||||
return operator()(a[0], b[0]);
|
||||
}
|
||||
|
||||
bool operator()(const serial_feature &a, const serial_feature &b) {
|
||||
return a.seq < b.seq;
|
||||
}
|
||||
|
||||
bool operator()(const std::shared_ptr<serial_feature> &a, const std::shared_ptr<serial_feature> &b) {
|
||||
return a->seq < b->seq;
|
||||
}
|
||||
} preservecmp;
|
||||
|
||||
static int metacmp(const serial_feature &one, const serial_feature &two);
|
||||
@@ -190,8 +194,8 @@ struct coalindexcmp_comparator {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
bool operator()(const serial_feature &a, const serial_feature &o) const {
|
||||
int cmp = coalindexcmp(&a, &o);
|
||||
bool operator()(const std::shared_ptr<serial_feature> &a, const std::shared_ptr<serial_feature> &o) const {
|
||||
int cmp = coalindexcmp(&*a, &*o);
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -203,9 +207,9 @@ struct coalindexcmp_comparator {
|
||||
static unsigned long long calculate_drop_sequence(serial_feature const &sf);
|
||||
|
||||
struct drop_sequence_cmp {
|
||||
bool operator()(const serial_feature &a, const serial_feature &b) {
|
||||
unsigned long long a_seq = calculate_drop_sequence(a);
|
||||
unsigned long long b_seq = calculate_drop_sequence(b);
|
||||
bool operator()(const std::shared_ptr<serial_feature> &a, const std::shared_ptr<serial_feature> &b) {
|
||||
unsigned long long a_seq = calculate_drop_sequence(*a);
|
||||
unsigned long long b_seq = calculate_drop_sequence(*b);
|
||||
|
||||
// sorts backwards, to put the features that would be dropped last, first here
|
||||
if (a_seq > b_seq) {
|
||||
@@ -336,14 +340,14 @@ static mvt_value coerce_double(mvt_value v) {
|
||||
// compare features numerically according to that sort key until the keys are exhausted.
|
||||
// If there is a tie, the feature with the earlier index (centroid) comes first.
|
||||
struct ordercmp {
|
||||
bool operator()(const std::vector<serial_feature> &a, const std::vector<serial_feature> &b) {
|
||||
bool operator()(const std::vector<std::shared_ptr<serial_feature>> &a, const std::vector<std::shared_ptr<serial_feature>> &b) {
|
||||
return operator()(a[0], b[0]);
|
||||
}
|
||||
|
||||
bool operator()(const serial_feature &a, const serial_feature &b) {
|
||||
bool operator()(const std::shared_ptr<serial_feature> &a, const std::shared_ptr<serial_feature> &b) {
|
||||
for (size_t i = 0; i < order_by.size(); i++) {
|
||||
mvt_value v1 = coerce_double(find_attribute_value(&a, order_by[i].name));
|
||||
mvt_value v2 = coerce_double(find_attribute_value(&b, order_by[i].name));
|
||||
mvt_value v1 = coerce_double(find_attribute_value(&*a, order_by[i].name));
|
||||
mvt_value v2 = coerce_double(find_attribute_value(&*b, order_by[i].name));
|
||||
|
||||
if (order_by[i].descending) {
|
||||
if (v2 < v1) {
|
||||
@@ -360,7 +364,7 @@ struct ordercmp {
|
||||
}
|
||||
}
|
||||
|
||||
if (a.index < b.index) {
|
||||
if (a->index < b->index) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -370,12 +374,12 @@ struct ordercmp {
|
||||
|
||||
// For --retain-points-multiplier: Go through a list of features and return a list of clusters of features,
|
||||
// creating a new cluster whenever the tippecanoe:retain_points_multiplier_first attribute is seen.
|
||||
static std::vector<std::vector<serial_feature>> assemble_multiplier_clusters(std::vector<serial_feature> const &features) {
|
||||
std::vector<std::vector<serial_feature>> clusters;
|
||||
static std::vector<std::vector<std::shared_ptr<serial_feature>>> assemble_multiplier_clusters(std::vector<std::shared_ptr<serial_feature>> const &features) {
|
||||
std::vector<std::vector<std::shared_ptr<serial_feature>>> clusters;
|
||||
|
||||
if (retain_points_multiplier == 1) {
|
||||
for (auto const &feature : features) {
|
||||
std::vector<serial_feature> cluster;
|
||||
std::vector<std::shared_ptr<serial_feature>> cluster;
|
||||
cluster.push_back(std::move(feature));
|
||||
clusters.push_back(std::move(cluster));
|
||||
}
|
||||
@@ -383,8 +387,8 @@ static std::vector<std::vector<serial_feature>> assemble_multiplier_clusters(std
|
||||
for (auto const &feature : features) {
|
||||
bool is_cluster_start = false;
|
||||
|
||||
for (size_t i = 0; i < feature.full_keys.size(); i++) {
|
||||
if (*feature.full_keys[i] == "tippecanoe:retain_points_multiplier_first") {
|
||||
for (size_t i = 0; i < feature->full_keys.size(); i++) {
|
||||
if (*feature->full_keys[i] == "tippecanoe:retain_points_multiplier_first") {
|
||||
is_cluster_start = true;
|
||||
break;
|
||||
}
|
||||
@@ -404,20 +408,20 @@ static std::vector<std::vector<serial_feature>> assemble_multiplier_clusters(std
|
||||
// For --retain-points-multiplier: Flatten a list of clusters of features back into a list of features,
|
||||
// moving the "tippecanoe:retain_points_multiplier_first" attribute onto the first feature of each cluster
|
||||
// if it is not already there.
|
||||
static std::vector<serial_feature> disassemble_multiplier_clusters(std::vector<std::vector<serial_feature>> &clusters) {
|
||||
std::vector<serial_feature> out;
|
||||
static std::vector<std::shared_ptr<serial_feature>> disassemble_multiplier_clusters(std::vector<std::vector<std::shared_ptr<serial_feature>>> &clusters) {
|
||||
std::vector<std::shared_ptr<serial_feature>> out;
|
||||
|
||||
for (auto &cluster : clusters) {
|
||||
// fix up the attributes so the first feature of the multiplier cluster
|
||||
// gets the marker attribute
|
||||
for (size_t i = 0; i < cluster.size(); i++) {
|
||||
for (size_t j = 0; j < cluster[i].full_keys.size(); j++) {
|
||||
if (*cluster[i].full_keys[j] == "tippecanoe:retain_points_multiplier_first") {
|
||||
cluster[0].full_keys.push_back(std::move(cluster[i].full_keys[j]));
|
||||
cluster[0].full_values.push_back(std::move(cluster[i].full_values[j]));
|
||||
for (size_t j = 0; j < cluster[i]->full_keys.size(); j++) {
|
||||
if (*cluster[i]->full_keys[j] == "tippecanoe:retain_points_multiplier_first") {
|
||||
cluster[0]->full_keys.push_back(std::move(cluster[i]->full_keys[j]));
|
||||
cluster[0]->full_values.push_back(std::move(cluster[i]->full_values[j]));
|
||||
|
||||
cluster[i].full_keys.erase(cluster[i].full_keys.begin() + j);
|
||||
cluster[i].full_values.erase(cluster[i].full_values.begin() + j);
|
||||
cluster[i]->full_keys.erase(cluster[i]->full_keys.begin() + j);
|
||||
cluster[i]->full_values.erase(cluster[i]->full_values.begin() + j);
|
||||
|
||||
i = cluster.size(); // break outer
|
||||
break;
|
||||
@@ -534,7 +538,7 @@ static void rewrite(serial_feature const &osf, int z, int nextzoom, int maxzoom,
|
||||
|
||||
// This is the parameter block passed to each simplification worker thread
|
||||
struct simplification_worker_arg {
|
||||
std::vector<serial_feature> *features = NULL;
|
||||
std::vector<std::shared_ptr<serial_feature>> *features = NULL;
|
||||
int task = 0;
|
||||
int tasks = 0;
|
||||
bool trying_to_stop_early = false;
|
||||
@@ -668,19 +672,19 @@ static double simplify_feature(serial_feature *p, drawvec const &shared_nodes, n
|
||||
// simplify and clean the geometry of batches of features.
|
||||
static void *simplification_worker(void *v) {
|
||||
simplification_worker_arg *a = (simplification_worker_arg *) v;
|
||||
std::vector<serial_feature> *features = a->features;
|
||||
std::vector<std::shared_ptr<serial_feature>> *features = a->features;
|
||||
|
||||
for (size_t i = a->task; i < (*features).size(); i += a->tasks) {
|
||||
double area = 0;
|
||||
if (!a->trying_to_stop_early) {
|
||||
area = simplify_feature(&((*features)[i]), *(a->shared_nodes), a->shared_nodes_map, a->nodepos, *(a->shared_nodes_bloom));
|
||||
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;
|
||||
int out_detail = (*features)[i].extra_detail;
|
||||
signed char t = (*features)[i]->t;
|
||||
int z = (*features)[i]->z;
|
||||
int out_detail = (*features)[i]->extra_detail;
|
||||
|
||||
drawvec geom = (*features)[i].geometry;
|
||||
drawvec geom = (*features)[i]->geometry;
|
||||
to_tile_scale(geom, z, out_detail);
|
||||
|
||||
if (t == VT_POLYGON) {
|
||||
@@ -709,15 +713,15 @@ static void *simplification_worker(void *v) {
|
||||
}
|
||||
|
||||
if (t == VT_POLYGON && additional[A_GENERATE_POLYGON_LABEL_POINTS]) {
|
||||
t = (*features)[i].t = VT_POINT;
|
||||
geom = checkerboard_anchors(from_tile_scale(geom, z, out_detail), (*features)[i].tx, (*features)[i].ty, z, (*features)[i].label_point);
|
||||
t = (*features)[i]->t = VT_POINT;
|
||||
geom = checkerboard_anchors(from_tile_scale(geom, z, out_detail), (*features)[i]->tx, (*features)[i]->ty, z, (*features)[i]->label_point);
|
||||
to_tile_scale(geom, z, out_detail);
|
||||
}
|
||||
|
||||
if ((*features)[i].index == 0) {
|
||||
(*features)[i].index = i;
|
||||
if ((*features)[i]->index == 0) {
|
||||
(*features)[i]->index = i;
|
||||
}
|
||||
(*features)[i].geometry = std::move(geom);
|
||||
(*features)[i]->geometry = std::move(geom);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1401,10 +1405,6 @@ void add_tilestats(std::string const &layername, int z, std::vector<std::map<std
|
||||
}
|
||||
|
||||
void promote_attribute(std::string const &key, serial_feature &p, key_pool &key_pool) {
|
||||
if (p.need_tilestats.count(key) == 0) {
|
||||
p.need_tilestats.insert(key);
|
||||
}
|
||||
|
||||
// If the feature being merged into has this key as a metadata reference,
|
||||
// promote it to a full_key so it can be modified
|
||||
|
||||
@@ -1426,10 +1426,6 @@ void promote_attribute(std::string const &key, serial_feature &p, key_pool &key_
|
||||
}
|
||||
|
||||
void promote_attribute_prefix(std::string const &key, std::string const &prefixed_key, serial_feature &p, key_pool &key_pool) {
|
||||
if (p.need_tilestats.count(prefixed_key) == 0) {
|
||||
p.need_tilestats.insert(prefixed_key);
|
||||
}
|
||||
|
||||
// does the prefixed attribute already exist as a full key?
|
||||
ssize_t found_as = -1;
|
||||
for (size_t i = 0; i < p.full_keys.size(); i++) {
|
||||
@@ -1446,6 +1442,7 @@ void promote_attribute_prefix(std::string const &key, std::string const &prefixe
|
||||
if (found_as >= 0) {
|
||||
p.full_keys.push_back(key_pool.pool(prefixed_key));
|
||||
p.full_values.push_back(p.full_values[found_as]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1500,7 +1497,7 @@ void preserve_attributes(std::unordered_map<std::string, attribute_op> const *at
|
||||
sv.s = sf.stringpool + sf.values[i] + 1;
|
||||
|
||||
promote_attribute(key, p, key_pool);
|
||||
preserve_attribute(f->second, key, sv, p.full_keys, p.full_values, p.attribute_accum_state, key_pool);
|
||||
preserve_attribute(f->second, key, sv, p.full_keys, p.full_values, key_pool);
|
||||
} else if (type == mvt_double && accumulate_numeric.size() > 0 && !starts_with(key, accumulate_numeric_colon)) {
|
||||
for (auto const &operation : numeric_operations) {
|
||||
serial_val sv;
|
||||
@@ -1509,7 +1506,7 @@ void preserve_attributes(std::unordered_map<std::string, attribute_op> const *at
|
||||
|
||||
std::string prefixed_key = accumulate_numeric + ":" + operation.first + ":" + key;
|
||||
promote_attribute_prefix(key, prefixed_key, p, key_pool);
|
||||
preserve_attribute(operation.second, prefixed_key, sv, p.full_keys, p.full_values, p.attribute_accum_state, key_pool);
|
||||
preserve_attribute(operation.second, prefixed_key, sv, p.full_keys, p.full_values, key_pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1522,12 +1519,12 @@ void preserve_attributes(std::unordered_map<std::string, attribute_op> const *at
|
||||
const serial_val &sv = sf.full_values[i];
|
||||
|
||||
promote_attribute(key, p, key_pool); // promotes it in the target feature
|
||||
preserve_attribute(f->second, key, sv, p.full_keys, p.full_values, p.attribute_accum_state, key_pool);
|
||||
preserve_attribute(f->second, key, sv, p.full_keys, p.full_values, key_pool);
|
||||
} else if (type == mvt_double && accumulate_numeric.size() > 0 && !starts_with(key, accumulate_numeric_colon)) {
|
||||
for (auto const &operation : numeric_operations) {
|
||||
std::string prefixed_key = accumulate_numeric + ":" + operation.first + ":" + key;
|
||||
promote_attribute_prefix(key, prefixed_key, p, key_pool);
|
||||
preserve_attribute(operation.second, prefixed_key, sf.full_values[i], p.full_keys, p.full_values, p.attribute_accum_state, key_pool);
|
||||
preserve_attribute(operation.second, prefixed_key, sf.full_values[i], p.full_keys, p.full_values, key_pool);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1538,13 +1535,13 @@ void preserve_attributes(std::unordered_map<std::string, attribute_op> const *at
|
||||
// ordinarily returns the most recently-added feature from the same layer as the feature
|
||||
// that is being dropped.
|
||||
//
|
||||
bool find_feature_to_accumulate_onto(std::vector<serial_feature> &features, serial_feature &sf, ssize_t &out, std::vector<std::vector<std::string>> *layer_unmaps, long long maxextent) {
|
||||
bool find_feature_to_accumulate_onto(std::vector<std::shared_ptr<serial_feature>> &features, serial_feature &sf, ssize_t &out, std::vector<std::vector<std::string>> *layer_unmaps, long long maxextent) {
|
||||
for (size_t i = features.size(); i > 0; i--) {
|
||||
if (features[i - 1].t == sf.t) {
|
||||
std::string &layername1 = (*layer_unmaps)[features[i - 1].segment][features[i - 1].layer];
|
||||
if (features[i - 1]->t == sf.t) {
|
||||
std::string &layername1 = (*layer_unmaps)[features[i - 1]->segment][features[i - 1]->layer];
|
||||
std::string &layername2 = (*layer_unmaps)[sf.segment][sf.layer];
|
||||
|
||||
if (layername1 == layername2 && features[i - 1].extent <= maxextent) {
|
||||
if (layername1 == layername2 && features[i - 1]->extent <= maxextent) {
|
||||
out = i - 1;
|
||||
return true;
|
||||
}
|
||||
@@ -1617,8 +1614,8 @@ return;
|
||||
|
||||
// This is the structure that the features from each layer are accumulated into
|
||||
struct layer_features {
|
||||
std::vector<serial_feature> features; // The features of this layer, so far
|
||||
size_t multiplier_cluster_size = 0; // The feature count of the current multiplier cluster
|
||||
std::vector<std::shared_ptr<serial_feature>> features; // The features of this layer, so far
|
||||
size_t multiplier_cluster_size = 0; // The feature count of the current multiplier cluster
|
||||
};
|
||||
|
||||
bool drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer_features &layer, serial_feature &sf, std::vector<std::vector<std::string>> *layer_unmaps, strategy &strategy, bool &drop_rest, std::unordered_map<std::string, attribute_op> const *attribute_accum, key_pool &key_pool) {
|
||||
@@ -1632,7 +1629,7 @@ bool drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer_features
|
||||
sf.dropped = layer.multiplier_cluster_size + 1;
|
||||
return false; // converted rather than dropped
|
||||
} else {
|
||||
preserve_attributes(attribute_accum, sf, layer.features[which_serial_feature], key_pool);
|
||||
preserve_attributes(attribute_accum, sf, *layer.features[which_serial_feature], key_pool);
|
||||
drop_rest = true;
|
||||
return true; // dropped
|
||||
}
|
||||
@@ -1872,7 +1869,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
layers.emplace(layername, layer_features());
|
||||
}
|
||||
struct layer_features &layer = layers.find(layername)->second;
|
||||
std::vector<serial_feature> &features = layer.features;
|
||||
std::vector<std::shared_ptr<serial_feature>> &features = layer.features;
|
||||
|
||||
if (sf.t == VT_POINT) {
|
||||
if (extent_previndex >= sf.index) {
|
||||
@@ -1921,7 +1918,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
|
||||
if (sf.dropped == FEATURE_DROPPED || drop_rest) {
|
||||
if (find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.dropped_by_rate++;
|
||||
can_stop_early = false;
|
||||
continue;
|
||||
@@ -1934,7 +1931,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
if (sf.dropped == FEATURE_KEPT) {
|
||||
if (gamma > 0) {
|
||||
if (manage_gap(sf.index, &previndex, scale, gamma, &gap) && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.dropped_by_gamma++;
|
||||
drop_rest = true;
|
||||
can_stop_early = false;
|
||||
@@ -1949,20 +1946,21 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
// rather than wanting each feature to have a consistent
|
||||
// idea of density between zooms.
|
||||
if ((sf.index < merge_previndex || sf.index - merge_previndex < cluster_mingap) && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
|
||||
features[which_serial_feature].clustered++;
|
||||
features[which_serial_feature]->clustered++;
|
||||
|
||||
if (features[which_serial_feature].t == VT_POINT &&
|
||||
features[which_serial_feature].geometry.size() == 1 &&
|
||||
if (!additional[A_KEEP_POINT_CLUSTER_POSITION] &&
|
||||
features[which_serial_feature]->t == VT_POINT &&
|
||||
features[which_serial_feature]->geometry.size() == 1 &&
|
||||
sf.geometry.size() == 1) {
|
||||
double x = (double) features[which_serial_feature].geometry[0].x * features[which_serial_feature].clustered;
|
||||
double y = (double) features[which_serial_feature].geometry[0].y * features[which_serial_feature].clustered;
|
||||
double x = (double) features[which_serial_feature]->geometry[0].x * features[which_serial_feature]->clustered;
|
||||
double y = (double) features[which_serial_feature]->geometry[0].y * features[which_serial_feature]->clustered;
|
||||
x += sf.geometry[0].x;
|
||||
y += sf.geometry[0].y;
|
||||
features[which_serial_feature].geometry[0].x = x / (features[which_serial_feature].clustered + 1);
|
||||
features[which_serial_feature].geometry[0].y = y / (features[which_serial_feature].clustered + 1);
|
||||
features[which_serial_feature]->geometry[0].x = x / (features[which_serial_feature]->clustered + 1);
|
||||
features[which_serial_feature]->geometry[0].y = y / (features[which_serial_feature]->clustered + 1);
|
||||
}
|
||||
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.coalesced_as_needed++;
|
||||
drop_rest = true;
|
||||
can_stop_early = false;
|
||||
@@ -1981,20 +1979,20 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
// it averages the point locations
|
||||
add_sample_to(gaps, sf.gap, gaps_increment, seq);
|
||||
if (sf.gap < mingap && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
|
||||
features[which_serial_feature].clustered++;
|
||||
features[which_serial_feature]->clustered++;
|
||||
|
||||
if (features[which_serial_feature].t == VT_POINT &&
|
||||
features[which_serial_feature].geometry.size() == 1 &&
|
||||
if (features[which_serial_feature]->t == VT_POINT &&
|
||||
features[which_serial_feature]->geometry.size() == 1 &&
|
||||
sf.geometry.size() == 1) {
|
||||
double x = (double) features[which_serial_feature].geometry[0].x * features[which_serial_feature].clustered;
|
||||
double y = (double) features[which_serial_feature].geometry[0].y * features[which_serial_feature].clustered;
|
||||
double x = (double) features[which_serial_feature]->geometry[0].x * features[which_serial_feature]->clustered;
|
||||
double y = (double) features[which_serial_feature]->geometry[0].y * features[which_serial_feature]->clustered;
|
||||
x += sf.geometry[0].x;
|
||||
y += sf.geometry[0].y;
|
||||
features[which_serial_feature].geometry[0].x = x / (features[which_serial_feature].clustered + 1);
|
||||
features[which_serial_feature].geometry[0].y = y / (features[which_serial_feature].clustered + 1);
|
||||
features[which_serial_feature]->geometry[0].x = x / (features[which_serial_feature]->clustered + 1);
|
||||
features[which_serial_feature]->geometry[0].y = y / (features[which_serial_feature]->clustered + 1);
|
||||
}
|
||||
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.coalesced_as_needed++;
|
||||
drop_rest = true;
|
||||
continue;
|
||||
@@ -2002,10 +2000,10 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
} else if (additional[A_COALESCE_DENSEST_AS_NEEDED]) {
|
||||
add_sample_to(gaps, sf.gap, gaps_increment, seq);
|
||||
if (sf.gap < mingap && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
|
||||
coalesce_geometry(features[which_serial_feature], sf);
|
||||
features[which_serial_feature].coalesced = true;
|
||||
coalesce_geometry(*features[which_serial_feature], sf);
|
||||
features[which_serial_feature]->coalesced = true;
|
||||
coalesced_area += sf.extent;
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.coalesced_as_needed++;
|
||||
drop_rest = true;
|
||||
can_stop_early = false;
|
||||
@@ -2024,10 +2022,10 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
} else if (additional[A_COALESCE_SMALLEST_AS_NEEDED]) {
|
||||
add_sample_to(extents, sf.extent, extents_increment, seq);
|
||||
if (minextent != 0 && sf.extent + coalesced_area <= minextent && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, minextent)) {
|
||||
coalesce_geometry(features[which_serial_feature], sf);
|
||||
features[which_serial_feature].coalesced = true;
|
||||
coalesce_geometry(*features[which_serial_feature], sf);
|
||||
features[which_serial_feature]->coalesced = true;
|
||||
coalesced_area += sf.extent;
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.coalesced_as_needed++;
|
||||
drop_rest = true;
|
||||
can_stop_early = false;
|
||||
@@ -2044,9 +2042,9 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
} else if (additional[A_COALESCE_FRACTION_AS_NEEDED]) {
|
||||
add_sample_to(drop_sequences, drop_sequence, drop_sequences_increment, seq);
|
||||
if (mindrop_sequence != 0 && drop_sequence <= mindrop_sequence && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
|
||||
coalesce_geometry(features[which_serial_feature], sf);
|
||||
features[which_serial_feature].coalesced = true;
|
||||
preserve_attributes(arg->attribute_accum, sf, features[which_serial_feature], key_pool);
|
||||
coalesce_geometry(*features[which_serial_feature], sf);
|
||||
features[which_serial_feature]->coalesced = true;
|
||||
preserve_attributes(arg->attribute_accum, sf, *features[which_serial_feature], key_pool);
|
||||
strategy.coalesced_as_needed++;
|
||||
drop_rest = true;
|
||||
can_stop_early = false;
|
||||
@@ -2188,23 +2186,23 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
tile_detail = sf.extra_detail;
|
||||
}
|
||||
|
||||
features.push_back(std::move(sf));
|
||||
features.push_back(std::make_shared<serial_feature>(sf));
|
||||
|
||||
unsimplified_geometry_size += features.back().geometry.size() * sizeof(draw);
|
||||
unsimplified_geometry_size += features.back()->geometry.size() * sizeof(draw);
|
||||
if (unsimplified_geometry_size > 10 * 1024 * 1024 && !additional[A_DETECT_SHARED_BORDERS]) {
|
||||
// we should be safe to simplify here with P_SIMPLIFY_SHARED_NODES, since they will
|
||||
// have been assembled globally, although that also means that simplification
|
||||
// may not be very effective for reducing memory usage.
|
||||
|
||||
for (; simplified_geometry_through < features.size(); simplified_geometry_through++) {
|
||||
simplify_feature(&features[simplified_geometry_through], shared_nodes, shared_nodes_map, nodepos, shared_nodes_bloom);
|
||||
simplify_feature(&*features[simplified_geometry_through], shared_nodes, shared_nodes_map, nodepos, shared_nodes_bloom);
|
||||
|
||||
if (features[simplified_geometry_through].t == VT_POLYGON) {
|
||||
drawvec to_clean = features[simplified_geometry_through].geometry;
|
||||
if (features[simplified_geometry_through]->t == VT_POLYGON) {
|
||||
drawvec to_clean = features[simplified_geometry_through]->geometry;
|
||||
|
||||
// don't scale up because this is still world coordinates
|
||||
to_clean = clean_or_clip_poly(to_clean, 0, 0, false, false);
|
||||
features[simplified_geometry_through].geometry = std::move(to_clean);
|
||||
features[simplified_geometry_through]->geometry = std::move(to_clean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2293,16 +2291,14 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
|
||||
for (auto &kv : layers) {
|
||||
std::string const &layername = kv.first;
|
||||
std::vector<serial_feature> &features = kv.second.features;
|
||||
std::vector<std::shared_ptr<serial_feature>> &features = kv.second.features;
|
||||
|
||||
if (retain_points_multiplier > 1) {
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, "tippecanoe:retain_points_multiplier_first", serial_val(mvt_bool, "true"));
|
||||
|
||||
// mapping from input sequence to current sequence within this tile
|
||||
std::vector<std::pair<size_t, size_t>> feature_sequences;
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
feature_sequences.emplace_back(features[i].seq, i);
|
||||
feature_sequences.emplace_back(features[i]->seq, i);
|
||||
}
|
||||
|
||||
// tag each feature with its sequence number within the layer
|
||||
@@ -2316,15 +2312,13 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
size_t j = feature_sequences[i].second;
|
||||
serial_val sv(mvt_double, std::to_string(i));
|
||||
|
||||
features[j].full_keys.push_back(key_pool.pool("tippecanoe:retain_points_multiplier_sequence"));
|
||||
features[j].full_values.push_back(sv);
|
||||
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, *features[j].full_keys.back(), sv);
|
||||
features[j]->full_keys.push_back(key_pool.pool("tippecanoe:retain_points_multiplier_sequence"));
|
||||
features[j]->full_values.push_back(sv);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
serial_feature &p = features[i];
|
||||
serial_feature &p = *features[i];
|
||||
|
||||
if (p.clustered > 0) {
|
||||
serial_val sv, sv2, sv3, sv4;
|
||||
@@ -2336,22 +2330,16 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
sv.s = "true";
|
||||
p.full_values.push_back(sv);
|
||||
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, "clustered", sv);
|
||||
|
||||
p.full_keys.push_back(key_pool.pool("point_count"));
|
||||
sv2.type = mvt_double;
|
||||
sv2.s = std::to_string(point_count);
|
||||
p.full_values.push_back(sv2);
|
||||
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, "point_count", sv2);
|
||||
|
||||
p.full_keys.push_back(key_pool.pool("sqrt_point_count"));
|
||||
sv3.type = mvt_double;
|
||||
sv3.s = std::to_string(round(100 * sqrt(point_count)) / 100.0);
|
||||
p.full_values.push_back(sv3);
|
||||
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, "sqrt_point_count", sv3);
|
||||
|
||||
p.full_keys.push_back(key_pool.pool("point_count_abbreviated"));
|
||||
sv4.type = mvt_string;
|
||||
if (point_count >= 10000) {
|
||||
@@ -2363,16 +2351,15 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
}
|
||||
sv4.s = abbrev;
|
||||
p.full_values.push_back(sv4);
|
||||
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, "point_count_abbreviated", sv4);
|
||||
}
|
||||
|
||||
if (p.need_tilestats.size() > 0) {
|
||||
for (size_t j = 0; j < p.full_keys.size(); j++) {
|
||||
if (p.need_tilestats.count(*p.full_keys[j]) > 0) {
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, *p.full_keys[j], p.full_values[j]);
|
||||
}
|
||||
for (size_t j = 0; j < p.full_keys.size(); j++) {
|
||||
// remove accumulation state
|
||||
size_t found = p.full_values[j].s.find('\0');
|
||||
if (found != std::string::npos) {
|
||||
p.full_values[j].s = p.full_values[j].s.substr(0, found);
|
||||
}
|
||||
add_tilestats(layername, z, layermaps, tiling_seg, layer_unmaps, *p.full_keys[j], p.full_values[j]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2421,18 +2408,18 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
signed char t = features[i].t;
|
||||
signed char t = features[i]->t;
|
||||
|
||||
{
|
||||
if (t == VT_POINT || draws_something(features[i].geometry)) {
|
||||
if (t == VT_POINT || draws_something(features[i]->geometry)) {
|
||||
// printf("segment %d layer %lld is %s\n", features[i].segment, features[i].layer, (*layer_unmaps)[features[i].segment][features[i].layer].c_str());
|
||||
|
||||
features[i].coalesced = false;
|
||||
features[i]->coalesced = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<serial_feature> &layer_features = features;
|
||||
std::vector<std::shared_ptr<serial_feature>> &layer_features = features;
|
||||
|
||||
if (additional[A_REORDER]) {
|
||||
std::stable_sort(layer_features.begin(), layer_features.end(), coalindexcmp_comparator());
|
||||
@@ -2449,11 +2436,11 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
for (size_t x = 1; x < layer_features.size(); x++) {
|
||||
size_t y = out - 1;
|
||||
|
||||
if (out > 0 && coalcmp(&layer_features[x], &layer_features[y]) == 0) {
|
||||
for (size_t g = 0; g < layer_features[x].geometry.size(); g++) {
|
||||
layer_features[y].geometry.push_back(std::move(layer_features[x].geometry[g]));
|
||||
if (out > 0 && coalcmp(&*layer_features[x], &*layer_features[y]) == 0) {
|
||||
for (size_t g = 0; g < layer_features[x]->geometry.size(); g++) {
|
||||
layer_features[y]->geometry.push_back(std::move(layer_features[x]->geometry[g]));
|
||||
}
|
||||
layer_features[y].coalesced = true;
|
||||
layer_features[y]->coalesced = true;
|
||||
} else {
|
||||
layer_features[out++] = layer_features[x];
|
||||
}
|
||||
@@ -2471,25 +2458,25 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
size_t out = 0;
|
||||
|
||||
for (size_t x = 0; x < layer_features.size(); x++) {
|
||||
if (layer_features[x].coalesced && layer_features[x].t == VT_LINE) {
|
||||
layer_features[x].geometry = remove_noop(layer_features[x].geometry, layer_features[x].t, 0);
|
||||
if (layer_features[x]->coalesced && layer_features[x]->t == VT_LINE) {
|
||||
layer_features[x]->geometry = remove_noop(layer_features[x]->geometry, layer_features[x]->t, 0);
|
||||
if (!(prevent[P_SIMPLIFY] || (z == maxzoom && prevent[P_SIMPLIFY_LOW]))) {
|
||||
// XXX revisit: why does this not take zoom into account?
|
||||
layer_features[x].geometry = simplify_lines(layer_features[x].geometry, 32, 0, 0, 0,
|
||||
!(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification, layer_features[x].t == VT_POLYGON ? 4 : 0, shared_nodes, NULL, 0, "");
|
||||
layer_features[x]->geometry = simplify_lines(layer_features[x]->geometry, 32, 0, 0, 0,
|
||||
!(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification, layer_features[x]->t == VT_POLYGON ? 4 : 0, shared_nodes, NULL, 0, "");
|
||||
}
|
||||
}
|
||||
|
||||
if (layer_features[x].t == VT_POLYGON) {
|
||||
if (layer_features[x].coalesced) {
|
||||
if (layer_features[x]->t == VT_POLYGON) {
|
||||
if (layer_features[x]->coalesced) {
|
||||
// we can try scaling up because this is tile coordinates
|
||||
layer_features[x].geometry = clean_or_clip_poly(layer_features[x].geometry, 0, 0, false, true);
|
||||
layer_features[x]->geometry = clean_or_clip_poly(layer_features[x]->geometry, 0, 0, false, true);
|
||||
}
|
||||
|
||||
layer_features[x].geometry = close_poly(layer_features[x].geometry);
|
||||
layer_features[x]->geometry = close_poly(layer_features[x]->geometry);
|
||||
}
|
||||
|
||||
if (layer_features[x].geometry.size() > 0) {
|
||||
if (layer_features[x]->geometry.size() > 0) {
|
||||
layer_features[out++] = layer_features[x];
|
||||
}
|
||||
}
|
||||
@@ -2530,7 +2517,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
size_t feature_count = 0;
|
||||
|
||||
for (auto layer_iterator = layers.begin(); layer_iterator != layers.end(); ++layer_iterator) {
|
||||
std::vector<serial_feature> &layer_features = layer_iterator->second.features;
|
||||
std::vector<std::shared_ptr<serial_feature>> &layer_features = layer_iterator->second.features;
|
||||
feature_count += layer_features.size();
|
||||
|
||||
mvt_layer layer;
|
||||
@@ -2541,34 +2528,37 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
for (size_t x = 0; x < layer_features.size(); x++) {
|
||||
mvt_feature feature;
|
||||
|
||||
if (layer_features[x].t == VT_LINE || layer_features[x].t == VT_POLYGON) {
|
||||
layer_features[x].geometry = remove_noop(layer_features[x].geometry, layer_features[x].t, 0);
|
||||
if (layer_features[x]->t == VT_LINE || layer_features[x]->t == VT_POLYGON) {
|
||||
layer_features[x]->geometry = remove_noop(layer_features[x]->geometry, layer_features[x]->t, 0);
|
||||
}
|
||||
|
||||
if (layer_features[x].geometry.size() == 0) {
|
||||
layer_features[x] = serial_feature();
|
||||
if (layer_features[x]->geometry.size() == 0) {
|
||||
layer_features[x] = std::make_shared<serial_feature>();
|
||||
continue;
|
||||
}
|
||||
|
||||
feature.type = layer_features[x].t;
|
||||
feature.geometry = to_feature(layer_features[x].geometry);
|
||||
count += layer_features[x].geometry.size();
|
||||
layer_features[x].geometry.clear();
|
||||
feature.type = layer_features[x]->t;
|
||||
feature.geometry = to_feature(layer_features[x]->geometry);
|
||||
count += layer_features[x]->geometry.size();
|
||||
layer_features[x]->geometry.clear();
|
||||
|
||||
feature.id = layer_features[x].id;
|
||||
feature.has_id = layer_features[x].has_id;
|
||||
feature.id = layer_features[x]->id;
|
||||
feature.has_id = layer_features[x]->has_id;
|
||||
|
||||
decode_meta(layer_features[x], layer, feature);
|
||||
for (size_t a = 0; a < layer_features[x].full_keys.size(); a++) {
|
||||
serial_val sv = layer_features[x].full_values[a];
|
||||
decode_meta(*layer_features[x], layer, feature);
|
||||
for (size_t a = 0; a < layer_features[x]->full_keys.size(); a++) {
|
||||
serial_val sv = layer_features[x]->full_values[a];
|
||||
mvt_value v = stringified_to_mvt_value(sv.type, sv.s.c_str(), tile_stringpool);
|
||||
layer.tag(feature, *layer_features[x].full_keys[a], v);
|
||||
layer.tag(feature, *layer_features[x]->full_keys[a], v);
|
||||
}
|
||||
|
||||
layer_features[x]->full_keys.clear();
|
||||
layer_features[x]->full_values.clear();
|
||||
|
||||
if (additional[A_CALCULATE_FEATURE_DENSITY]) {
|
||||
int glow = 255;
|
||||
if (layer_features[x].spacing > 0) {
|
||||
glow = (1 / layer_features[x].spacing);
|
||||
if (layer_features[x]->spacing > 0) {
|
||||
glow = (1 / layer_features[x]->spacing);
|
||||
if (glow > 255) {
|
||||
glow = 255;
|
||||
}
|
||||
@@ -2587,7 +2577,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
}
|
||||
|
||||
layer.features.push_back(std::move(feature));
|
||||
layer_features[x] = serial_feature();
|
||||
layer_features[x] = std::make_shared<serial_feature>();
|
||||
}
|
||||
|
||||
if (layer.features.size() > 0) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_HPP
|
||||
#define VERSION_HPP
|
||||
|
||||
#define VERSION "v2.69.0"
|
||||
#define VERSION "v2.77.0"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user