Skip to content

Commit

Permalink
Revert "Add a flag to use an H3 index for the feature index"
Browse files Browse the repository at this point in the history
This reverts commit b9b48f4.
  • Loading branch information
e-n-f committed Jan 30, 2025
1 parent 99f7ce1 commit d523a4d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ int retain_points_multiplier = 1;
std::vector<std::string> unidecode_data;
size_t maximum_string_attribute_length = 0;
std::string accumulate_numeric;
std::string use_h3_index;

std::vector<order_field> order_by;
bool order_reverse;
Expand Down Expand Up @@ -3129,7 +3128,6 @@ int main(int argc, char **argv) {
{"coalesce", no_argument, &additional[A_COALESCE], 1},
{"reverse", no_argument, &additional[A_REVERSE], 1},
{"hilbert", no_argument, &additional[A_HILBERT], 1},
{"use-h3-index", required_argument, 0, '~'},
{"order-by", required_argument, 0, '~'},
{"order-descending-by", required_argument, 0, '~'},
{"order-smallest-first", no_argument, 0, '~'},
Expand Down Expand Up @@ -3271,8 +3269,6 @@ int main(int argc, char **argv) {
fprintf(stderr, "%s: --extra-detail can be at most 30\n", argv[0]);
exit(EXIT_ARGS);
}
} else if (strcmp(opt, "use-h3-index") == 0) {
use_h3_index = optarg;
} else if (strcmp(opt, "order-by") == 0) {
order_by.push_back(order_field(optarg, false));
} else if (strcmp(opt, "order-descending-by") == 0) {
Expand Down
1 change: 0 additions & 1 deletion main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ extern long long extend_zooms_max;
extern int retain_points_multiplier;
extern size_t maximum_string_attribute_length;
extern std::string accumulate_numeric;
extern std::string use_h3_index;
extern unsigned long long preserve_multiplier_density_threshold;

struct order_field {
Expand Down
13 changes: 0 additions & 13 deletions serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,19 +714,6 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
}

bbox_index = encode_index(midx, midy);

if (use_h3_index.size() > 0) {
for (size_t i = 0; i < sf.full_keys.size(); i++) {
if (*(sf.full_keys[i]) == use_h3_index) {
unsigned long long h3_index = atoll(sf.full_values[i].s.c_str());
// the top 52 bits of the feature index are the H3 index;
// the bottom 12 bits are retained from what otherwise would have been the index.
bbox_index = ((h3_index & ((1LL << 52) - 1)) << 12) | (bbox_index & ((1 << 12) - 1));
break;
}
}
}

if (additional[A_CALCULATE_INDEX]) {
sf.full_keys.push_back(key_pool.pool("tippecanoe:index"));

Expand Down

0 comments on commit d523a4d

Please sign in to comment.