[Geoserver-users] NetCDF coverage store, reading method error

Dear Geoserver-users list,

I'm developping a coverage store for geoserver to manage a netCDF file. In the implementation of this coverage store, I have an error when I use the method "reader.setInput(inStream)".
Here is a little part of the "read" method :

public GridCoverage read(GeneralParameterValue params) throws IllegalArgumentException, IOException {
    ...
    // Construct a reader
    final ImageReader reader = readerSpi.createReaderInstance(null);
    final ImageInputStream inStream;
    if (source instanceof File || source instanceof URL) {
        inStream = ImageIO.createImageInputStream(source);
    } else {
        throw new IllegalArgumentException("The source parameter is not a valid input type !");
    }
    reader.setInput(inStream, true);
    ...
}

The error displayed in geoserver is :
org.vfny.geoserver.global.ConfigurationException: java.lang.IllegalArgumentException: Incorrect input type!
This occurs when I try to create a coverage for the coverage store that I have previously created in geoserver.
The tomcat's logs say :

org.vfny.geoserver.global.ConfigurationException: java.lang.IllegalArgumentException: Incorrect input type!
    at org.vfny.geoserver.action.data.DataCoveragesNewAction.execute(DataCoveragesNewAction.java:155)
    ....
Caused by: java.lang.IllegalArgumentException: Incorrect input type!
    at javax.imageio.ImageReader.setInput(Unknown Source)
    at fr.geomatys.netCDF.io.FileBasedReader.setInput(FileBasedReader.java:90)
    at fr.geomatys.netCDF.io.DefaultReader.setInput(DefaultReader.java:88)
    at javax.imageio.ImageReader.setInput(Unknown Source)
    at fr.geomatys.netCDF.NetcdfReader.read(NetcdfReader.java:221)
    at org.vfny.geoserver.action.data.DataCoveragesNewAction.execute(DataCoveragesNewAction.java:139)
    ... 24 more

Actually my netCDF coverage store is recognised in geoserver, I can create a coverage store for my netCDF file, the method read(GeneralParameterValue params) is the main problem.

Cheers,
Cédric B.

Ciao Cedric,
sorry for getting back to you with such a delay but it is a busy period.
See below...

On 10/11/06, Cédric Briançon <cedric.briancon@anonymised.com> wrote:

Dear Geoserver-users list,

I'm developping a coverage store for geoserver to manage a netCDF file.
In the implementation of this coverage store, I have an error when I use
the method "reader.setInput(inStream)".
Here is a little part of the "read" method :

