Search code examples
geoserver

How to apply latitude and longitude resolution to image mosaic in geoserver based on zoom level


How we can skip points in the raster layer (created using image mosaic) based on zoom? I think it's called latitude/longitude resolution or sometimes grid step.

Tried Point symbolizer/ filters in SLD, but not sure how to use filters to skip points.

Edit - I created store and layers as mentioned in below link https://geoserver.geo-solutions.it/multidim/multidim/mosaic_config/netcdf_mosaic.html

Everything works fine. Now the issue is all data is shown. The default netcdf spatial resolution is 0.4 and I want to change this as per zoom levels. for ex for zoom 1-5=1, zoom 5-10=0.75 and so on


Solution

  • Found the solution, It's not what I need but still solves the issue. The solution is to use wms_scale_denominator & Categories.

    SLD block -

    <ogc:Function name="parameter">
        <ogc:Literal>scale</ogc:Literal>
        <ogc:Function name="Categorize">
            <ogc:Function name="env">
                <ogc:Literal>wms_scale_denominator</ogc:Literal>
            </ogc:Function>
            <ogc:Literal>16</ogc:Literal>
            <ogc:Literal>100000</ogc:Literal>
            <ogc:Literal>8</ogc:Literal>
            <ogc:Literal>500000</ogc:Literal>
            <ogc:Literal>2</ogc:Literal>
            <ogc:Literal>1000000</ogc:Literal>
            <ogc:Literal>0.5</ogc:Literal>
            <ogc:Literal>5000000</ogc:Literal>
            <ogc:Literal>0.2</ogc:Literal>
            <ogc:Literal>10000000</ogc:Literal>
            <ogc:Literal>0.1</ogc:Literal>
            <ogc:Literal>20000000</ogc:Literal>
            <ogc:Literal>0.05</ogc:Literal>
            <ogc:Literal>60000000</ogc:Literal>
            <ogc:Literal>0.02</ogc:Literal>
        </ogc:Function>
    </ogc:Function>