Right - gotcha.
I now have a layer called ‘mosiac’ which is in a store called S2Output. All good.
Three things;
···
On 23 October 2013 13:21, Daniele Romagnoli <daniele.romagnoli@anonymised.com> wrote:
Ing. Daniele Romagnoli
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
On Wed, Oct 23, 2013 at 2:12 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:
Hey,
Tried that - but my data is not on "C:/data/mosaic, so I have replaced it with just /data/mosaic,
Mine was only the example I have run on my system to provide you a hint 
and I get an error:
- About to connect() to localhost port 8080 (#0)
- Trying 127.0.0.1… connected
- Server auth using Basic with user ‘admin’
PUT /geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic HTTP/1.1
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
User-Agent: curl/7.22.0 (i686-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: text/plain
Content-Length: 12
- upload completely sent off: 12out of 12 bytes
< HTTP/1.1 500 Internal Server Error
< Server: Apache-Coyote/1.1
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Date: Wed, 23 Oct 2013 12:11:08 GMT
< Connection: close
<
- Closing connection #0
Error while storing uploaded file::no protocol: /data/mosaic
I think you have removed also the “file://” prefix to specify the protocol.
Make sure to keep it on the request
curl -v -u admin:geoserver -XPUT -H “Content-type: text/plain” -d "file:///data/mosaic" “http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/YOURSTORENAME/external.imagemosaic”
Also - what is the “poly-incremental” thing?
It’s the name of a coverage store which has been assigned to that data in the CURL example provided in the Documentation.
You just need to specify a storename you like so that the REST request will configure a coverage store with that name.
As an instance: “mymosaic”
Cheers,
Daniele
Thanks
Toby
On 23 October 2013 13:04, Daniele Romagnoli <daniele.romagnoli@anonymised.com> wrote:
Hi again,
If you want to create a new mosaic store, you should use a PUT like this:
curl -v -u admin:geoserver -XPUT -H “Content-type: text/plain” -d “file://c:/data/mosaic” “http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic”
Once done, you can afterwards add additional files to your store through additional POSTs.
curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" -d "**file://c:/data/morefiles/sample12.tif**" "[http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic](http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic)"
curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" -d "**file://c:/data/morefiles/sample13.tif**" "[http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic](http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic)"
OR just add lot of files once by harvesting a whole folder:
curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" -d "**file://c:/data/evenmorefiles/**" "[http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic](http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic)"
Please, let us know if you still have issues.
Hope this helps,
Daniele
Ing. Daniele Romagnoli
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
On Wed, Oct 23, 2013 at 1:07 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:
Hi Daniele,
The contents is just a list of geotiff files, so image1.tiff, image2.tiff . I have about 10 in there.
Re post / put - I was just following the documentation [1]. 
Toby
[1] http://docs.geoserver.org/stable/en/user/rest/examples/curl.html
On 23 October 2013 11:56, Daniele Romagnoli <daniele.romagnoli@anonymised.com> wrote:
Hi Tobias,
can you please list the content of your /data/mosaic folder?
Also note that you should use a PUT to create a coveragestore instead of POST.
Please, let us know.
Cheers,
Daniele
Ing. Daniele Romagnoli
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
On Wed, Oct 23, 2013 at 12:28 PM, Tobias Reinicke <ramotswa@anonymised.com> wrote:
<<Sorry for repost - have subscribed now>>
Hello All,
So I’m playing with the rest interface - and have managed to create a workspace and add a single tiff image layer by doing this:
//create workspace
curl -v -u admin:geoserver -XPOST -H “Content-type: text/xml” -d “toby” http://localhost:8080/geoserver/rest/workspaces
//create single image layer
curl -u admin:geoserver -XPUT -H “Content-type:image/tiff” --data-binary @/data/ndvi_color1.tif http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/ndvi_color1.tif/file.geotiff
My data is local to the geoserver (ubuntu) in /data directory.
Now I have multiple images in /data/mosaic that I want to add to a mosaic layer…
I’ve been trying something like
curl -v -u admin:geoserver -XPOST -H “Content-type: text/plain” -d “/data/mosaic” “http://localhost:8080/geoserver/rest/workspaces/toby/coveragestores/poly-incremental/external.imagemosaic”
But that doesn’t work - I get a 405 Method not allowed error.
I’ve been reading on the web and they say something about uploading the index.shp file in order to be able to do this - is that true? If so how do I create that in the first place?
Any help would be appreciated.
Thanks
Toby
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users