[Geoserver-devel] How do you upload a Shapefile using cURL and REST?

Hi,

Can someone please tell me how to upload a Shapefile using cURL and the REST
plugin? I've tried the few examples on the GeoServer site, but nothing
seems to work... Once I do upload a Shapefile to GeoServer, in which
directory should the file be?

Thanks,

Sam
--
View this message in context: http://www.nabble.com/How-do-you-upload-a-Shapefile-using-cURL-and-REST--tp23808087p23808087.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Sam,

This is documented here:

http://docs.geoserver.org/1.7.x/user/extensions/rest/rest-config-examples-curl.html#uploading-a-shapefile

After you upload the file it will be located in:

  <GEOSERVER_DATA_DIRECTORY>/data/<dataStoreName>

-Justin

samclemmens wrote:

Hi,

Can someone please tell me how to upload a Shapefile using cURL and the REST
plugin? I've tried the few examples on the GeoServer site, but nothing
seems to work... Once I do upload a Shapefile to GeoServer, in which
directory should the file be?

Thanks,

Sam

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

hello justin, I have a problem when I try to upload a geotiff for example
with rest, in a java class(I don't use curl)
Everything is working fine except that my file.geotiff is not copied in the
geoserver_data_dri/coverageName/ but directly in geoserver_data_dir. I tried
out to see in the rest api code but I don t find anything on this subject.
Could you help me ?

samclemmens wrote:

Hi,

Can someone please tell me how to upload a Shapefile using cURL and the
REST plugin? I've tried the few examples on the GeoServer site, but
nothing seems to work... Once I do upload a Shapefile to GeoServer, in
which directory should the file be?

Thanks,

Sam

--
View this message in context: http://www.nabble.com/How-do-you-upload-a-Shapefile-using-cURL-and-REST--tp23808087p25906980.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi,

Usually the file should be copied into <GEOSERVER_DATA_DIR>/data/<coverageStoreName>

How are you running GeoServer? And how is the GEOSERVER_DATA_DIR set? Are you running standalone jetty or with tomcat? The way the data dir gets set in a servlet container is a bit different and thinking about it it could lead to files being copied to different places.

The place in the code where this is handled is in the StoreFileResource#handleFileUpload() method.

http://svn.codehaus.org/geoserver/trunk/src/extension/restconfig/src/main/java/org/geoserver/catalog/rest/StoreFileResource.java

-Justin

jb6969 wrote:

hello justin, I have a problem when I try to upload a geotiff for example
with rest, in a java class(I don't use curl)
Everything is working fine except that my file.geotiff is not copied in the
geoserver_data_dri/coverageName/ but directly in geoserver_data_dir. I tried
out to see in the rest api code but I don t find anything on this subject.
Could you help me ?

samclemmens wrote:

Hi,

Can someone please tell me how to upload a Shapefile using cURL and the
REST plugin? I've tried the few examples on the GeoServer site, but
nothing seems to work... Once I do upload a Shapefile to GeoServer, in
which directory should the file be?

Thanks,

Sam

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.