Are you saying you want to make an image a given resolution, as in 800 x
600?  For this I use the following method:

public static RenderedImage rescale(RenderedImage image, int width,
int height) {
 float xScale = (float) width / (float) image.getWidth();
float yScale = (float) height / (float) image.getHeight();

ParameterBlock pb = new ParameterBlock();
pb.add(xScale).add(yScale).addSource(image);
 return JAI.create("scale", pb);
}

You obviously need to create a new GridCoverage2D from the result.  I'm not
sure if there's a simpler GeoTools way of doing it, I would be interested to
find out if there is!

Jon

On 20 May 2010 10:19, Adnila <[email protected]> wrote:

>
> hey guys,
> I still do not get it. can anybody help me please?
>
> here is my original post:
> Hey all,
> now I am trying to use a fixed resolution for a rescaling of a
> gridcoverage2D.
> The user should be able to choose a resolution from a GUI.
> What am I supposed to do if I want the rescaling with a fixed resolution
> for
> example from 500m to 1000m. I need a generic solution.
>
> At the moment I am just able to reproject (change values of grid, too) a
> gridcoverage2D to another CRS:
>
> crs_ETRS89_LAEA = CRS.decode("EPSG:3035");
> // convert GridCoverage2D to ETRS89_LAEA
> gc2DCRSconvert = (GridCoverage2D) Operations.DEFAULT.resample(gc2D,
> crs_ETRS89_LAEA);
>
> which method am I supposed to use for the fixed resolution?
>
> has anybody any idea? I really do need something with a fixed resolution.
> And I want to use IDW for interpolating the values.
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Rescale-GridCoverage2D-with-fixed-resolution-tp5008772p5078851.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to