Good day list members,

I am trying (amateur level) to use the REST interface, to publish an image-mosaic (works) and a single geotiff (still not working) layers via a WMS service.

I would kindly ask your feedback if this is the correct way to do that, and what am i doing wrong for the single geotiff case:

*For the Image mosaic:* I created with the GUI a workspace ("MYWSP") and a datastore (MYMSC) using the ImageMosaic plugin. I set also a data location folder where it is updated regularly. For some reason I was not able to just update the mosaic. So my workaround was to delete the coveragestore, and the files which contain the shp information and the *.properties of the mosaic. Then, I recreate it, every time there is new data available:

curl -v -u admin:pswd -XDELETE http://localhost:8080/geoserver/rest/workspaces/MYWSP/coveragestores/MYMSC?recurse=true

curl -v -u admin:pswd -XPUT -H "Content-type: text/plain" -d file:///data/geoserver/data/mosaic http://localhost:8080/geoserver/rest/workspaces/MYWSP/coveragestores/MYMSC/external.imagemosaic

This seems to work fine although I am not sure this is the proper way..

*For the single geotiff:* I created a datastore (MYGT) using the GeoTIFF plugin. With the GUI i can create also a layer "mylayer" which displays the single geotiff file. I tried to update via REST the layer but no success:

curl -v -u admin:pswd -XPUT -H "Content-type: image/tiff" --data-binary file:///data/geoserver/data/sic/test.tiff http://localhost:8080/geoserver/rest/workspaces/MYWSP/coveragestores/MYGT/external.geotiff

I tried also the file.geotiff instead of the external.geotiff with no success. Its unclear to me how one should use those extensions, and I could not find any related information.

Here is the output from the last curl command:

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
* Server auth using Basic with user 'admin'
> PUT /geoserver/rest/workspaces/MYWSP/coveragestores/MYGT/external.geotiff HTTP/1.1
> Host: localhost:8080
> Authorization: Basic YWRtaW46czNjcjN0
> User-Agent: curl/7.52.1
> Accept: */*
> Content-type: image/tiff
> Content-Length: 72
>
* upload completely sent off: 72 out of 72 bytes
< HTTP/1.1 201
< X-Frame-Options: SAMEORIGIN
< Content-Disposition: inline;filename=f.txt
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Fri, 29 Mar 2019 08:56:34 GMT
<
<coverageStore>
  <name>MYGT</name>
  <description>test data</description>
  <type>GeoTIFF</type>
  <enabled>true</enabled>
  <workspace>
    <name>MYWSP</name>
  </workspace>
  <__default>false</__default>
  <url>file:/data/geoserver/data/sic/test.tif</url>
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact

It looks that it has a 201 response, but in fact the layer is either broken or not publish, and I can not visualize it (I use qgis and loading as WMS layer). I am pretty sure I miss something here.. I would be grateful for any help on how to proceed with those issues...

Best regards

Panagiotis



_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to