[Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Martin Tomko
Dear All, I am reading an input from a WCS (a DEM served in output format GeoTiff, the server is Deegree). From the WCS response I construct a GridCoverage2D as follows: (removed all error handling etc): BufferedImage image = image = ImageIO.read(url); WritableRaster inputRaster =

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Michael Bedward
Hi Martin, I can't help at all with the WCS aspect of this question (I know nothing) but as to converting the coverage you have into a single band version (as a last resort solution): if you know the details of the calculation used to create the four bands you can run that in reverse with a JAI

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Simone Giannecchini
IMHO this is a deegree related problem, once you go from raw data to a rendered version is quite hard to go back to the original data, even knowing the style that was applied. If you asking a dem you should get numbers from WCS not colors. Simone.

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Michael Bedward
2009/4/30 Martin Tomko martin.to...@geo.uzh.ch: I asked for a more exact specification of the transformation. I have personally NO experience with handling colors in such situations, and I hope that a solution is possible - we are sort of dependent on the WCS... Martin Well it's guaranteed to

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Simone Giannecchini
Ciao Martin, please read below... --- Ing. Simone Giannecchini GeoSolutions S.A.S. Owner - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob:+39 333 8128928

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Martin Tomko
Dear Simone, Martin, yes, it is unfortunate - but while I will push for a change of the server, it is not a solution in the short term (deadlines!). Simone, if you have a simple code to do the shifting, please, could you share it? I tried searching for something like that, but I am not confident

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Simone Giannecchini
Ciao, michael, Id' take into account that much probably the RGBA data was created using a colormap like approach, hence band combination won't do, unfortunately. I guess that the point is understanding why the data became RGBA at the WCS stage when the suorce data was a dem. Of course, this is

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Martin Tomko
Hi Martin,. Simone, I have asked at the deegree list, and this is the response I got from Andreas: quote this is the way the WCS works. One reason for this is Java or better ImageIO, JAI and Batik which are used by deegree for handling TIFFs. According to these libs it is possible to create a

Re: [Geotools-gt2-users] recalculating multiband geotiff to singel band (DEM)

2009-04-30 Thread Daniele Romagnoli
Hi Martin, on the following link there is some code which allows you to handle 4 bytes as a float and 8 bytes as a double. http://pastebin.com/m58d7f133 Regards, Daniele On Thu, Apr 30, 2009 at 12:19 PM, Martin Tomko martin.to...@geo.uzh.chwrote: Dear Simone, Martin, yes, it is unfortunate