Hi Luigi,
yesterday I was writing you this reply but there was a blackout in the whole building so… I have seen other guys already suggested something.
Sending anyway my email for further info, just in case…
The GT Extrema operation is based on JAI Extrema op which doesn’t support NoData so it doesn’t know that -9999 is a noData and therefore it returns that value as the minimum.
A workaround you may try is providing a ROI (Region Of Interest) based on a threshold value to exclude some regions of the input image from the computations.
http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/operator/ExtremaDescriptor.html
You can create a ROI on top of the input RenderedImage using a threshold value. Only pixels inside the ROI will be taken into account by statistics.
http://docs.oracle.com/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/ROI.html#ROI%28java.awt.image.RenderedImage,%20int%29
As an instance, if -9999 is the minimum “bad” value and you know that all your values are >= A (Where A > -9999), you can do
ROI roi = new ROI(inputRenderedImage, A);
OperationJAI op=new OperationJAI(“Extrema”);
ParameterValueGroup params = op.getParameters();
params.parameter(“roi”).setValue(roi);
…
I know, that isn’t the optimal solution (especially for the ROI computation) but it may help.
Cheers,
Daniele
Ing. Daniele Romagnoli
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
On Thu, Feb 6, 2014 at 4:29 PM, Luigi Marotta <luigi.marotta@anonymised.com> wrote:
Hi list,
I’m trying to built a WPS to evaluate the basic statistic information of coverage data usign org.geotools.coverage.processing.OperationJAI.Extrema but minimum value is coincident with noData value (i.e. -9999, correctly reported as nodata by gdalinfo). Is there some method, in this class, to obtain the right minimum and maximum?
Thx
Luigi Marotta
IT Specialist - Ariespace s.r.l - Spin off Company
Università degli Studi di Napoli “Federico II”
Centro Direzionale IS. A3
80143 - Napoli - Italy
tel.: (+39) 08119564282
fax: (+39) 08119564223
mob.: (+39) 3478836273
skypecontact: live:luigi.marotta
PRIVACY
Le informazioni contenute in questo messaggio sono riservate e confidenziali. Il loro utilizzo e’ consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandocene gentilmente comunicazione. Ogni utilizzo improprio e’ contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 2002/58/CE).
The information in this e-mail is intended for the named recipients only. It may contain privileged and confidential information. If you have received this communication in error, any use, copying or dissemination of its contents is strictly prohibited. Please erase all copies of the message along with any included attachments and notify the sender immediately.
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users