Simone Giannecchini a écrit :
> 1> in order to downsample an image, i would take a look at the various
> scale operations which are tailored for that scope.
Well... OGC 01-004 defines only "Resample" while they are silent on "Scale" or
"Crop" operation. It can probably be understood by the fact that "Resample" is
the general case, and the implementation can optimizes to "Scale" or "Crop"
internally based on argument analysis.
The main difference between using a "Scale" or a "Resample" operation is in the
kind of parameters given ("Resample" requires a GridGeometry, which is probably
not the most intuitive construct) and in the additional cost involved inside
the
"Resample" operation for analysing the parameters and realizing that it can
optimize to "Scale" - but the later cost is very likely to be imperceptible
compared to the cost of performing the actual raster scale or resampling.
> There is only one caveaut: being based on JAI scale operations there
> is no way to set the expected final width and heigh but this depends
> slightly on the operation used. If you want to get some W and H
> explicitly you need to use the resample operation which is backed by
> the JAI Warp operation for subsampling.
This is true for JAI's "Scale", "Translate", "Rotate" and "Affine" operations.
However the JAI's "Warp" operation backed by a WarpAffine allow us to set the
width and height (i.e. the GridGeometry) with same performance I think. Again
"Resample" tries to make automatically the best choice based on an analysis of
provided arguments.
> 2>If you just want to reproject to another CRS you can avoid providing
> the gridgeometry. Just providing the target CRS would suffice.
Yes... But I don't suggest to apply a "Scale" operation followed by a
"Resample"
operation. I suggest that you rely only on "Resample" with a GridGeometry
taillored to your wish and let "Resample" performs the optimal choice. It allow
it to performing everything (scale, crop, reprojection) in a single JAI
operation rather than a chain of many JAI operations. This approach (and other
stuff) has helped us to get more performance and lower memory usage than
geoserver for raster WMS.
The inconvenient is that everything depends on "Resample", so we need to invest
more effort in it for making it bug free and intelligent enough for optimizing
the common cases.
Regards,
Martin
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users