Multiband raster as AbstractSelfDescribingAlgorithm result

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiband raster as AbstractSelfDescribingAlgorithm result

Rémi Cresson
This post was updated on .
Hello,

I have implemented a AbstractSelfDescribingAlgorithm which computes a GTRasterDataBinding into another GTRasterDataBinding object (it's basic image processing).

The problem I encountered is that my output has only one band!

I created this toy to show you my problem:

@Override
        public Map<String, IData> run(Map<String, List<IData>> inputData) {

                IData dataset1 = dataList1.get(0);
                GridCoverage2D inputRaster = (GridCoverage2D) dataset1.getPayload();

                HashMap<String,IData> resulthash = new HashMap<String,IData>();
                resulthash.put("result", new GTRasterDataBinding(inputRaster));

                return resulthash;

        }
       
As you can see, this process just output directly its input.
I don't understand why it keeps only the first band...

If i use some GeoTiffWriter (from geotools) to export the file, then its OK: my N bands are here.
I guess it may come from the cast into GTRasterDataBinding..

Can someone explain this to me?

Cheers,

Rémi
Reply | Threaded
Open this post in threaded view
|

Re: Multiband raster as AbstractSelfDescribingAlgorithm result

Rémi Cresson
This post was updated on .
I forgot to mention that the client I use is tue QGis plugin.. It may come from this software. As far I as understand, it seems to save a .asc in a temporary file when it take back the process output. Maybe this file format does not support multi layer.
Reply | Threaded
Open this post in threaded view
|

Re: Multiband raster as AbstractSelfDescribingAlgorithm result

BenjaminPross
Hi Rémi,

I can confirm that the band number of rasters sent to the WPS is not changed by default, so the issue may well be on the side of QGIS, as you are suspecting. I will not have time to investigate this soon, but I would be happy if you could keep us posted on your investigations.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Multiband raster as AbstractSelfDescribingAlgorithm result

Rémi Cresson
Hello,

Indeed it comes from the client. I just give a try with the QGis plugin (with latest QGis version 2.4) and it fails to handle multiband rasters when encoded in GeoTIFF.

However, I notice a second strange thing: Using the same toy (see code in the first post of this topic) I monitored memory usage. And the problem is that the server seems to keep everything (i.e. rasters) in memory, like the AbstractSelfDescribingAlgorithm object is not destroyed after it returns the result. Is that behavior standard? Is there any mecanism to destroy the process after use?
Or maybe I'm completely wrong on this memory thing.

I'll try to find the answer. But if someone has it already, I take !

Cheers,

Rémi