Jody Garnett a écrit :
> Right; and on this list we have the implementors to worry about; can an
> abstract class help with the transition for implementors?
> 
> I am thinking along the lines of:
> abstract AbstractGridCoverage2D implements GridCoverage2d {       
> GridCoverage2D geophysics(boolean isGeophysics){
>     return view( isGeophysics ? ViewType.GEOPHYSICS : ViewType.NATIVE };
> }

Actually GridCoverage2D is a class (not an interface) and the "geophysics"
method has been deprecated almost exactly in the way you suggest.

As far as GridCoverage2D subclasses are concerned, things should be okay. The
implementations that we need to care about are not GridCoverage2D, but image
operations (Operator2D). More specifically the moment when an operation decides
if it should do its work on the geophysics, photographic or packed views.

For peoples who work on RGB images, this is not really a concern; all operations
are performed on RGB space. But for peoples who work on geophysics value, there
is a dileme. Operations must generally be performed on floating point values
(performing them on pixel values would be wrong). I.e. the operation chain must 
be:

Legend:  --sg-->  =  sample to geophysics transform
         --op-->  =  the image operation I want to perform

1)   [packed image]  --sg-->  [geophysics image]  --op-->  [geophysics image]

however a few cases exist where the following chain would produces same results:

2)   [packed image]  --op-->  [packed image]  --sg-->  [geophysics image]

The first chain is right but slower. The second chain is faster but wrong except
in a few special cases. The problem is that:

  * We want correct results.
  * We want fastest computation when possible.

but "when possible" is really operation-dependent. For "Resample", this is "when
interpolation = nearest neighboard". For "Crop", this is always. For
"GradientMagnitude", this is never. The complicated (and controversial) stuff is
the mechanism that attempt to choose the fastest path that produce correct
results, and this choice is performed by the operations themself.

So the affected implementors are not GridCoverage2D implementors, but a
particular kind of users: the one who creates coverage operations.

        Marton


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to