Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to upload a NETCDF file (.nc) to Geoserver Store of Coverage ImageMosaic The command is this:

curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" 
-d "file:///data/coverages/myNetcdf.nc"
"http://410.152.23.128:8080:8080/geoserver/rest/workspaces/mygis/coveragestores/...
/external.imagemosaic"

as shown in Geoserver 2.4.0 documentation, but I get this message:

* About to connect() to 410.152.23.128 port 8080 (#0)
*   Trying 410.152.23.128...
* Adding handle: conn: 0x94df50
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x94df50) send_pipe: 1, recv_pipe: 0
* Connected to 410.152.23.128 (410.152.23.128:8080) port 8080 (#0)
* Server auth using Basic with user 'admin'
> POST /geoserver/rest/workspaces/mygis/coveragestores/.../external.imagemosaic 
HTTP/1.1
> Authorization: Basic YWRtaW46TYVvc2VydmVy
> User-Agent: curl/7.32.0
> Host: 410.152.23.128:8080
> Accept: */*
> Content-type: text/plain
> Content-Length: 31
>
* upload completely sent off: 31 out of 31 bytes
< HTTP/1.1 400 Bad Request
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Date: Wed, 25 Sep 2013 15:48:37 GMT
< Connection: close
<
Failed to locate the input file file:/data/coverages/myNetcdf.nc* Closing connectio
n 0

the file EXISTS instead, do u know how to fix this issue? is there another way to upload NetCDF files in ImageMosaic Stores? Plugin of Geoserver 2.4.0 doesn't select my file thanx in advance

share|improve this question

2 Answers 2

You cannot upload any file with your cURL code. Becasue it sends "Content-type: text/plain" data not a file to the server. GeoServer accepts uploading files in zip (binary) with this "Content-type: application/zip". So you must try this code (change file path, name etc. for your system)

curl -v -u admin:geoserver -XPUT -H "Content-type: application/zip" --data-binary @F:\temporary\testnetcdf.zip http://192.168.79.42/geoserver/rest/workspaces/msb/coveragestores/testnetcdf/file.netcdf

Also you can easily upload GeoTIFF, ImageMosaic or another formats. But you must change file extension in the end of the code. For example file.netcdf to file.geotiff

Another important thing is firstly you have to install NetCDF plugin. Otherwise you get Unsupported format error.

share|improve this answer

I'm not very familiar with GeoServer, but you are specifying port 8080 twice when passing the remote server address to curl. '

From the link you provided, it appears that you only need to specify the port once.

The error message does not indicate a malformed address, but it would not be the first time an error message was vague or incorrect.

I also note that you have a '...' in the remote address. Is this correct?

I would try correcting both of these issues and seeing if the problem is resolved!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.