On Sat, Aug 13, 2011 at 12:27 AM, Scott Ellis <[email protected]> wrote:

> Hi, I have registered some 16-bit Quickbird GeoTIFF raster data with
> GeoServer WMS and am displaying it in a browser using OpenLayers. The raster
> data for the whole file ranges from 52 to 2047. The problem is that
> ImageWorker.rescaleToBytes() stretches the raster data to fit from 0 to 255
> based on the extrema of the particular tile or bounding box it is working on
> instead of the extrema of the overall file. This means the image looks good
> when zoomed out, but as you zoom in the problem gets worse and worse. Please
> see the attached image below. In the middle of the lake, the extrema for
> that tile has a very narrow range so the effect is most apparent. The same
> problem appears in single tile mode based on the bounding box. ****
>
> ** **
>
> Shouldn’t ImageWorker.rescaleToBytes() use the extrema for the whole file
> when it does the stretch and not the extrema for the individual tile or
> bbox? ****
>
> **
>

ImageWorker uses the image it receives, but the raster is clipped on read to
the area that is
needed to serve the request.
As said in my GeoServer user list response, using the entire file would be
highly problematic,
mosaics of multiple terabytes in size are not uncommon

There is no good path to have the rescaling use the stats of the entire file
either, since by
the time the code reaches there any reference to the original file is long
gone (assuming
it was a file at all, we can read rasters from sde and oracle too), meaning
attaching the
stats to the data source would do us no good either.

To address your need we'd have to do what MapServer does, have the scaling
extrema
declared in the SLD, something like (thinking out loud here, don't take this
xml too seriously):

<RasterSymbolizer>
...
<Scale>
  <Band name="...">
    <Min>...</Min>
    <Max>...</Max>
  </Band>
  <Band ...>
    ...
  </Band>
</Scale
...
</RasterSymbolizer>

This would require an extension to the GeoTools RasterSymbolizer API and
modifications
to the code so that scaling is done during rendering under the guidance of
the new
element.

In order to do that we'd have to break the current API, so a proposal voted
by the
control commitee is required, and then somone has to take the time to alter
the interface, its implementation, and all relevant usage points in GeoTools
and
GeoServer

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy 
to use, easy to manage, easy to install, easy to extend. 
Get a Free download of the new open ALM Subversion platform now.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to