Hi guys,
I am implementing the following code to upload an existing shapefile as per the documentation,
curl -u admin:geoserver -XPUT -H ‘Content-type: text/plain’ -d ‘file:./shapefile/csv_shp/Stemmodontia_reticulata.shp’ http://localhost:8080/geoserver/rest/workspaces/opengeo/datastores/Stemmodontia_reticulata/Stemmodontia_reticulata.shp
But I am getting following error,
No such datastore: opengeo,Stemmodontia_reticulata
The document says that the curl code will create the datastore then why am I getting this error?
–
Thanks & Regards
Smaran Harihar
Did you try using an absolute path? GeoServer needs to be able to find the
group of files that make up the Shp, but your path is relative to your pwd
in the shell.
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/curl-not-creating-the-desired-datastore-tp5014713p5014731.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Thanks for the reply cheesy.
I executed the following code,
curl -u admin:geoserver -XPUT -H ‘Content-type: text/plain’ \ >
-d ‘file:///var/www/geo/shapefile/csvQshp/’ \ > “http://localhost:8080/geoserver/rest/workspaces/acme/datastores/csvQshp/external.shp?configure=all”
I am getting this error,
Error persisting DataStoreInfoImpl[csvQshp] to /usr/share/opengeo-suite-data/geoserver_data/workspaces/acme/csvQshp/datastore.xml
The strange thing is that the datastore is created but the shapefiles are missing. When you said the absolute path did u mean,
-d ‘file:///var/www/geo/shapefile/csvQshp/’ \ >
Thanks,
Smaran
On Wed, Nov 7, 2012 at 11:24 PM, cheesybiscuits <thomaschristian@anonymised.com4…> wrote:
Did you try using an absolute path? GeoServer needs to be able to find the
group of files that make up the Shp, but your path is relative to your pwd
in the shell.
–
View this message in context: http://osgeo-org.1560.n6.nabble.com/curl-not-creating-the-desired-datastore-tp5014713p5014731.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
Thanks & Regards
Smaran Harihar
Yes I would expect your new command to work fine but there are a few possible
explanations for why it might fail.
1) the target of your new path is different to your original relative path -
I assume /var/www/geo/shapefile/csvQshp/ does actually contain shapefiles
2) you might be seeing permissions issues where Tomcat (or whatever your
container is) can't read the data. If safe to do so you might want to verify
this by opening up privileges, e.g. something like chmod -R 0744
/var/www/geo/shapefile/csvQshp
3) as the datastore is created I assume there are no permissions issues with
Tomcat / whatever writing to the target directory
If you're still having trouble I would test by identifying a single
shapefile, rather than the directory
curl -u admin:geoserver -XPUT -H 'Content-type: text/plain' -d
'file:///var/www/geo/shapefile/csvQshp/someshape.shp'
"http://localhost:8080/geoserver/rest/workspaces/acme/datastores/csvQshp/external.shp?configure=all"
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/curl-not-creating-the-desired-datastore-tp5014713p5015302.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Ok cheesy,
I gave up on uploading the individual shapefile and tried to upload a zipped shapefile and still I am not able to succeed.
I am implementing the following code to upload a zipped shapefile as per the documentation,
curl -u admi PUT ‘Content-type: application/zip’ --data-binary @/var/www/geo/shapefile/zip/Poa_horridula.zip http://localhost:8080/geoserver/rest/workspaces/acme/datastores/Poa_horridula/Poa_horridula.zip
But I am getting following error,
curl: (6) Couldn’t resolve host ‘Content-type’
No such datastore: acme,Poa_horridula
The document says that the curl code will create the datastore then why am I getting this error?
Where am I going wrong?
Thanks,
Smaran
On Fri, Nov 9, 2012 at 7:26 PM, cheesybiscuits <thomaschristian@anonymised.com.84…> wrote:
Yes I would expect your new command to work fine but there are a few possible
explanations for why it might fail.
- the target of your new path is different to your original relative path -
I assume /var/www/geo/shapefile/csvQshp/ does actually contain shapefiles
- you might be seeing permissions issues where Tomcat (or whatever your
container is) can’t read the data. If safe to do so you might want to verify
this by opening up privileges, e.g. something like chmod -R 0744
/var/www/geo/shapefile/csvQshp
- as the datastore is created I assume there are no permissions issues with
Tomcat / whatever writing to the target directory
If you’re still having trouble I would test by identifying a single
shapefile, rather than the directory
curl -u admin:geoserver -XPUT -H ‘Content-type: text/plain’ -d
‘file:///var/www/geo/shapefile/csvQshp/someshape.shp’
“http://localhost:8080/geoserver/rest/workspaces/acme/datastores/csvQshp/external.shp?configure=all”
Ok so I changed a bit more of my code,
curl -u admin:geoserver -v -XPUT -H ‘Content-type: application/zip’ --data-binary ‘/var/www/geo/shapefile/zip/Poa_horridula.zip’ http://localhost:8080/geoserver/rest/workspaces/acme/datastores/newtest/file.shp
And now the error is that the file cannot be unzipped.
- About to connect() to localhost port 8080 (#0)
- Trying ::1… connected
- Server auth using Basic with user ‘admin’
PUT /geoserver/rest/workspaces/acme/datastores/newtest/file.shp HTTP/1.1
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: localhost:8080
Accept: /
Content-type: application/zip
Content-Length: 44
- upload completely sent off: 44out of 44 bytes
< HTTP/1.1 500 Internal Server Error
< Server: Apache-Coyote/1.1
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Date: Tue, 13 Nov 2012 23:12:47 GMT
< Connection: close
<
- Closing connection #0
Error occured unzipping file:error in opening zip file
Any idea why it is unable to unzip it?
Thanks,
Smaran
On Tue, Nov 13, 2012 at 3:36 PM, Smaran Harihar <smaran.harihar@anonymised.com> wrote:
Ok cheesy,
I gave up on uploading the individual shapefile and tried to upload a zipped shapefile and still I am not able to succeed.
I am implementing the following code to upload a zipped shapefile as per the documentation,
curl -u admi PUT ‘Content-type: application/zip’ --data-binary @/var/www/geo/shapefile/zip/Poa_horridula.zip http://localhost:8080/geoserver/rest/workspaces/acme/datastores/Poa_horridula/Poa_horridula.zip
But I am getting following error,
curl: (6) Couldn’t resolve host ‘Content-type’
No such datastore: acme,Poa_horridula
The document says that the curl code will create the datastore then why am I getting this error?
Where am I going wrong?
Thanks,
Smaran
On Fri, Nov 9, 2012 at 7:26 PM, cheesybiscuits <thomaschristian@anonymised.com> wrote:
Yes I would expect your new command to work fine but there are a few possible
explanations for why it might fail.
- the target of your new path is different to your original relative path -
I assume /var/www/geo/shapefile/csvQshp/ does actually contain shapefiles
- you might be seeing permissions issues where Tomcat (or whatever your
container is) can’t read the data. If safe to do so you might want to verify
this by opening up privileges, e.g. something like chmod -R 0744
/var/www/geo/shapefile/csvQshp
- as the datastore is created I assume there are no permissions issues with
Tomcat / whatever writing to the target directory
If you’re still having trouble I would test by identifying a single
shapefile, rather than the directory
curl -u admin:geoserver -XPUT -H ‘Content-type: text/plain’ -d
‘file:///var/www/geo/shapefile/csvQshp/someshape.shp’
“http://localhost:8080/geoserver/rest/workspaces/acme/datastores/csvQshp/external.shp?configure=all”
–
Thanks & Regards
Smaran Harihar
Ok guys I am almost there,
curl -u admin:geoserver -v -XPUT -H ‘Content-type: application/zip’ --data-binary @/var/www/geo/shapefile/zip/Poa_horridula.zip http://localhost:8080/geoserver/rest/workspaces/acme/datastores/Poa/file.shp
This code finally helped me to get the shapefile in but it seems that the cURL does not publish it. Is that correct? Do I have to manually publish the shapefiles?
Thanks,
Smaran