Closed quincylvania closed 2 months ago
It looks like the docs and json schema are wrong here. There's a min_tile_cover_size
tag on attribute definitions that exclude adding the attribute to features when they are too small, and a min_size
tag (in tile pixels) on features to not include them when they are too small. You should be able to just switch to min_size
to get this working.
We should update the docs/json schema but also they should probably each just have a min_size
tag with a way to specify whether the unit is pixels, tiles, etc... it's kind of strange to have a unit of "tiles" on attribute features and "pixels" on entire features.
Oh okay, I thought min_size
was in absolute meters or something since the units aren't given. It's not clear to me what it means by "below the maximum zoom-level of the map". But if the value is relative to the tile size then that will work for my use case :)
Ah yeah the default unit is "tile pixels" which might be a little counter-intuitive. Ideally I think you should be able to express min_size
(or max_size
) in an absolute unit like meters, acres, hectares, miles or also in a unit that varies by zoom level like pixels or tiles.
"below the maximum zoom-level of the map".
For most maps this is zoom=14 but if you run with --maxzoom=10
then it will be 10. Setting min_size=1
filters-out features below 1 pixel in size up z=maxzoom-1, but at z=maxzoom it lets through all features since the client will overzoom tiles at that highest zoom level.
@msbarry Thanks for the clarifications!
I'm trying to use a custom schema something like this:
But when I try to use
min_tile_cover_size
I run into this error:Exception in thread "main" java.lang.IllegalArgumentException: Unrecognized field "min_tile_cover_size" (class com.onthegomap.planetiler.custommap.configschema.FeatureItem), not marked as ignorable (8 known properties: "min_zoom", "include_when", "geometry", "attributes", "source", "max_zoom", "exclude_when", "min_size"])
I guess the value is probably missing from configschema/FeatureItem.java? It's listed in configschema/AttributeDefinition.java, possibly that's a mistake? Not sure exactly what's going on.