Hei Alberto, late answer but something just came to my mind. There was an ESRI Grid plugin by Erwan Bocher for OpenJUMP that allowed to display different colors for a DEM. That should be something we want - right?
I think the code is here: http://geosysin.iict.ch/irstv-trac/browser/openjump/plugin/gridCoverage/org/reso/openJump/raster?rev=96 can you look into it? Not sure what would be needed to make it work with OpenJUMP and the Sextante Raster. But we can do changes to the core here... stefan PS: I was last week away - so thats why I didn't respond earlier; need to catch up with emails now. Alberto De Luca schrieb: > Larry and Steven, > > sorry for bothering you, I know you're both busy... I had a deeper look > at the RasterImageLayer class. Apparently there is a scaling function > there (as Stefan pointed out), but for what I can understand, the image > is read, then rescaled, then added to a Layerable. This means that the > Layerable stores the already scaled cell values and, if the actual cell > values are needed, the image needs to be reloaded. > > I don't see how this model can be tweaked to have on one side the cell > values stored in memory and on the other a Layerable that can be > rendered properly. What do you reckon? Please tell me I'm wrong. > > Thanks > Alberto > > On 29/06/2010 16:32, Larry Becker wrote: >> Hi Alberto, >> >> I did take a look at the render architecture to see how it might be >> done, but unfortunately I don't have a lot of time right now to help >> with this effort so any advice I have is only a guess, but I think it >> might have to happen in the image layer's paint method. >> >> Larry >> >> On Tue, Jun 29, 2010 at 2:01 AM, Alberto De Luca >> <i...@geomaticaeambiente.it <mailto:i...@geomaticaeambiente.it>> wrote: >> >> Stefan and Larry, >> >> thank you for your help. Unfortunately I'm not an expert either, >> so I'm >> really not sure about what to do. I kind of like Larry's approach >> (but I >> need to think about it to see if I can work something out of it). I'll >> have a deeper look at the pirol classes too... >> >> Alberto >> >> On 28/06/2010 21:49, Stefan Steiniger wrote: >> > actually.. wasn't there a scaling function somewehere in the >> pirol classes? >> > so the place to correct is in those? >> > >> > Alberto De Luca schrieb: >> > >> >> Dear OJ developers, >> >> >> >> I was working on the Sextante classes, trying to enhance raster >> support >> >> and visualization capabilities. Having a powerful raster >> management is >> >> important so we can port to OJ all the raster plugins we >> developed for >> >> the OJ-derived AdB-ToolBox (we exchanged some emails on the topic a >> >> while ago). >> >> >> >> So, as a first attempt, I tried to add ESRI FLT raster support, >> adding >> >> some lines of code to the RasterImageLayer class. I am here >> facing a >> >> dilemma though. >> >> >> >> The loadImage method returns a planarimage, which is then >> displayed on >> >> the screen. >> >> If I read the FLT file into a TiledImage whose SampleModel is >> >> DataBuffer.TYPE_FLOAT (to match the data model of the FLT file) and >> >> return it to be displayed, OJ loads it ok, but the raster >> displayed is >> >> completely blank. I know it's there because I can export its >> envelope >> >> and I can read cell values (using the OpenJUMPSextanteRasterLayer >> >> class), values that exactly match the values stored in the FLT >> file. >> >> If after creating the TiledImage I rescale it into a 0-255 range >> >> PlanarImage, I can display it ok (as a grayscale for example) >> but then >> >> when I read the cell values from the raster layer, they're clearly >> >> different from the original FLT values. >> >> >> >> My question is: is there a way to have a correct visualization >> while >> >> maintaining access to the actual cell values? In >> >> www.lac.inpe.br/JIPCookbook/2200-display-surrogate.jsp >> <http://www.lac.inpe.br/JIPCookbook/2200-display-surrogate.jsp> >> >> <http://www.lac.inpe.br/JIPCookbook/2200-display-surrogate.jsp> >> they >> >> suggest the use of the javax.media.jai.iterator.RandomIter class to >> >> access cell values after the image has been rescaled. Would this be >> >> appropriate in OJ? >> >> >> >> In the attached GridFloat.java you can find the code used to >> read the >> >> FLT grid (see the readGrid and the getPlanarImage methods). Also >> >> attached you can find my modified RasterImageLayer class (see in >> >> particular the loadImage method). >> >> >> >> Please consider I'm not a good programmer, so I might just be on a >> >> completely wrong track... >> >> Thanks >> >> Alberto >> >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> This SF.net email is sponsored by Sprint >> >> What will you do first with EVO, the first 4G phone? >> >> Visit sprint.com/first <http://sprint.com/first> -- >> http://p.sf.net/sfu/sprint-com-first >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> >> Jump-pilot-devel mailing list >> >> Jump-pilot-devel@lists.sourceforge.net >> <mailto:Jump-pilot-devel@lists.sourceforge.net> >> >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> >> >> > >> >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Sprint >> > What will you do first with EVO, the first 4G phone? >> > Visit sprint.com/first <http://sprint.com/first> -- >> http://p.sf.net/sfu/sprint-com-first >> > _______________________________________________ >> > Jump-pilot-devel mailing list >> > Jump-pilot-devel@lists.sourceforge.net >> <mailto:Jump-pilot-devel@lists.sourceforge.net> >> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> > >> > >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first <http://sprint.com/first> -- >> http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> <mailto:Jump-pilot-devel@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> >> >> _______________________________________________ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > > ------------------------------------------------------------------------ > > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel