[Geoserver-devel] Building a Kmeans Image clustering class to geoserver

Hi. I 'm trying to build a Kmeans Image clustering algorithm into WPS service. My project consist of two java classes: the first one contains the actual algorithm and the other contains the DescribeParameter etc. The first class uses JAI and the output image is TiledImage. I have build the project into geoserver and the second class work fine , so i can populate the parameters.When I try to run it , I get a black image as an output(but it doesn’t crashes). The log I get is the following:

2014-04-08 15:27:51,436 INFO [geoserver.wps] -
Request: execute
service = WPS
version = 1.0.0
baseUrl = http://localhost:8080/geoserver/
identifier:
value = gs:Kmeans
dataInputs:
input[0]:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value: coverage, codeSpace: null)
reference = net.opengis.wps10.impl.InputReferenceTypeImpl@anonymised.com (body: net.opengis.wcs11.impl.GetCoverageTypeImpl@anonymised.com (service: WCS, version: 1.1.1, baseUrl: null, extendedProperties: {}), encoding: null, href: http://geoserver/wcs, method: POST, mimeType: image/tiff, schema: null)input[0]:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value: number of clusters, codeSpace: null)
data = net.opengis.wps10.impl.DataTypeImpl@anonymised.com[0]:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value: maximum iterations, codeSpace: null)
data = net.opengis.wps10.impl.DataTypeImpl@anonymised.com[0]:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value: epsilon, codeSpace: null)
data = net.opengis.wps10.impl.DataTypeImpl@anonymised.com
responseForm:

Note that the algorithm is running well on eclipse and i get the segmented image as expected.

What may I have done wrong?
I 'm running geoserver 2.4.0 with the updated patch main 2.4 - SNAPSHOT

On Tue, Apr 8, 2014 at 2:53 PM, lewnidas sketo <lepa_aun@anonymised.com> wrote:

Hi. I 'm trying to build a Kmeans Image clustering algorithm into WPS
service. My project consist of two java classes: the first one contains the
actual algorithm and the other contains the DescribeParameter etc. The
first class uses JAI and the output image is TiledImage. I have build the
project into geoserver and the second class work fine , so i can populate
the parameters.When I try to run it , I get a black image as an output(but
it doesn't crashes). The log I get is the following:

2014-04-08 15:27:51,436 INFO [geoserver.wps] -
Request: execute
    service = WPS
    version = 1.0.0
    baseUrl = http://localhost:8080/geoserver/
    identifier:
        value = gs:Kmeans
    dataInputs:
        input[0]:
            identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com(value: coverage, codeSpace: null)
            reference =
net.opengis.wps10.impl.InputReferenceTypeImpl@anonymised.com (body:
net.opengis.wcs11.impl.GetCoverageTypeImpl@anonymised.com (service: WCS, version:
1.1.1, baseUrl: null, extendedProperties: {}), encoding: null, href:
http://geoserver/wcs, method: POST, mimeType: image/tiff, schema:
null)input[0]:
            identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com(value: number of clusters, codeSpace: null)
            data = net.opengis.wps10.impl.DataTypeImpl@anonymised.com[0]:
            identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com(value: maximum iterations, codeSpace: null)
            data = net.opengis.wps10.impl.DataTypeImpl@anonymised.com[0]:
            identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com(value: epsilon, codeSpace: null)
            data = net.opengis.wps10.impl.DataTypeImpl@anonymised.com
    responseForm:

Note that the algorithm is running well on eclipse and i get the
segmented image as expected.

What may I have done wrong?

Don't know, I'd probably try to intercercept the PPIO that is encoding your
image, and see if it's that one, or
if your tiled image has some odd combination of sample model and color
model that the
JAI ImageIO encoders cannot handle well

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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

-------------------------------------------------------