Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Martin Tomko
Dear Simone, thank you very much for the simplified sld and the code. Indeed, there is progress: the change to the last two lines : rsh.visit(rs); ((GridCoverage2D)rsh.getOutput()).show(); helped. I guess this is the way it should be included in the tutorial as well. However, not all is good

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Simone Giannecchini
Ciao Martin, what you are seeing is just a warning, the only consequence (or at least the one you should care of) is that JAI will work in pure java mode, withou native acceleration. About the shaded gray, can you be more specific? Simone.

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Martin Tomko
Hi Simone, thanks for the exaplanation. I would still like to use the acceleration provided through the mlib wrapper, is there a way to use it through maven? Regarding the colors: all the cells are displayed in shades of grey, despite my styling that contains something like: ColorMapEntry

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Martin Tomko
Simone, thanks so much for your help, here it is; code snippet: somewhere in my processing chain, I set up cell values as follows: WritableRaster myraster myraster.setSample(xx, yy, 0, 6); and then: GridCoverageFactory gcFactory = new GridCoverageFactory(); GridCoverage2D gchor =

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Simone Giannecchini
Ciao Martin, two things: 1 can you try to remove the channelselection elemt entirely? 2 can you wrote as geotiff and then send over one of your raster so that I can use it? Simone. --- Ing. Simone Giannecchini GeoSolutions S.A.S. Owner -

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Simone Giannecchini
Ciao Martin, I use the sample code here: http://pastebin.com/f79de1989 with this style: http://pastebin.com/f2dd587d8 and here is the result: http://imagebin.ca/view/CEOGgY.html I am using geotools 2.5.x branch. Simone. --- Ing. Simone

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Martin Tomko
Simone, thanks so much, problem resolved. I had the color ramp commented out, probably during some playing around. All works now, thanks a lot! Cheers Martin -- Open Source Business Conference (OSBC), March 24-25, 2009,

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-17 Thread Simone Giannecchini
Ouch :-). Simone. --- 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 http://www.geo-solutions.it

[Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Martin Tomko
Dear all, I am creating a gridcoverage2D (and consequently a geotiff, based on processing of a source geotiff DEM), and I want to quickly visualize the results of the analysis. Instead of opening it in some GIS, I would like to assign a color model to the result.and display it through the

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Simone Giannecchini
Ciao Martin, a way to achieve that is by using the RasterSymbolizer (2.5.0 and successive releases). See http://docs.codehaus.org/display/GEOTOOLS/Raster+Symbolizer+support for more information. Simone. --- Ing. Simone Giannecchini GeoSolutions

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Martin Tomko
Hi Simone, that looks good. HOw do you create the Stle factroy (is is not in the code...and I did not do any styling before...). Could you maybe also upload the imports in that tutorial, please? Cheers Martin Simone Giannecchini wrote: Ciao Martin, a way to achieve that is by using the

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Martin Tomko
Hi Simone, I have solved the Style factory problem as follows: SLDParser stylereader = new SLDParser(new StyleFactoryImpl() , sldfile); I have imported the UserLayer, Style and all following classess from org.geotools.styling (it seems that classes with the same name are also in

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Simone Giannecchini
Ciao Martin, please, send over the SLD file you are using. Simone. --- Ing. Simone Giannecchini GeoSolutions S.A.S. Owner - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob:

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Martin Tomko
Hi Simone, I used the one in your example, with changed values that are to be mapped, as follows: Thanks Martin ?xml version=1.0 encoding=UTF-8 ? - # StyledLayerDescriptor xmlns=*http://www.opengis.net/sld*; xmlns:ogc=*http://www.opengis.net/ogc*; xmlns:xlink=*http://www.w3.org/1999/xlink*;

Re: [Geotools-gt2-users] assign colors to GridCoverage2D (or geotiff )

2009-02-16 Thread Simone Giannecchini
Ciao Martin, I copied and pasted (with few modifications) your stile inside the renderer tests and it worked. I am attaching it to this email. The code used is as follows: RasterSymbolizerHelper rsh = new RasterSymbolizerHelper(gc, null); final UserLayer nl =