ie.geologyidea.com
More

Error adding store through REST API to GeoServer

Error adding store through REST API to GeoServer


We are searching data for your request:

Forums and discussions:
Manuals and reference books:
Data from registers:
Wait the end of the search in all databases.
Upon completion, a link will appear to access the found materials.


I have problem with adding raster layer to geoserver automatically. I need, that geoserver add layer without person job, only script action and i saw that it may be done with cURL REST API but, i can't do it. In general, I have some GeoTIFF files and i want to published them at geoserver through the terminal. I do how wrote DaveParillo. I can add workspace,

curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d 'geotiff' http://192.168.255.197:8080/geoserver/rest/workspaces

answer

* Hostname was NOT found in DNS cache * Trying 192.168.255.197… * Connected to 192.168.255.197 (192.168.255.197) port 8080 (#0) * Server auth using Basic with user 'admin' > POST /geoserver/rest/workspaces HTTP/1.1 > Authorization: Basic YWRtaW46Z2Vvc2VydmVy > User-Agent: curl/7.35.0 > Host: 192.168.255.197:8080 > Accept: */* > Content-type: text/xml > Content-Length: 43 > * upload completely sent off: 43 out of 43 bytes < HTTP/1.1 201 Created < Date: Thu, 10 Dec 2015 14:15:53 GMT < Location: http://192.168.255.197:8080/geoserver/rest/workspaces/geotiff * Server Noelios-Restlet-Engine/1.0… 8 is not blacklisted < Server: Noelios-Restlet-Engine/1.0… 8 < Transfer-Encoding: chunked < * Connection #0 to host 192.168.255.197 left intact

but when i try add store i touch this error:

curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d 'ffftrueGeoTIFF/opt/tomcat/webapps/geoserver/data/avhrr_locale1e2.tif' "http://192.168.255.197:8080/geoserver/rest/workspaces/geotiff/coveragestores?configure=all"

answer:

* Hostname was NOT found in DNS cache * Trying 192.168.255.197… * Connected to 192.168.255.197 (192.168.255.197) port 8080 (#0) * Server auth using Basic with user 'admin' > POST /geoserver/rest/workspaces/geotiff/coveragestores?configure=all HTTP/1.1 > Authorization: Basic YWRtaW46Z2Vvc2VydmVy > User-Agent: curl/7.35.0 > Host: 192.168.255.197:8080 > Accept: */* > Content-type: text/xml > Content-Length: 155 > * upload completely sent off: 155 out of 155 bytes < HTTP/1.1 500 Internal Server Error * Server Apache-Coyote/1.1 is not blacklisted < Server: Apache-Coyote/1.1 < Content-Type: text/plain < Transfer-Encoding: chunked < Date: Thu, 10 Dec 2015 14:16:14 GMT < Connection: close < * Closing connection 0 :Store must be part of a workspace

Geoserver log same error:

2015-12-10 17:15:53,801 INFO [catalog.rest] - POST workspace geotiff 2015-12-10 17:16:14,687 INFO [org.geoserver] - Loaded store 'fff', enabled 2015-12-10 17:16:14,688 ERROR [geoserver.rest] - :Store must be part of a workspace 2015-12-10 17:16:14,688 ERROR [geoserver.rest] - org.geoserver.rest.RestletException: java.lang.IllegalArgumentException: Store must be part of a workspace

What's wrong?

Geoserver v.2.8.1.


You need to add the workspace name when creating coverage store. In your case XML will look like this:

 fff true GeoTIFF geotiff /opt/tomcat/webapps/geoserver/data/avhrr_locale1e2.tif


Comments:

  1. Angus

    I find this to be the wrong way.

  2. Jeren

    It is understood in two ways like that

  3. Kiley

    I think he is wrong. I'm sure. I propose to discuss it.

  4. Hadar

    Actually. Prompt, where I can find more information on this question?

  5. Vigor

    Where have you disappeared for so long?

  6. Gale

    Agree, useful information



Write a message