Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-08-03 Thread Martin Desruisseaux
Simone Giannecchini a écrit : > - when you are resampling and you have a targert GR or a targetGridToCRS > the current behavior is correct (this is more a resample than a real > crop) since it strives to meet what the user would expect. > - when you are croppping simply providing an envelope, we

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-29 Thread Simone Giannecchini
Going by memory as far the Resample operation is concerned, I think I understand to what you are referring to. Many JAI operations like Affine, Scale, SubsampleAverage, FilteredSubsample, etc.., do NOT respect the ImageLayout minX, minY, width and height hints. Citing the Affine operations: "It ma

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-29 Thread Martin Desruisseaux
Simone Giannecchini a écrit : > a clarification, by Affine you mean the simple Affine or the Warp Affine > (I would assume the second). I'm not sure it was about the exact type of JAI operation used. I don't think that JAI itself was failing. If I remember right, it was about the destination im

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-29 Thread Simone Giannecchini
Ciao Martin, a clarification, by Affine you mean the simple Affine or the Warp Affine (I would assume the second). Simone. On Tue, Jul 29, 2008 at 4:38 PM, Martin Desruisseaux < [EMAIL PROTECTED]> wrote: > Simone Giannecchini a écrit : > >> What do you mean by the fact that Affine operation wa

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-29 Thread Martin Desruisseaux
Simone Giannecchini a écrit : > What do you mean by the fact that Affine operation was failing? > I think this might bring an important use case in the picture, but as > of now I can't remember any discussion on this issue ( I might be > remembering wrong of course). Anyway, before discussing abou

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-29 Thread Simone Giannecchini
Ciao Martin, What do you mean by the fact that Affine operation was failing? I think this might bring an important use case in the picture, but as of now I can't remember any discussion on this issue ( I might be remembering wrong of course). Anyway, before discussing about the rounding issue itse

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-28 Thread Martin Desruisseaux
Simone Giannecchini a écrit : > Well, with the given semantic I might get an error back since it might > really be that w and/or h in the raster space are 0 after the > rounding you describe in the javadoc. > Same thing would not apply if we followed JAI's or > (rectangle2d.getBounds() if you like

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-24 Thread Simone Giannecchini
Ciao Martin, I think we can put things this way, if I try to crop a coverage providing a very small envelope which fits inside the coverage's envelope I think it would be advisable to return the smallest coverage's area that contains the requested area. Of course, we should adjust the envelope acco

Re: [Geotools-devel] Resample for cropping small parts of a coverage

2008-07-23 Thread Martin Desruisseaux
Hello Simone Simone Giannecchini a écrit : > This little snippet is trying to crop a very small (1/3 of the pixel > width and height) part of a coverage around the lower left corner. If > you try to run this code you'll getn an exception from the Resample > operation. So if I'm understanding corr

[Geotools-devel] Resample for cropping small parts of a coverage

2008-07-21 Thread Simone Giannecchini
Ciao Martin, as I promised during this evening IRC I have spared some time to put together an isolated test case to show the behavior I was talking about. The code is here http://pastebin.com/m53e6a6a8 , it is a simple modification of the testCrop so it is pretty easy to play with in order to spar