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:
Erica Fischer
2023-08-09 11:48:16 -07:00
committed by GitHub
parent 5cba91981a
commit 430d8edd17
13 changed files with 901 additions and 563 deletions
+4
View File
@@ -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;