Problem adding layers with REST Services in GeoServer

المشرف العام

Administrator
طاقم الإدارة
This is my first question in this forum and I'm not sure if it is going to be properly structured. I've asked same question in other forum but I did not receive any response. I'll see if I have good luck here!

My problem happens when I want to upload a GeoTiff using the Import Data plugin through REST Services. I can't override same layer, method create a new one. But I need to keep same name for each update.

I'm using cURL commands to call the REST services.

1. Creating a new import

curl -k -u admin:pwd -XPOST -H 'Content-type: application/json' -d @import.json 'http://localhost:8080/geoserver/rest/imports'where @import.json is:

{ "import": { "targetWorkspace": { "workspace": { "name": "SIHA" } } }}2. Creating a new task (in this case import_id = 0)

curl -k -u admin:pwd -F name=test -F filedata=@file201510.tif 'http://localhost:8080/geoserver/rest/imports/0/tasks'3. Running the task

curl -k -u admin:pwd -XPOST 'http://localhost:8080/geoserver/rest/imports/0'At first time, it works perfectly. But when I've tried to call these commands again the name change ending with a sequence. (file2015100, file2015101, file2015102)

I've tried to delete the layer previously, but without success:

curl -k -u admin:pwd -XDELETE http://localhost:8080/geoserver/rest/layers/file201510Layer is deleted properly but the new layer is created following the same strange pattern (adding a sequence at the end of the name)

Also, I've tried to force the updateMode, but without success as well.

curl -k -u admin:pwd -XPUT -H 'Content-type: application/json' -d @replace.json 'http://localhost:8080/geoserver/rest/imports/0/tasks/0'where @replace.json is:

{ "task": { "updateMode": "REPLACE" }}I hope that you understand my problem and someone could help to solve it.



أكثر...
 
أعلى