Re: [Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-10 Thread Andrea Aime
On Fri, Nov 10, 2017 at 9:40 PM, Andrea Aime 
wrote:

> Ok... but I know for a fact it has not been working in years, you reported
> the problem ages ago no?
>

Unless you reported something else that sounds similar, of course

Cheers
Andrea

-- 

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-10 Thread Andrea Aime
Ok... but I know for a fact it has not been working in years, you reported
the problem ages ago no?
Maybe it draws back to the refactoring leading to the introduction
of jai-ext, not sure, unfortunately I was not involved in the coding.

Cheers
Andrea


On Fri, Nov 10, 2017 at 8:31 PM, Jody Garnett 
wrote:

> I think it is a regression, the style workshop has CSS and YSLD examples
> showing working output from a prior release:
>
> - http://docs.geoserver.org/latest/en/user/styling/
> workshop/css/raster.html#explore-image-processing
> - http://docs.geoserver.org/latest/en/user/styling/
> workshop/ysld/raster.html#challenge-intervals
>
>
>
> --
> Jody Garnett
>
> On 10 November 2017 at 01:26, Andrea Aime 
> wrote:
>
>> On Thu, Nov 9, 2017 at 5:04 PM, John Schulz 
>> wrote:
>>
>>> I'm just looking to start a conversation as I get more familiar with
>>> issue and hoping to get some insight into when this regression came along.
>>>
>>
>> Hi, I have very little familiarity with that portion of the coverage
>> rendering, but don't think that particular case (constrast enhancement
>> without band selection on a image with more than one band) ever worked.
>> What makes you think it's a regression?
>>
>> Cheers
>> Andrea
>>
>> ==
>> GeoServer Professional Services from the experts! Visit
>> http://goo.gl/it488V for more information.
>> ==
>>
>> Ing. Andrea Aime
>> @geowolf
>> Technical Lead
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 
>> 55054  Massarosa
>> 
>> (LU)
>> phone: +39 0584 962313 <+39%200584%20962313>
>> fax: +39 0584 1660272 <+39%200584%20166%200272>
>> mob: +39  339 8844549 <+39%20339%20884%204549>
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
>>
>> Le informazioni contenute in questo messaggio di posta elettronica e/o
>> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
>> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
>> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
>> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
>> darcene notizia via e-mail e di procedere alla distruzione del messaggio
>> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
>> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
>> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
>> principi dettati dal D.Lgs. 196/2003.
>>
>> The information in this message and/or attachments, is intended solely
>> for the attention and use of the named addressee(s) and may be confidential
>> or proprietary in nature or covered by the provisions of privacy act
>> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
>> Code).Any use not in accord with its purpose, any disclosure, reproduction,
>> copying, distribution, or either dissemination, either whole or partial, is
>> strictly forbidden except previous formal approval of the named
>> addressee(s). If you are not the intended recipient, please contact
>> immediately the sender by telephone, fax or e-mail and delete the
>> information in this message that has been received in error. The sender
>> does not give any warranty or accept liability as the content, accuracy or
>> completeness of sent messages and accepts no responsibility  for changes
>> made after they were sent or for other risks which arise as a result of
>> e-mail transmission, viruses, etc.
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> GeoTools-Devel mailing list
>> GeoTools-Devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>>
>


-- 

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messag

Re: [Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-10 Thread Jody Garnett
I think it is a regression, the style workshop has CSS and YSLD examples
showing working output from a prior release:

-
http://docs.geoserver.org/latest/en/user/styling/workshop/css/raster.html#explore-image-processing
-
http://docs.geoserver.org/latest/en/user/styling/workshop/ysld/raster.html#challenge-intervals



--
Jody Garnett

On 10 November 2017 at 01:26, Andrea Aime 
wrote:

> On Thu, Nov 9, 2017 at 5:04 PM, John Schulz 
> wrote:
>
>> I'm just looking to start a conversation as I get more familiar with
>> issue and hoping to get some insight into when this regression came along.
>>
>
> Hi, I have very little familiarity with that portion of the coverage
> rendering, but don't think that particular case (constrast enhancement
> without band selection on a image with more than one band) ever worked.
> What makes you think it's a regression?
>
> Cheers
> Andrea
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> phone: +39 0584 962313 <+39%200584%20962313>
> fax: +39 0584 1660272 <+39%200584%20166%200272>
> mob: +39  339 8844549 <+39%20339%20884%204549>
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
>
> Le informazioni contenute in questo messaggio di posta elettronica e/o
> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia via e-mail e di procedere alla distruzione del messaggio
> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of the named addressee(s) and may be confidential or
> proprietary in nature or covered by the provisions of privacy act
> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
> Code).Any use not in accord with its purpose, any disclosure, reproduction,
> copying, distribution, or either dissemination, either whole or partial, is
> strictly forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender
> does not give any warranty or accept liability as the content, accuracy or
> completeness of sent messages and accepts no responsibility  for changes
> made after they were sent or for other risks which arise as a result of
> e-mail transmission, viruses, etc.
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-10 Thread Andrea Aime
On Thu, Nov 9, 2017 at 5:04 PM, John Schulz 
wrote:

> I'm just looking to start a conversation as I get more familiar with issue
> and hoping to get some insight into when this regression came along.
>

