Hi,
I’m trying to upload a shape file with REST API.
Here is the error I get :
No such datastore: ws1,nete
I’ve installed version 1.7.5 together with the restconfig-1.7.5.jar plugin.
Here is what I do:
-
Create workspace ws1
curl -u admin:geoserver -v -XPOST -H ‘Content-type: text/xml’ -d ‘ws1’ http://localhost:8080/geoserver/rest/workspaces
-
Check workspace
curl -XGET -H ‘Accept: text/xml’ http://localhost:8080/geoserver/rest/workspaces/ws1
Reply:
ws1
- Upload shapefile
curl -u admin:geoserver -XPUT -H ‘Content-type: application/zip’ --data-binary @xnete.zip http://localhost:8080/geoserver/rest/workspaces/ws1/datastores/nete/xnete.shp
Reply:
No such datastore: ws1,nete
Any idea what I’m doing wrong ?
BR,
Joan Schepens
This e-mail, any attachments and the information it contains are confidential and meant only for the use of the addressee(s) only. Access to this e-mail by anyone other than the addressee(s) is unauthorized. If you are not the intended addressee (or responsible for delivery of the message to such person), you may not use, copy, distribute or deliver to anyone this message (or any part of its contents) or take any action in reliance on it. In such case, you should destroy this message and notify the sender immediately. If you have received this e-mail in error, please notify us immediately by e-mail or telephone and delete the e-mail from any computer.
All reasonable precautions have been taken to ensure no viruses are present in this e-mail and its attachments. As our company cannot accept responsibility for any loss or damage arising from the use of this e-mail or attachments we recommend that you subject these to your virus checking procedures prior to use.
Hi Joan,
I think the only issue is with the 3rd request. Just change "xnete.shp" to "file.shp" and it should work as expected.
-Justin
Schepens Joan wrote:
Hi,
I'm trying to upload a shape file with REST API.
Here is the error I get :
*No such datastore: ws1,nete*
I've installed version 1.7.5 together with the restconfig-1.7.5.jar plugin.
Here is what I do:
1) Create workspace ws1
curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d '<workspace><name>ws1</name></workspace>' _http://localhost:8080/geoserver/rest/workspaces_
2) Check workspace
curl -XGET -H 'Accept: text/xml' _http://localhost:8080/geoserver/rest/workspaces/__ws1_ <http://localhost:8080/geoserver/rest/workspaces/ws1>
Reply:
<workspace>
<name>ws1</name>
<dataStores>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="ht
tp://localhost:8080/geoserver/rest/workspaces/ws1/datastores.xml" type="applicat
ion/xml"/>
</dataStores>
<coverageStores>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="ht
tp://localhost:8080/geoserver/rest/workspaces/ws1/coveragestores.xml" type="appl
ication/xml"/>
</coverageStores>
</workspace>
3) Upload shapefile
curl -u admin:geoserver -XPUT -H 'Content-type: application/zip' --data-binary @xnete.zip _http://localhost:8080/geoserver/rest/workspaces/ws1/datastores/nete/xnete.shp_
Reply:
*No such datastore: ws1,nete*
Any idea what I'm doing wrong ?
BR,
Joan Schepens
------------------------------------------------------------------------
This e-mail, any attachments and the information it contains are confidential and meant only for the use of the addressee(s) only. Access to this e-mail by anyone other than the addressee(s) is unauthorized. If you are not the intended addressee (or responsible for delivery of the message to such person), you may not use, copy, distribute or deliver to anyone this message (or any part of its contents) or take any action in reliance on it. In such case, you should destroy this message and notify the sender immediately. If you have received this e-mail in error, please notify us immediately by e-mail or telephone and delete the e-mail from any computer.
All reasonable precautions have been taken to ensure no viruses are present in this e-mail and its attachments. As our company cannot accept responsibility for any loss or damage arising from the use of this e-mail or attachments we recommend that you subject these to your virus checking procedures prior to use.
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
Hi i have the same problem.
How can we know the path of shapefile that i upload.
need help please!!
--
View this message in context: http://www.nabble.com/REST-%3A-shapefile-upload-problem-tp24108414p24858506.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
The general url follows the syntax:
/workspaces/<ws>/datastores/<ds>/file.shp
where:
ws = the workspace you want the datastore in
ds = the name of the new datastore
The content should specify the content-type application/zip and the binary contents of a zip file containing the shapefile.
-Justin
chanthou.nget wrote:
Hi i have the same problem.
How can we know the path of shapefile that i upload.
need help please!!
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.