-
I want to show OSM trees on my map, so I added something like this in the LUA-Script:
This works very well but I recognized that in some cities there are really lots of trees which is a bit overwhelming in certain areas. So I wonder if it is possible to restrict the density of trees (or any other objects). For example a maximum of 10 trees in a 10x10 metres square. So I would need something like a spatial query around the current object. Is this possible in the Lua script or is there something like a postprocessing step that I can hook into? Thanks in advance :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
This sort of heavy geometry processing isn't really something that tilemaker does, I'm afraid - you'd typically use PostGIS for this. Martin would be really well suited for serving vector tiles with queries like this. If you did want to still use tilemaker, you'd typically load the trees into a Postgres database (using osm2pgsql and some custom Lua); cluster them with PostGIS functions; then use pgsql2shp to export the clustered trees to a shapefile which tilemaker could load. |
Beta Was this translation helpful? Give feedback.
-
mapbox/tippecanoe can reduce the number of point features according to a density (max number in tile)
|
Beta Was this translation helpful? Give feedback.
-
sent from a phone
On 18 Jun 2023, at 13:46, ToraXaroT ***@***.***> wrote:
Can tippecanoe also process osm.pbf files as input like tilemaker? Or do I need a preprocessing here?
afaik only geojson as input.
|
Beta Was this translation helpful? Give feedback.
This sort of heavy geometry processing isn't really something that tilemaker does, I'm afraid - you'd typically use PostGIS for this. Martin would be really well suited for serving vector tiles with queries like this.
If you did want to still use tilemaker, you'd typically load the trees into a Postgres database (using osm2pgsql and some custom Lua); cluster them with PostGIS functions; then use pgsql2shp to export the clustered trees to a shapefile which tilemaker could load.