我正在尝试使用REST API上传一个形状文件。这是我得到的错误:
No such datastore: ws1,nete。
我已经安装了版本为1.7.5的restconfig-1.7.5.jar插件。
以下是我的操作步骤: 1)创建工作空间ws1。 curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d 'ws1'localhost:8080/geoserver/rest/workspaces
2)检查工作空间。 curl -XGET -H 'Accept: text/xml' localhost:8080/geoserver/rest/workspaces/ws1
回复是ok。
3)上传shapefile。 curl -u admin:geoserver -XPUT -H 'Content-type: application/zip' --data-binary @roads.zip localhost:8080/geoserver/rest/workspaces/ws1/datastores/roads/file.shp 回复如下: Warning: Couldn't read data from file "roads.zip", this makes an empty POST. Error occured unzipping file:error in opening zip。
请帮忙解决问题!
我已经安装了版本为1.7.5的restconfig-1.7.5.jar插件。
以下是我的操作步骤: 1)创建工作空间ws1。 curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d 'ws1'localhost:8080/geoserver/rest/workspaces
2)检查工作空间。 curl -XGET -H 'Accept: text/xml' localhost:8080/geoserver/rest/workspaces/ws1
回复是ok。
3)上传shapefile。 curl -u admin:geoserver -XPUT -H 'Content-type: application/zip' --data-binary @roads.zip localhost:8080/geoserver/rest/workspaces/ws1/datastores/roads/file.shp 回复如下: Warning: Couldn't read data from file "roads.zip", this makes an empty POST. Error occured unzipping file:error in opening zip。
请帮忙解决问题!
curl
方法直接上传shp文件而不进行压缩,http://docs.geoserver.org/stable/en/user/restconfig/rest-config-examples/rest-config-examples-curl.html#adding-an-existing-shapefile。这可行吗?我正在尝试但它一直给我这个错误,http://gis.stackexchange.com/questions/40601/why-is-the-curl-syntax-unable-to-create-datastore。 - Sam007