Replies: 3 comments 10 replies
-
To me it feels almost like what would help here would be to blur the forests... |
Beta Was this translation helpful? Give feedback.
-
@wipfli what do you think about this https://data.maptiler.com/downloads/dataset/landcover ? |
Beta Was this translation helpful? Give feedback.
-
What kind of tweaks did you try with mergeNearbyPolygons? That's basically grouping polygons that are within Here's what I get if I change postProcess to: @Override
public List<VectorTile.Feature> postProcess(int zoom, List<VectorTile.Feature> items) throws GeometryException {
for (var item : items) {
item.attrs().remove(TEMP_NUM_POINTS_ATTR);
}
return FeatureMerge.mergeNearbyPolygons(items,
128, // minArea
128, // minHoleArea
1, // minDist
1 // buffer/unbuffer
);
} That merges any polygons with the same features within 1px of eachother and the large values for minArea/minHoleArea filter filter-out any small polygons/holes that are left over. You could also try tweaking other parameters within FeatureMerge, like switching to JTS provides a lot of other vector geometry utilities that we could use as building blocks for operations like this (anything you can do in postgis since it uses geos which is ported from JTS). Let me know if you have any other ideas to try based on jts/postgis geom utils? Another route that might make sense here would be to rasterize the geometries, do some raster operations, then go back to vector geometries? |
Beta Was this translation helpful? Give feedback.
-
Forests are nicely mapped in OpenStreetMap and I would like to show them on my map basically at all zoom levels. The problem with this is just that forest polygons have too much structure: forests have often boundaries which remind of fractals, forests have holes and they are cut into pieces by roads.
Here is an example of how forests look like at zoom z9 in Switzerland:
This was produced with something like the following planetiler code:
The problem with the above map is that from my point of view, the forest polygons have too much detail. I would like to simplify them but I don't know of a good way of doing this. I played a bit around with
mergeNearbyPolygons()
but could not get satisfying results.Basically what I would like to achieve is that at low zoom levels I get an idea of what areas are mostly forest or mostly not forest, and as I zoom in, the forest polygons should get more and more details.
For example, I would like to simplify the above forest polygons to something like the hand-drawn blobs:
Is that possible at all?
Beta Was this translation helpful? Give feedback.
All reactions