Skip to content

Commit

Permalink
Can't flatten points, so don't flatten bins either
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Aug 21, 2024
1 parent 14be3d2 commit ff9b59d
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,17 +1156,22 @@ struct index_event {
CHECK, // point needs to be checked against active bins
EXIT // bin has ceased to be active
} kind;
size_t what;
size_t layer;
size_t feature;

bool operator<(const index_event &ie) const {
if (where < ie.where) {
return true;
} else if (where == ie.where) {
if (kind < ie.kind) {
return true;
} else {
if (what < ie.what) {
} else if (kind == ie.kind) {
if (layer < ie.layer) {
return true;
} else if (layer == ie.layer) {
if (feature < ie.feature) {
return true;
}
}
}
}
Expand All @@ -1176,21 +1181,20 @@ struct index_event {
};

mvt_tile assign_to_bins(mvt_tile const &features, std::vector<mvt_layer> const &bins, int z, int x, int y) {
// Flatten bins, in the unlikely event that there are multiple layers of them
std::vector<mvt_feature> bin_features;
for (auto const &layer : bins) {
for (auto const &feature : layer.features) {
bin_features.push_back(feature);
}
}

std::vector<index_event> events;

for (size_t i = 0; i < bin_features.size(); i++) {
index_event ie;
// Index bins
for (size_t i = 0; i < bins.size(); i++) {
for (size_t j = 0; j < bins[i].features.size(); j++) {
}
}

// Add
// Index points
for (size_t i = 0; i < features.layers.size(); i++) {
for (size_t j = 0; j < features.layers[i].features.size(); j++) {
index_event ie;
}
}

return features;
}
Expand Down

0 comments on commit ff9b59d

Please sign in to comment.