mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-23 17:01:18 +01:00
Compare commits
16
Commits
2.71.0
...
test-e33a52bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e33a52bf75 | ||
|
|
0d22f3dfeb | ||
|
|
4a17aecd3b | ||
|
|
bfb62ee2db | ||
|
|
a0532e73ac | ||
|
|
9d1637f7c1 | ||
|
|
de4e1e478f | ||
|
|
423fea1544 | ||
|
|
583fc3744a | ||
|
|
390c362452 | ||
|
|
10f7f0a3c2 | ||
|
|
7165ae6999 | ||
|
|
d70e3326da | ||
|
|
a8bd7ac723 | ||
|
|
bdfb06cd6a | ||
|
|
1d81935cd5 |
@@ -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,33 @@
|
||||
# 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
|
||||
|
||||
@@ -59,7 +59,7 @@ C = $(wildcard *.c) $(wildcard *.cpp)
|
||||
INCLUDES = -I/usr/local/include -I. -Iclipper2/include
|
||||
LIBS = -L/usr/local/lib
|
||||
|
||||
tippecanoe: geojson.o jsonpull/jsonpull.o tile.o pool.o mbtiles.o geometry.o projection.o memfile.o mvt.o serial.o main.o 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
|
||||
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,7 +68,7 @@ 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 read_json.o clipper2/src/clipper.engine.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
|
||||
@@ -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
|
||||
@@ -382,6 +387,11 @@ overzoom-test: tippecanoe-overzoom
|
||||
./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
|
||||
@@ -429,6 +439,20 @@ overzoom-test: tippecanoe-overzoom
|
||||
./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"}'
|
||||
@@ -564,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1269,7 +1269,8 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
|
||||
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::vector<clipbbox> const &clipbboxes) {
|
||||
std::vector<clipbbox> const &clipbboxes,
|
||||
bool deduplicate_by_id) {
|
||||
std::vector<source_tile> decoded;
|
||||
|
||||
for (auto const &t : tiles) {
|
||||
@@ -1295,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, clipbboxes);
|
||||
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
|
||||
@@ -1371,13 +1372,12 @@ static void add_mean(mvt_feature &feature, mvt_layer &layer, std::string const &
|
||||
};
|
||||
|
||||
// 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()
|
||||
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) {
|
||||
@@ -1457,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 {
|
||||
@@ -1470,7 +1470,7 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1500,7 +1500,8 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
std::unordered_map<std::string, attribute_op> const &attribute_accum,
|
||||
std::string const &accumulate_numeric,
|
||||
key_pool &key_pool, int buffer, bool include_nonaggregate,
|
||||
std::vector<clipbbox> const &clipbboxes, int nz, int nx, int ny) {
|
||||
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;
|
||||
@@ -1583,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;
|
||||
@@ -1597,7 +1606,6 @@ 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;
|
||||
@@ -1642,13 +1650,13 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
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, attribute_accum_state, key_pool);
|
||||
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, attribute_accum_state, key_pool,
|
||||
keys, numeric_out_field, key_pool,
|
||||
keep, exclude, exclude_prefix);
|
||||
}
|
||||
}
|
||||
@@ -1975,7 +1983,7 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
if (feature_out(outfeatures[i], outlayer,
|
||||
keep, exclude, exclude_prefix, attribute_accum,
|
||||
accumulate_numeric, key_pool, buffer, true,
|
||||
clipbboxes, z, x, y)) {
|
||||
clipbboxes, z, x, y, NULL)) {
|
||||
mvt_feature &nfeature = outlayer.features.back();
|
||||
mvt_value val;
|
||||
val.type = mvt_uint;
|
||||
@@ -2012,10 +2020,14 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
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::vector<clipbbox> const &clipbboxes) {
|
||||
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;
|
||||
@@ -2042,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;
|
||||
|
||||
@@ -2163,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, bins.size() == 0, std::vector<clipbbox>(), nz, nx, ny);
|
||||
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;
|
||||
}
|
||||
@@ -2223,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, bins.size() == 0, std::vector<clipbbox>(), nz, nx, ny);
|
||||
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;
|
||||
@@ -2263,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, clipbboxes);
|
||||
1, clipbboxes, deduplicate_by_id);
|
||||
if (child.size() > 0) {
|
||||
next_overzoomed_tiles->emplace_back(nx * 2 + x, ny * 2 + y);
|
||||
}
|
||||
|
||||
+4
-2
@@ -147,7 +147,8 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
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::vector<clipbbox> const &clipbboxes);
|
||||
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,
|
||||
@@ -162,7 +163,8 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
|
||||
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::vector<clipbbox> const &clipbboxes);
|
||||
std::vector<clipbbox> const &clipbboxes,
|
||||
bool deduplicate_by_id);
|
||||
|
||||
draw center_of_mass_mp(const drawvec &dv);
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -3128,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'},
|
||||
@@ -3728,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);
|
||||
@@ -3878,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);
|
||||
|
||||
+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')
|
||||
|
||||
+70
-21
@@ -19,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;
|
||||
@@ -40,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;
|
||||
@@ -60,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},
|
||||
@@ -72,6 +94,8 @@ int main(int argc, char **argv) {
|
||||
{"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},
|
||||
};
|
||||
@@ -122,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;
|
||||
@@ -181,6 +209,17 @@ int main(int argc, char **argv) {
|
||||
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);
|
||||
@@ -262,6 +301,7 @@ int main(int argc, char **argv) {
|
||||
// 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));
|
||||
@@ -283,38 +323,47 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (c.dv.size() > 0) {
|
||||
c.dv = clip_poly_poly(c.dv, tile_bounds);
|
||||
|
||||
if (c.dv.size() == 0) {
|
||||
clipped_to_nothing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
json_object *json_filter = NULL;
|
||||
if (filter.size() > 0) {
|
||||
json_filter = parse_filter(filter.c_str());
|
||||
}
|
||||
std::string out;
|
||||
|
||||
for (auto const &s : sources) {
|
||||
std::string tile;
|
||||
char buf[1000];
|
||||
int len;
|
||||
|
||||
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));
|
||||
for (auto const &s : sources) {
|
||||
std::string tile;
|
||||
char buf[1000];
|
||||
int len;
|
||||
|
||||
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));
|
||||
}
|
||||
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, clipbboxes);
|
||||
|
||||
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
|
||||
+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 ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
@@ -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 @@
|
||||
{"coordinates":[[[-122.4527379,37.8128815],[-122.4598853,37.7834743],[-122.4280914,37.7959397],[-122.4527379,37.8128815]]],"type":"Polygon"}
|
||||
@@ -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 @@
|
||||
{"*":["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"}
|
||||
@@ -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",
|
||||
|
||||
+444
-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<()
|
||||
@@ -717,7 +982,7 @@ struct tileset_reader {
|
||||
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<clipbbox>());
|
||||
std::vector<clipbbox>(), false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -735,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;
|
||||
|
||||
@@ -759,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();
|
||||
@@ -794,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;
|
||||
|
||||
@@ -804,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;
|
||||
@@ -811,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;
|
||||
@@ -843,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());
|
||||
@@ -944,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>());
|
||||
@@ -957,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) {
|
||||
@@ -1013,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();
|
||||
}
|
||||
}
|
||||
@@ -1032,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;
|
||||
@@ -1053,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) {
|
||||
@@ -1068,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);
|
||||
}
|
||||
@@ -1115,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);
|
||||
@@ -1197,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) {
|
||||
@@ -1209,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;
|
||||
@@ -1234,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'},
|
||||
@@ -1244,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},
|
||||
@@ -1428,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);
|
||||
@@ -1509,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;
|
||||
@@ -1540,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.71.0"
|
||||
#define VERSION "v2.77.0"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user