Openlayers将功能导入geoserver目录

时间:2014-09-10 14:05:29

标签: openlayers geoserver

我有一个简单的功能集合,从执行vec:UnionFeatureCollection WPS进程返回。我需要将这些功能导入geoserver目录,这基本上意味着我需要为它们分配一个商店和工作区。我已经尝试了gs:Import WPS进程,这个进程尽可能接近但是没有例外就失败了。我正在使用Openlayers。这是我正在使用的代码:

wpsClient1.execute({
    server:'local',
    process:'gs:Import',
    inputs:{
        features:featureCollection,
        coverage:'',
        workspace:'workspace1',
        store:'analysis',
        name:layerName,
        srs:new OpenLayers.Projection('EPSG:4326')
    },
    success:function(layerName1){
        localStorage.setItem("LayerName",JSON.stringify(layerName1));
        window.location.reload();
    }
});

我也尝试过链接如下所示的流程,但仍然没有。

var union = wpsClient.getProcess('local','gs:UnionFeatureCollection');
var catalogImport = wpsClient.getProcess('local','gs:Import');

//Start with the union
union.configure({
   inputs:{
       first:features1,
       second:features2
   }
});
catalogImport.execute({
   inputs:{
       features:union.output('result'),
       workspace:'workspace1',
       store:'analysis1',
       name:layerName,
       srs:new OpenLayers.Projection('EPSG:4326')
   },
    success:function(output){
        localStorage.setItem("LayerName",JSON.stringify(output));
        window.location.reload();
    }
})

0 个答案:

没有答案