Hi Jukka, Ede.
I had other raster like thayt in the past. A raster with two bands.
Band 1 are the datas. Band 2 usually has a fixed value of 255 for all
the pixels.
OpenJUMP has tools to correct that problem. Just follow these steps:
Analysisa) open the image (ex. crop.tif) as Sextante Raster Image. The
color of the icon on layer tree will show if the image is monoband (the
icon is gray) or multibands (the icon is coloured - currently OJ seems
to manage only 3 bands+4° transparency)b) Using Raster Layer info tool
on layer tree, it is possible to check the bands. Regarding the images
that Jukka sent, Two bands were detected, one (band 1) with a range of
values, the second (band 2) with only one value (255). Band 1 is what
we need.
Operationc) Open Sextante tools>Calculus tools for raster layer>Raster
Calculator(*)d) On upper-left window double click on Layer> crop Band1
(in my linix PC it shows cropBand1)e) the windows in the middle of the
panel should show "crop Band1" (or "cropBand1 in my linux PC).f) on
"result" combo box choose the output file, ex crop_monog) click on OK
The result file crop_mono.tif will be the the raster file depurated by
the band 2
Note that Sextante tool still save raster with its worldfile even if I
think I did a mofication some yeras ago to save georeference info into
the tif file (almost as a geotiff)
Best regards
Peppe
(*) Raster Calculator is so useful for many problems that we should
move in a upper menu one day

