0

I am trying to create a coveragestore and coverage for an S3 based COG GeoTIFF. I can successfully create the coveragestore, but cannot figure out how to create a coverage using that coveragestore. I can create a coverage in the GeoServer UI using this coveragestore, but not through the REST API.

Here is how I create the coveragestore:

curl -u admin:geoserver -X POST "https://mygeoserverhost/geoserver/rest/workspaces/myworkspace/coveragestores" -H  "content-type: application/xml" -d '<coverageStore><name>S3_Test</name><type>GeoTIFF</type><enabled>true</enabled><workspace><name>myworkspace</name></workspace><__default__>true</__default__><url>cog://http://mytest.s3.amazonaws.com/max_wse.tif</url><metadata><entry key="CogSettings.Key"><cogSettings><useCachingStream>false</useCachingStream><rangeReaderSettings>HTTP</rangeReaderSettings></cogSettings></entry></metadata></coverageStore>'

To create the coverage, I have tried a bunch of things, and this one seems to get the closest. (It does not return any errors and there are no errors in the GeoServer log - but no coverage is created)

curl -u admin:geoserver -XPOST -H "Content-Type: text/plain" -d "<coverage><name>S3_Test_Layer</name><title>S3_Test_Layer</title></coverage>" "https://mygeoserverhost/geoserver/rest/workspaces/myworkspace/coveragestores/Curl_S3_Test/coverages"

1 Answer 1

1

After, much experimenting and help looking at the GeoServer REST API src code, I found the answer to this in case anyone else is interested. This is the API call that finally worked to add the coverage to the coverage store I had already created:

curl -u admin:geoserver -X POST "https://mygeoserverhost/geoserver/rest/workspaces/myworkspace/coveragestores/S3_Test/coverages" -H "content-type: application/xml" -d "<coverage><name>S3_Test_Layer</name><title>S3_Test_Layer</title><nativeName>max_wse</nativeName></coverage>"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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