Hi, I have very little familiarity with that portion of the coverage
rendering, but don't think that particular case (constrast enhancement
without band selection on a image with more than one band) ever worked.
What makes you think it's a regression?

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-09 Thread John Schulz
I found that it worked in GeoServer 2.6.5 which is using GeoTools 12.5.
It's not working to well using openlayers (which might be expected in this
version?), however using Normalize in other wms request formats, PNG, JPEG
etc. are working as expected.  From what I recall it was failing all the
way back to 2.7 when you were helping me look into it.

On Thu, Nov 9, 2017 at 12:55 PM, Devon Tucker 
wrote:

> John, which version of GeoServer does this work in?
>
> I looked into this a bit as well. I *believe* that the root issue is an
> ArrayIndexOutOfBounds exception inside the IHSColorSpace conversion, which
> occurs using either JAI or JAIEXT.
>
> https://gist.github.com/dvntucker/b5198a7f7143c234a0613e03bb2970d3
>
> I get the same exception in the JAIEXT version of IHSColorSpace as well.
> This class is reading is reading past the raster bounds, which leads me to
> believe there is something wrong with the Image Layout when doing the IHS
> conversion.
>
> One thing I did notice is that ContrastEnhancementNode is re-using the
> same Hints over and over again, calling ImageWorker.setHints before every
> operation:
>
> https://github.com/geotools/geotools/blob/master/modules/
> library/render/src/main/java/org/geotools/renderer/lite/gridcoverage2d/
> ContrastEnhancementNode.java
>
> I'm not totally sure this is the correct way to use ImageWorker? As I
> understand it from looking at the code, ImageWorker updates its own Hints
> after each call in order to track the updated image layout. I _think_
> calling setRenderingHints each time might be causing issues? However, when
> I tried to remove all these calls it didn't seem to fix the issue, so I
> don't know for sure.
>
> It's also possible that the issue is simply a bug in the IHSColorSpace
> conversion. Possibly a simple off by one error? I didn't look too closely
> at the code to discern whether there might be an issue here. The bug is
> replicated in both the Java and EXT versions, so I assumed not, but it's
> worth looking at.
>
> On Thu, Nov 9, 2017 at 8:04 AM, John Schulz 
> wrote:
>
>> Hi Daniele, and all,
>>
>> I'm looking into an issue involving a contrast enhancement bug for 3 and
>> 4 band rasters found here: https://osgeo-org.atlassian.ne
>> t/browse/GEOT-5860
>>
>> In tracking down the bug it appears to be a regression.  I think that the
>> issue stems from the IHS colorspace conversion section of the
>> ContrastEnhancementNode, where the parameters of the image and the raster,
>> at the very least, appear to get out of synch.
>>
>> I'm just looking to start a conversation as I get more familiar with
>> issue and hoping to get some insight into when this regression came along.
>>
>> Cheers,
>>
>> John
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> GeoTools-Devel mailing list
>> GeoTools-Devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-09 Thread Devon Tucker
John, which version of GeoServer does this work in?

I looked into this a bit as well. I *believe* that the root issue is an
ArrayIndexOutOfBounds exception inside the IHSColorSpace conversion, which
occurs using either JAI or JAIEXT.

https://gist.github.com/dvntucker/b5198a7f7143c234a0613e03bb2970d3

I get the same exception in the JAIEXT version of IHSColorSpace as well.
This class is reading is reading past the raster bounds, which leads me to
believe there is something wrong with the Image Layout when doing the IHS
conversion.

One thing I did notice is that ContrastEnhancementNode is re-using the same
Hints over and over again, calling ImageWorker.setHints before every
operation:

https://github.com/geotools/geotools/blob/master/modules/library/render/src/main/java/org/geotools/renderer/lite/gridcoverage2d/ContrastEnhancementNode.java

I'm not totally sure this is the correct way to use ImageWorker? As I
understand it from looking at the code, ImageWorker updates its own Hints
after each call in order to track the updated image layout. I _think_
calling setRenderingHints each time might be causing issues? However, when
I tried to remove all these calls it didn't seem to fix the issue, so I
don't know for sure.

It's also possible that the issue is simply a bug in the IHSColorSpace
conversion. Possibly a simple off by one error? I didn't look too closely
at the code to discern whether there might be an issue here. The bug is
replicated in both the Java and EXT versions, so I assumed not, but it's
worth looking at.

On Thu, Nov 9, 2017 at 8:04 AM, John Schulz 
wrote:

> Hi Daniele, and all,
>
> I'm looking into an issue involving a contrast enhancement bug for 3 and 4
> band rasters found here: https://osgeo-org.atlassian.net/browse/GEOT-5860
>
> In tracking down the bug it appears to be a regression.  I think that the
> issue stems from the IHS colorspace conversion section of the
> ContrastEnhancementNode, where the parameters of the image and the raster,
> at the very least, appear to get out of synch.
>
> I'm just looking to start a conversation as I get more familiar with issue
> and hoping to get some insight into when this regression came along.
>
> Cheers,
>
> John
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] Looking into contrast enhancement bug for mulit-band rasters

2017-11-09 Thread John Schulz
Hi Daniele, and all,

I'm looking into an issue involving a contrast enhancement bug for 3 and 4
band rasters found here: https://osgeo-org.atlassian.net/browse/GEOT-5860

In tracking down the bug it appears to be a regression.  I think that the
issue stems from the IHS colorspace conversion section of the
ContrastEnhancementNode, where the parameters of the image and the raster,
at the very least, appear to get out of synch.

I'm just looking to start a conversation as I get more familiar with issue
and hoping to get some insight into when this regression came along.

Cheers,

John
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel