| Using REST interface of the importer the targetWorkspace configured is not used if I try to import a GeoTiff. Steps to reproduce (note: curl requests are copied from chrome dev tools) Create a new import with :
I receive the id of the new import :
{"import":{"id":35,"href":"http:,"state":"PENDING","archive":false,"tasks":[]}}
Then create a new task uploading a tiff via multipart (note: this request is incomplete because have been copied from the chrome dev tools, for a complete example in curl, use this instructions (http://docs.geoserver.org/latest/en/user/extensions/importer/rest_examples.html#uploading-and-optimizing-a-geotiff-with-ground-control-points) :
and receive the confirmation that the task have been created:
{
"task":{
"id":0,
"href":"http:,
"state":"READY",
"updateMode":"CREATE",
"data":{
"type":"file",
"format":"GeoTIFF",
"file":"sample.tif"
},
"target":{
"href":"http:,
"coverageStore":{
"name":"sample",
"type":"GeoTIFF"
}
},
"progress":"http:,
"layer":{
"name":"sample",
"href":"http:
},
"transformChain":{
"type":"raster",
"transforms":[
]
}
}
}
But if I try to get the target details from : http://localhost:8080/geoserver/rest/imports/35/tasks/0/target I receive this response
{
"href":"http:,
"coverageStore":{
"name":"sample",
"type":"GeoTIFF",
"enabled":true,
"workspace":{
"name":"MY_DEFAULT_WORKSPACE"
},
"_default":false,
"url":"file:uploads/tmp7078593201894025318/sample.tif"
}
}
Where MY_DEFAULT_WORKSPACE is the default workspace set in GeoServer. I tried the same procedure uploading a shape file. In this case I also change the datastore to the database one
And in this case works:
{
"href":"http:,
"dataStore":{
"name":"terrain",
"type":"PostGIS (JNDI)",
"enabled":true,
"workspace":{
"name":"terrain"
},
"connectionParameters":{
"entry":[
{
"@key":"schema",
"$":"public"
},
{
"@key":"Estimated extends",
"$":"true"
},
{
"@key":"Batch insert size",
"$":"100"
},
{
"@key":"preparedStatements",
"$":"true"
},
{
"@key":"fetch size",
"$":"1000"
},
{
"@key":"encode functions",
"$":"true"
},
{
"@key":"jndiReferenceName",
"$":"java:comp/env/jdbc/npa"
},
{
"@key":"Expose primary keys",
"$":"false"
},
{
"@key":"Support on the fly geometry simplification",
"$":"true"
},
{
"@key":"dbtype",
"$":"postgis"
},
{
"@key":"namespace",
"$":"http:
},
{
"@key":"Loose bbox",
"$":"true"
}
]
},
"_default":false
}
}
|