public GridCoverage read(GeneralParameterValue params) throws
IllegalArgumentException, IOException {
   ...
   // Construct a reader
   final ImageReader reader = readerSpi.createReaderInstance(null);
   final ImageInputStream inStream;
   if (source instanceof File || source instanceof URL) {
       inStream = ImageIO.createImageInputStream(source);
   } else {
       throw new IllegalArgumentException("The source parameter is not
a valid input type !");
   }
   reader.setInput(inStream, true);
   ...
}

The error displayed in geoserver is :
org.vfny.geoserver.global.ConfigurationException:
java.lang.IllegalArgumentException: Incorrect input type!
This occurs when I try to create a coverage for the coverage store that
I have previously created in geoserver.
The tomcat's logs say :

org.vfny.geoserver.global.ConfigurationException:
java.lang.IllegalArgumentException: Incorrect input type!
   at
org.vfny.geoserver.action.data.DataCoveragesNewAction.execute(DataCoveragesNewAction.java:155)
   ....
Caused by: java.lang.IllegalArgumentException: Incorrect input type!
   at javax.imageio.ImageReader.setInput(Unknown Source)
   at
fr.geomatys.netCDF.io.FileBasedReader.setInput(FileBasedReader.java:90)
   at fr.geomatys.netCDF.io.DefaultReader.setInput(DefaultReader.java:88)
   at javax.imageio.ImageReader.setInput(Unknown Source)
   at fr.geomatys.netCDF.NetcdfReader.read(NetcdfReader.java:221)
   at
org.vfny.geoserver.action.data.DataCoveragesNewAction.execute(DataCoveragesNewAction.java:139)
   ... 24 more

Actually my netCDF coverage store is recognised in geoserver, I can
create a coverage store for my netCDF file, the method
read(GeneralParameterValue params) is the main problem.

Cheers,
Cédric B.

I have to say that it is really clear to me what you means by the
method "reader.setInput(inStream)". But I guess you are talking about
adn ImageReader subclass. A bit more info would be of much help.

I think I already talked to Martin about this, I think having somehow
access to this reader you are implementing (even to a snapshot of it)
would be interesting for the both of us as well as for the
geotools/geoserver community since Alex Petkov and Myself (well not
really me but one of my guys) are all working in background on a
netcdf reader/writer.

Hope to hear to you soon! (well at least sooner than you heard from
me, sorry again man :slight_smile: ).

Simone.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
-------------------------------------------------------
Eng. Simone Giannecchini
President /CEO GeoSolutions

http://www.geo-solutions.it

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

Simone Giannecchini a écrit :

I think I already talked to Martin about this, I think having somehow
access to this reader you are implementing (even to a snapshot of it)
would be interesting for the both of us as well as for the
geotools/geoserver community since Alex Petkov and Myself (well not
really me but one of my guys) are all working in background on a
netcdf reader/writer.

I just noticed that an "unsupported" directory has been added recently to Geotools trunk. I will move the code there tomorrow.

  Martin.

Hello Simone and Geoserver devel list,

as Martin has already said in a previous mail, he has commited last week a version of the netCDF coverage store on the svn of geotools at this address :
http://svn.geotools.org/geotools/trunk/spike/netcdf.

For this project, I wonder how to select a depth for my netCDF file. Because I have several depths in this file, and for now, I only work with the first one.
So can I specify a depth in the URL ? If it is the case, how can I get back this value, to display the Grid Coverage for the selected depth ?

In the WCS specifications for the GetCoverage request, there is a "Depth" parameter, and I wonder if I can't use it to specify it ?
At this page, we can found this parameter : http://docs.codehaus.org/display/GEOSDEV/GeoServer+WCS+Specifications.
We have tested to modify the BBOX values, like this "-180,-90,0,180,90,10", in adding a wished third dimension to select 0 to 10 for depth, but it doesn't work.

Cheers,
Cédric B.

Hi Cedric,

There are a few examples at this address:

http://docs.codehaus.org/display/GEOS/Multidimensional+WCS

Cheers,

Adit

-----Original Message-----
From: geoserver-devel-bounces@lists.sourceforge.net
[mailto:geoserver-devel-bounces@lists.sourceforge.net] On Behalf Of Cédric
Briançon
Sent: 25 October 2006 15:52
To: Simone Giannecchini
Cc: Geoserver-devel; Martin Desruisseaux
Subject: [Geoserver-devel] NetCDF coverage store, depth parameter ?

Hello Simone and Geoserver devel list,

as Martin has already said in a previous mail, he has commited last week
a version of the netCDF coverage store on the svn of geotools at this
address :
http://svn.geotools.org/geotools/trunk/spike/netcdf.

For this project, I wonder how to select a depth for my netCDF file.
Because I have several depths in this file, and for now, I only work
with the first one.
So can I specify a depth in the URL ? If it is the case, how can I get
back this value, to display the Grid Coverage for the selected depth ?

In the WCS specifications for the GetCoverage request, there is a
"Depth" parameter, and I wonder if I can't use it to specify it ?
At this page, we can found this parameter :
http://docs.codehaus.org/display/GEOSDEV/GeoServer+WCS+Specifications.
We have tested to modify the BBOX values, like this
"-180,-90,0,180,90,10", in adding a wished third dimension to select 0
to 10 for depth, but it doesn't work.

Cheers,
Cédric B.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel