[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| [udig-devel] Re: [-DETECTION SPAM-] [Geotools-devel] Re: Raster	Data Images | 
simone giannecchini a écrit :
[...snip...] it is uncorrect to build a non geophysic view for 
[...snip...] the fact that I really do not have a difference
between the geophysic and non-geophyisic view.
In such a case having a simple hint that allowed me to control the
automatic creation of a non-geophysic view would really be of help!
I agree with a hint if it doesn't duplicates an existing way of doing 
the same. I'm just trying to figure out the implication.
If the geophysics and non-geophysics view are the same, then the 
transform from "geophysics" to "non-geophysics" pixel values should be 
the identity transform, is it right? In such case, GridCoverage2D should 
detect by itself that when the "sampleToGeophysics" transform is an 
identity ones, "geophysics" and "non-geophysics" image are the same 
thing. If it doesn't, it is a bug that should be fixed.
I implemented what I said adding a Hint to the geotools factory class
and some new constructors to GC2D that allow you to provide hint when
you build a GC2D using a RenderedImage. In case yout ask, via the
hint, to NOT create a non-geophyisic view, I simply state that the
transformation between sampleValueRange and GeophysicValueRange is the
identity, therefore geophysic and non-geophysic view are coincident.
I agree with the approach of setting the "sampleToGeophysics" transform 
to identity. I just wonder why a hint is necessary in addition (except 
as a workaround for a possible bug in GridCoverage2D, if it doesn't 
detect by itself that non-geophysics and geophysics views are the same).
The idea is to creates all categories with the following constructors 
(for example):
   Category("The values", colors, lower, upper, 1, 0);
where 'lower' and 'upper' are the range of (geophysics / non-geophysics; 
they are the same) values in yours image, scale=1 and offset=0. If all 
categories are built with scale=1 and offset=0, then GridCoverage2D 
should know that geophysics and non-geophysics values are exactly the 
same, and no additional hints should be needed.
Could it work? I agree that some way of preventing undesired view is 
required, but I'm trying to avoid the "hint" way if it duplicates or 
conflict with the general way. If there is no way to achieve what you 
want using Category in the general way, then we will add the hint.
	Martin.