-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeometryPipeline #1118
base: main
Are you sure you want to change the base?
GeometryPipeline #1118
Conversation
Full logs: https://github.com/onthegomap/planetiler/actions/runs/12212231803 |
Amazing, thanks for introducing this! I am playing a bit around with it and post things that come to mind below... |
First question, if I do features.polygon("forest")
.setPixelTolerance(0.0)
.setMinPixelSize(0.0)
.transformScaledGeometry(GeometryPipeline.simplifyDP(2.0 / 256)); in the processFeature function, will setPixelTolerance have any effect? |
One thing that I always found a little bit disturbing about Douglas Peucker simplification was that you get these sharp corners all over the place. Would the recommended way to remove those be something like this? features.polygon("waterway")
.setPixelTolerance(0.0)
.transformScaledGeometry(
GeometryPipeline.simplifyDP(1/256d)
.andThen(GeometryPipeline.smoothChaikin(1))
)
.setMinPixelSize(0.0);
} |
Thanks for taking a look!
transformScaledGeometry replaces simplification, but I added a utility so you can do
Yes that could work! You end up adding points back to remove the sharp corners. You could also add points back by just using a smaller DP tolerance, but adding them back with chaikin smoothing results in a globbier shape. You could also try |
Quality Gate passedIssues Measures |
Add a new
feature.setGeometryPipeline()
API that registers a function to transform the feature geometry scaled to tile coordinates at each zoom level (where 1=the width of a tile at that zoom level). This can take any function fromGeometry
toGeometry
for example:Also started a
GeometryPipeline
class that can be used to instantiate other transforms, for example:These can be chained using
andThen
:This should open the door for more complex configuration parameters on each simplify method, as well as transforms like midpoint or Chakin smoothing.