Add option to order by estimated prominence

This commit is contained in:
Erica Fischer
2022-10-19 13:57:28 -07:00
parent 8e8154339f
commit ebdf5ddce9
11 changed files with 72 additions and 26 deletions
+9
View File
@@ -87,6 +87,7 @@ std::string attribute_for_id = "";
std::vector<order_field> order_by;
bool order_reverse;
bool order_by_size = false;
bool order_by_prominence = false;
int prevent[256];
int additional[256];
@@ -2754,6 +2755,8 @@ int main(int argc, char **argv) {
{"order-descending-by", required_argument, 0, '~'},
{"order-smallest-first", no_argument, 0, '~'},
{"order-largest-first", no_argument, 0, '~'},
{"order-prominent-first", no_argument, 0, '~'},
{"order-prominent-last", no_argument, 0, '~'},
{"Adding calculated attributes", 0, 0, 0},
{"calculate-feature-density", no_argument, &additional[A_CALCULATE_FEATURE_DENSITY], 1},
@@ -2896,6 +2899,12 @@ int main(int argc, char **argv) {
} else if (strcmp(opt, "order-largest-first") == 0) {
order_by.push_back(order_field(ORDER_BY_SIZE, true));
order_by_size = true;
} else if (strcmp(opt, "order-prominent-first") == 0) {
order_by.push_back(order_field(ORDER_BY_PROMINENCE, false));
order_by_prominence = true;
} else if (strcmp(opt, "order-prominent-last") == 0) {
order_by.push_back(order_field(ORDER_BY_PROMINENCE, true));
order_by_prominence = true;
} else if (strcmp(opt, "simplification-at-maximum-zoom") == 0) {
maxzoom_simplification = atof_require(optarg, "Mazoom simplification");
if (maxzoom_simplification <= 0) {