Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make drop-densest more consistent across tile boundaries #127

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ layer-json-test:
prep-test: $(TESTS)

tests/%.json: Makefile tippecanoe tippecanoe-decode
./tippecanoe -q -a@ -f -o [email protected] $(call testargs,$(patsubst %.json,%,$(word 4,$(subst /, ,$@)))) $(foreach suffix,$(suffixes),$(sort $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.$(suffix))))
./tippecanoe -q -a@ -f -o [email protected] $(call testargs,$(patsubst %.json,%,$(word 4,$(subst /, ,$@)))) $(foreach suffix,$(suffixes),$(sort $(wildcard $(subst $(SPACE),/,$(wordlist 1,2,$(subst /, ,$@)))/*.$(suffix)))) < /dev/null
./tippecanoe-decode -x generator [email protected] > $@
cmp $(patsubst %.check,%,$@) $@
rm [email protected]
2 changes: 1 addition & 1 deletion overzoom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern char *optarg;
extern int optind;

int detail = 12; // tippecanoe-style: mvt extent == 1 << detail
int buffer = 5; // tippecanoe-style: mvt buffer == extent * buffer / 256;
int buffer = 5; // tippecanoe-style: mvt buffer == extent * buffer / 256;

std::set<std::string> keep;

Expand Down
7 changes: 7 additions & 0 deletions serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ std::string serialize_feature(serial_feature *sf, long long wx, long long wy) {
if (sf->index != 0) {
serialize_ulong_long(s, sf->index);
}
serialize_long_long(s, sf->gap);
if (sf->label_point != 0) {
serialize_ulong_long(s, sf->label_point);
}
Expand Down Expand Up @@ -262,9 +263,11 @@ serial_feature deserialize_feature(std::string &geoms, unsigned z, unsigned tx,
sf.has_id = false;
if (sf.layer & (1 << FLAG_MINZOOM)) {
deserialize_int(&cp, &sf.tippecanoe_minzoom);
sf.has_tippecanoe_minzoom = true;
}
if (sf.layer & (1 << FLAG_MAXZOOM)) {
deserialize_int(&cp, &sf.tippecanoe_maxzoom);
sf.has_tippecanoe_maxzoom = true;
}
if (sf.layer & (1 << FLAG_ID)) {
sf.has_id = true;
Expand All @@ -274,6 +277,7 @@ serial_feature deserialize_feature(std::string &geoms, unsigned z, unsigned tx,
deserialize_int(&cp, &sf.segment);

sf.index = 0;
sf.gap = -1;
sf.label_point = 0;
sf.extent = 0;

Expand All @@ -282,6 +286,7 @@ serial_feature deserialize_feature(std::string &geoms, unsigned z, unsigned tx,
if (sf.layer & (1 << FLAG_INDEX)) {
deserialize_ulong_long(&cp, &sf.index);
}
deserialize_long_long(&cp, &sf.gap);
if (sf.layer & (1 << FLAG_LABEL_POINT)) {
deserialize_ulong_long(&cp, &sf.label_point);
}
Expand Down Expand Up @@ -607,6 +612,8 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
sf.index = 0;
}

sf.gap = -1; // will be calculated during z0

if (sst->layermap->count(sf.layername) == 0) {
sst->layermap->insert(std::pair<std::string, layermap_entry>(sf.layername, layermap_entry(sst->layermap->size())));
}
Expand Down
1 change: 1 addition & 0 deletions serial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct serial_feature {

drawvec geometry = drawvec();
unsigned long long index = 0;
long long gap = -1;
unsigned long long label_point = 0;
long long extent = 0;

Expand Down

Large diffs are not rendered by default.

2,776 changes: 613 additions & 2,163 deletions tests/muni/out/-Z11_-z13_-M5000_-as.json

Large diffs are not rendered by default.

2,276 changes: 307 additions & 1,969 deletions tests/muni/out/-Z11_-z13_-O100_--cluster-densest-as-needed.json

Large diffs are not rendered by default.

4,862 changes: 918 additions & 3,944 deletions tests/muni/out/-r1_-K20.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

270 changes: 55 additions & 215 deletions tests/ne_110m_populated_places/out/-z3_-K20_-r1_-yNAME_-k2.json

Large diffs are not rendered by default.

306 changes: 64 additions & 242 deletions tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json

Large diffs are not rendered by default.

270 changes: 55 additions & 215 deletions tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME_-kg.json

Large diffs are not rendered by default.

702 changes: 22 additions & 680 deletions tests/pointlm/out/-z15_-Z15_--drop-smallest-as-needed_-M300.json

Large diffs are not rendered by default.

188 changes: 129 additions & 59 deletions tile.cpp

Large diffs are not rendered by default.