I’ve been trying to automate the publishing of GeoTIFF rasters as a Web Map Service (WMS) to GeoServer using R. So far I’ve only been able to establish a new datastore from inside R using this:
system(paste('curl -u admin:geoserver -v -XPOST -H "Content-type: application/xml" -d "<coverageStore><name>myraster</name><workspace>myworkspace</workspace><enabled>true</enabled><type>GeoTIFF</type><url> /usr/share/geoserver/data/data/myworkspace/myraster.tif</url></coverageStore>" "http:// my_mv_ip/geoserver/rest/workspaces/myworkspace/coveragestores"', sep=""))
Similarly, you can also do this using the geosapi package in R. (https://github.com/eblondel/geosapi/wiki). But progressing to the next step of adding and publishing a GeoTIFF as a Web Map Service (WMS) has been problematic and raster management is currently not supported with geosapi.
How do I publish GeoTIFFs as WMS to GeoServer in R?