1

I have created a coverage store in GeoServer using the REST API.

http://localhost:8010/geoserver/rest/workspaces/sdwdrnTif_Test/coveragestores?configure=all

<coverageStore>
        <name>postman-seonyudo</name>
        <workspace>sdwdrnTif_Test</workspace>
        <enabled>true</enabled>
        <type>GeoTIFF</type>
        <url>file:test_TIFF/seonyudo.tif</url>
</coverageStore>

Coverage store has been successfully created, so i wanted to publish a WMS layer for the coverage store.

I tried these : 1. http://localhost:8010/geoserver/rest/workspaces/sdwdrnTif_Test/coveragestores/postman-seonyudo/coverages

<coverages>
    <coverage>
        <name>seonyudo</name>
    </coverage>
</coverages>

it returned 500 error.

  1. http://localhost:8080/geoserver/rest/workspaces/sdwdrnTif_Test/coveragestores/seonyudoTEST/external.geotiff?configure=first&coverageName=seonyudoTEST

    file://C:\tif\seonyudo2.tif
    

And it gave me a 405 err code with this message:

"Error 405 Coverage store found, but it does not support resource harvesting."

Can anyone please tell me what I am doing wrong? How can I create a layer for this store using GeoServer REST API?

1 Answer 1

1

Your POST body is wrong in the first case, when in doubt make a GET request of an existing object to see what the expected format is.

So for example http://localhost:8080/geoserver/rest/workspaces/nurc/coveragestores/worldImageSample/coverages/Img_Sample.xml returns:

<coverage>
  <name>Img_Sample</name>
  <nativeName>Img_Sample</nativeName>
  <namespace>
    <name>nurc</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/nurc.xml" type="application/xml"/>
  </namespace>
  <title>North America sample imagery</title>
  <description>A very rough imagery of North America</description>
  <keywords>
    <string>WCS</string>
    <string>worldImageSample</string>
    <string>worldImageSample_Coverage</string>
  </keywords>
  <nativeCRS>GEOGCS[&quot;WGS 84&quot;, 
  DATUM[&quot;WGS_1984&quot;, 
    SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]], 
    AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]], 
  PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]], 
  UNIT[&quot;degree&quot;, 0.017453292519943295], 
  AXIS[&quot;Longitude&quot;, EAST], 
  AXIS[&quot;Latitude&quot;, NORTH], 
  AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</nativeCRS>
  <srs>EPSG:4326</srs>
  <nativeBoundingBox>
    <minx>-130.85168</minx>
    <maxx>-62.0054</maxx>
    <miny>20.7052</miny>
    <maxy>54.1141</maxy>
    <crs>EPSG:4326</crs>
  </nativeBoundingBox>
  <latLonBoundingBox>
    <minx>-130.85168</minx>
    <maxx>-62.0054</maxx>
    <miny>20.7052</miny>
    <maxy>54.1141</maxy>
    <crs>EPSG:4326</crs>
  </latLonBoundingBox>
  <enabled>true</enabled>
  ....
<requestSRS>
    <string>EPSG:4326</string>
  </requestSRS>
  <responseSRS>
    <string>EPSG:4326</string>
  </responseSRS>
</coverage>

so your post body should be (at least):

<coverage>
    <name>seonyudo</name>
</coverage>

and might need other values too, see the manual page for more details.

1
  • Thank you ! I donated a coffee Oct 19, 2021 at 12:46

Your Answer

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

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