mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Tool for overzooming individual tiles (#121)
* Starting work on overzooming * Factor clipping out of geometry.cpp to simplify linkage * Pull out more geometry functions into now-badly-named clip.cpp * Not surprisingly, there is a bug * Found the bug * Make indent * Pass attributes through * Make formatting more consistent * Fix typos in comments * Fix the typos better * Add tippecanoe-overzoom to the install list * Give overzoom a predictable exit status * Forgot to translate to and from polygon ring closepaths * Fix geometry collapse at z21 * Add attribute stripping; don't generate layers if they have no features * Add docs for tippecanoe-overzoom (as it will be, not as it is) * Change overzoom to accept input and output files as arguments * Working on overzooming tests * Oops * Hook up and test the detail and buffer options, and the empty-tile case * Also test attribute stripping * Fix error message * Update changelog and version
This commit is contained in:
@@ -129,6 +129,10 @@ void handle(std::string message, int z, unsigned x, unsigned y, std::map<std::st
|
||||
|
||||
if (layer.extent != outlayer.extent) {
|
||||
if (layer.extent > outlayer.extent) {
|
||||
// this always scales up the existing layer instead of scaling down
|
||||
// the layer that is being added, because the assumption is that
|
||||
// scaling up is safe while scaling down requires geometry cleaning.
|
||||
|
||||
for (size_t i = 0; i < outlayer.features.size(); i++) {
|
||||
for (size_t j = 0; j < outlayer.features[i].geometry.size(); j++) {
|
||||
outlayer.features[i].geometry[j].x = outlayer.features[i].geometry[j].x * layer.extent / outlayer.extent;
|
||||
|
||||
Reference in New Issue
Block a user