Il giorno lun, 13/01/2020 alle 11.03 +0000, Rahkonen Jukka (MML) ha
scritto:
> This is weird but for me the eka.tif opens as 1-band image through
> the Sextante Raster Image. However, a subsample that I made by
> cropping and saving with the OpenJUMP crop tool opens as 2-band. I
> could not find any fundamental difference between the tiffs with
> gdalinfo and tiffdump.
> 
> And now while writing I got it! The 2-band tiff written with the GDAL
> defaults is using per band interleaving but at least on my machine
> Sextante reports the second band only if tiff has been written as
> pixel interleaved.
> 
> This is so difficult issue that it may be better to forget it for
> now.
> 
> -Jukka-
> 
> 
> ________________________________________
> Lähettäjä: edgar.sol...@web.de <edgar.sol...@web.de>
> Lähetetty: 13. tammikuuta 2020 12:18
> Vastaanottaja: jump-pilot-devel@lists.sourceforge.net
> Aihe: Re: [JPP-Devel] Some issue with raster color styles and legend
> 
> Peppe,
> 
> if you want the fixed RasterLegendPlugin in the OJ 1.15, please do so
> soonish. generally i'm inclined to release this month still.
> 
> ..ede
> 
> On 13.01.2020 10:32, Giuseppe Aruta wrote:
> > Hi Jukka,
> > the file that you attached (eka.tif) seems to have 2 bands (raster
> > layer info too on layer tree). Raster style legend should be
> > deactivated in this case as it works only with monoband raster
> > layers.
> > 
> > Best regard
> > Peppe
> > 
> > 
> > 
> > Il giorno dom, 12/01/2020 alle 18.31 +0000, Rahkonen Jukka (MML) ha
> > scritto:
> > > Hi,
> > > 
> > > My environment:
> > > openjdk version "1.8.0_232"; OpenJDK Runtime Environment
> > > Corretto-
> > > 8.232.09.1 (build 1.8.0_232-b09); OpenJDK 64-Bit Server VM
> > > Corretto-
> > > 8.232.09.1 (build 25.232-b09 mixed mode)
> > > 
> > > OJ-r6217-Plus
> > > 
> > > Issue: Open the attached 16-bit image (I will send a link later
> > > if
> > > attachment is dropped) as Sextante image and try to open the
> > > raster
> > > style legend by pressing the + in the layer lists. This leads to
> > > an
> > > exception:
> > > 
> > > Exception in thread "AWT-EventQueue-0"
> > > java.lang.IllegalArgumentException: User must specify at least 2
> > > colors
> > >         at
> > > java.awt.MultipleGradientPaint.<init>(MultipleGradientPaint.java:
> > > 169)
> > >         at
> > > java.awt.LinearGradientPaint.<init>(LinearGradientPaint.java:286)
> > >         at
> > > java.awt.LinearGradientPaint.<init>(LinearGradientPaint.java:244)
> > >         at
> > > java.awt.LinearGradientPaint.<init>(LinearGradientPaint.java:139)
> > >         at
> > > org.openjump.core.rasterimage.styler.ui.GradientCanvas.paint(Grad
> > > ient
> > > Canvas.java:92)
> > >         at
> > > javax.swing.JComponent.paintChildren(JComponent.java:889)
> > >         at javax.swing.JComponent.paint(JComponent.java:1065)
> > >         at
> > > javax.swing.JComponent.paintChildren(JComponent.java:889)
> > >         at javax.swing.JComponent.paint(JComponent.java:1065)
> > >         at
> > > javax.swing.JComponent.paintChildren(JComponent.java:889)
> > >         at javax.swing.JComponent.paint(JComponent.java:1065)
> > >         at
> > > org.openjump.core.rasterimage.styler.RasterLegendPlugIn.save(Rast
> > > erLe
> > > gendPlugIn.java:314)
> > >         at
> > > org.openjump.core.rasterimage.styler.RasterLegendPlugIn$3.actionP
> > > erfo
> > > rmed(RasterLegendPlugIn.java:226)
> > >         at
> > > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.jav
> > > a:20
> > > 22)
> > >         at
> > > javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton
> > > .jav
> > > a:2348)
> > >         at
> > > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonM
> > > odel
> > > .java:402)
> > >         at
> > > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java
> > > :259
> > > )
> > >         at
> > > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicBut
> > > tonL
> > > istener.java:252)
> > >         at
> > > java.awt.Component.processMouseEvent(Component.java:6539)
> > >         at
> > > javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
> > >         at java.awt.Component.processEvent(Component.java:6304)
> > >         at java.awt.Container.processEvent(Container.java:2239)
> > >         at
> > > java.awt.Component.dispatchEventImpl(Component.java:4889)
> > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:2297)
> > >         at java.awt.Component.dispatchEvent(Component.java:4711)
> > >         at
> > > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:
> > > 4904
> > > )
> > >         at
> > > java.awt.LightweightDispatcher.processMouseEvent(Container.java:4
> > > 535)
> > >         at
> > > java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
> > >         at
> > > java.awt.Container.dispatchEventImpl(Container.java:2283)
> > >         at java.awt.Window.dispatchEventImpl(Window.java:2746)
> > >         at java.awt.Component.dispatchEvent(Component.java:4711)
> > >         at
> > > java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
> > >         at java.awt.EventQueue.access$500(EventQueue.java:97)
> > >         at java.awt.EventQueue$3.run(EventQueue.java:709)
> > >         at java.awt.EventQueue$3.run(EventQueue.java:703)
> > >         at java.security.AccessController.doPrivileged(Native
> > > Method)
> > >         at
> > > java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersect
> > > ionP
> > > rivilege(ProtectionDomain.java:74)
> > >         at
> > > java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersect
> > > ionP
> > > rivilege(ProtectionDomain.java:84)
> > >         at java.awt.EventQueue$4.run(EventQueue.java:733)
> > >         at java.awt.EventQueue$4.run(EventQueue.java:731)
> > >         at java.security.AccessController.doPrivileged(Native
> > > Method)
> > >         at
> > > java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersect
> > > ionP
> > > rivilege(ProtectionDomain.java:74)
> > >         at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
> > >         at
> > > java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatch
> > > Thre
> > > ad.java:205)
> > >         at
> > > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThr
> > > ead.
> > > java:116)
> > >         at
> > > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatch
> > > Thre
> > > ad.java:105)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
> > > 101)
> > >         at
> > > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
> > > 93)
> > >         at
> > > java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
> > > 
> > > -Jukka Rahkonen-
> > > _______________________________________________
> > > Jump-pilot-devel mailing list
> > > Jump-pilot-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> > 
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> > 
> 
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to