[Geoserver-devel] Uploading netCDF files through RESt interface

Hi list,

I have been trying without real success to upload netCDF files in GeoServer throungh REST interface. The file contains only one netCDF file, without any subsets or bands. So it is a pretty simple netCDF file.

I have tried the following two methods:

  1. curl -u admin:geoserver -v -POST -H “Content-type: text/xml” -d “stwstrueNetCDFd:\path_to_netcdf\data.nc” “http://localhost:8080/geoserver/rest/workspaces/ws/coveragestores?configure=all

I get the following error message: 500 Internal Server Error.

  1. curl -v -u admin:geoserver -XPUT -H “Content-type:application/zip” --data-binary @d:\path_to netcdf\data.zip http://localhost:8080/geoserver/rest/workspaces/ws/coveragestores/st/file.netcdf

I get the following error message: 500 Internal Server Error Error occured unzipping fileroot

Any ideas or suggestions to solve this issue are more than welcome.

Kind regards,
Corina

First of all, this is a question for the user list, not the devel list, so you will probably have better luck asking there.

Second, have you looked at the REST docs? Based on what I see there, you probably will need to make two requests - first POST of the configuration to “/workspaces/{workspace}/coveragestores” to create the store, then second PUT the file to “/workspaces/{workspace}/coveragestores/{store}/{method}.{format}” to add the file to the store.
See http://docs.geoserver.org/api/#/1.0.0/coveragestores.yaml for more details on each of these requests.

Torben

···

On Mon, Jan 8, 2018 at 7:29 AM, Corina Tudorache via Geoserver-devel <geoserver-devel@lists.sourceforge.net> wrote:

Hi list,

I have been trying without real success to upload netCDF files in GeoServer throungh REST interface. The file contains only one netCDF file, without any subsets or bands. So it is a pretty simple netCDF file.

I have tried the following two methods:

  1. curl -u admin:geoserver -v -POST -H “Content-type: text/xml” -d “stwstrueNetCDFd:\path_to_netcdf\data.nc” “http://localhost:8080/geoserver/rest/workspaces/ws/coveragestores?configure=all

I get the following error message: 500 Internal Server Error.

  1. curl -v -u admin:geoserver -XPUT -H “Content-type:application/zip” --data-binary @d:\path_to netcdf\data.zip http://localhost:8080/geoserver/rest/workspaces/ws/coveragestores/st/file.netcdf

I get the following error message: 500 Internal Server Error Error occured unzipping fileroot

Any ideas or suggestions to solve this issue are more than welcome.

Kind regards,
Corina


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel