[mapserver-users] processing scale=auto with float multibands rasters

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Tue Aug 4 11:29:25 PDT 2015


Hi Andrea,

For viewing purposes it is rather common to do LUT stretch by standard deviation which is not so sensible as min-max stretch. Consider making a feature request for a new enhanced PROCESSING AUTO directive which would do the STD stretch, possibly with an optional multiplication. 2 x STD might be a good default value.

-Jukka Rahkonen-

Andrea Peri wrote:

> HI Jukka,
> unfortunatelly, I cannot use the LUT because the raster I use is update weekly and every week it could change the min/max values for every bands (it has 11 bands).

> Hovewer if it work using the min/max from get map , probably it could be ok form me.
> The question s that even when the getmap request the entire bbox the image reported seem to be empty without no error log.



2015-08-04 19:50 GMT+02:00 Rahkonen Jukka (MML)
<jukka.rahkonen at maanmittauslaitos.fi>:
> Hi,
>
> I suppose that Even means that with AUTO setting Mapserver is analyzing the min/max pixel values from inside the BBOX of each GetMap and then scales pixel values to 0-256 for the output.  One totally black or white pixel within the BBOX can make the result from 64bit source very bad.
>
> I would try to use LUT instead of SCALE http://www.mapserver.org/input/raster.html#special-processing-directives.
>
> -Jukka Rahkonen-
>
>
>
>
> -----Alkuperäinen viesti-----l
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Andrea Peri
> Lähetetty: 4. elokuuta 2015 20:07
> Vastaanottaja: Even Rouault
> Kopio: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] processing scale=auto with float 
> multibands rasters
>
> Hi Even,
>
> thx for response.
>
> Please can you help me to better understand the question ?
>
> My raster is effectively a 18000 x 24000 px image with tiles.
>
> it have a tile size of 1024 x 1024 produced from gdalwarp:
>
> gdalwarp -s_srs EPSG:32632 -t_srs EPSG:32632 -overwrite --config 
> GDAL_CACHEMAX 1000 -wm 1000 -co TILED=YES -co COMPRESS=NONE -co
> BLOCKXSIZE=1024 -co BLOCKYSIZE=1024 -co BIGTIFF=YES -co SPARSE_OK=TRUE .......
>
> and also have overviews from
>
> gdaladdo --config GDAL_CACHEMAX 1500 -ro -r average ..... 2 4 8 16 32
> 64 128 256 512 1024
>
> If I understand correctly your info.
> The mapserver could search the min/max using only the first tile ?
>
> This mean that it more probably found always only 0 values or near 0 values beacuse these could be the values in the first tile.
>
> And so it return a white image because the min/max is always min=0/
> max=0 (or something quite like this)
> I understand correct ?
>
> thx,
>
> A.
>
>
> 2015-08-04 16:01 GMT+02:00 Even Rouault <even.rouault at spatialys.com>:
>> On Monday 03 August 2015 11:02:43 Andrea Peri wrote:
>>> Hi,
>>> I have a geotiff multibands with float64 values to serve with a wms 
>>> mapserver service.
>>>
>>> With this kind of rasters,
>>> is affordable the directive
>>>
>>>     PROCESSING "BANDS=4,3,2"
>>>     PROCESSING "SCALE=AUTO"
>>>
>>> (the 4,3,2 are the red,green,blue channels)
>>>
>>> Infact it seem do nothing.
>>>
>>> Instead all work well if I set:
>>>
>>>     PROCESSING "BANDS=4,3,2"
>>>     PROCESSING "SCALE_1=0.01,0.2"
>>>     PROCESSING "SCALE_2=0.01,0.2"
>>>     PROCESSING "SCALE_3=0.01,0.2"
>>>
>>> where ii use the min=0.01 and max=0.2 But I like to have the exact 
>>> values of min/max for every raster.
>>
>> Andrea,
>>
>> SCALE=AUTO should work but looking at the actual implementation I can 
>> see it computes the min/max on the pixel values intersecting the 
>> requested area, and not on the whole raster as I'd have expected. So 
>> in a tiling context, it will likely not produce the expected result.
>>
>> Even
>>
>> --
>> Spatialys - Geospatial professional services http://www.spatialys.com
>
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the mapserver-users mailing list