geotrellis / geotrellis-server

Tools for building raster processing and display services
Apache License 2.0
73 stars 24 forks source link

Ability to control layer visibility based on scale denominator #392

Open jfbourgon opened 2 years ago

jfbourgon commented 2 years ago

Current issue

GeoTrellis-Server is currently missing a key functionality that would allow to control the visibility of a layer based on scale denominator. The feature would help to control the scale when a layer should be displayed on the map and then prevent the layer to be portrayed at resolution that exceed is native resolution or that make it very small.

See below for examples, based on the Canada Land Cover Map hosted on the following WMS service: https://datacube.services.geo.ca/ows/landcover?service=wms&request=GetCapabilities. This dataset covers only the Canadian landmass and has a native resolution of 30m.

Over-zoomed

image

Under-zoomed

image

Expected behavior

The GeoTrellis-Server solution should allow to set min-scale-denominator and max-scale-denominator on layer object in server configuration file.

landcover-2010 = {
        type = "rastersourceconf"
        name = "landcover-2010"
        title = "2010 Land Cover of Canada / 2010 Couverture terrestre du Canada"
        source = "gdal+s3://datacube-prod-data-public/store/eo4ce/landcover/landcover-2010-cog.tif"
        min-scale-denominator = 50000
        max-scale-denominator = 300000000

Theses settings should be optional. The layer should always be rendered if omitted, which would align with the current behavior.