Hi David,

I recommend to test your REST commands with curl before building into your C+ 
program. See http://docs.geoserver.org/stable/en/user/rest/examples/curl.html

For creating a coverageStore you have to send the raster data directly. You 
don't have to send any xml code.

Here is an example for creating a geotiff coveragestore with curl:
curl -v -u <user>:<password> -XPUT -H "Content-type:application/zip" 
--data-binary @<local path to zipped raster data> 
http://<geoserver ip>/geoserver/rest/workspaces/<workspace 
name>/coveragestores/<coveragestore name>/file.geotiff

You have to send the data as zip file and use -XPUT if you send it to a remote 
server. 

IF your data is already located on the server where geoserver is running you 
can use (curl example):
curl -v -u <user>:<password> -XPOST -H "Content-type:text/plain"
 -d "file:///<local path to zipped raster data>" 
http://<geoserver ip>/geoserver/rest/workspaces/<workspace 
name>/coveragestores/<coveragestore name>/external.geotiff

See also http://docs.geoserver.org/stable/en/user/rest/api/coveragestores.html

Hope I could help.

Kind regards,
Sabine


> Gesendet: Dienstag, 08. November 2016 um 09:21 Uhr
> Von: "David Alda Fernandez de Lezea" <da...@hazi.eus>
> An: "GeoServer Users" <geoserver-users@lists.sourceforge.net>
> Betreff: [Geoserver-users] RESP API add CoverageStore
>
> Hi list,
> 
> I'm trying to add a coverage store through REST API but I'm not sure if it's 
> possible or if I'm doing it the right way. Here's my scenario:
> 
> I've got several ECW raster files that I want to automatically be populated 
> using the REST API. So far I've achieved to populate a workspace, buy when it 
> comes to add a CoverageStore I get a 405 Method not permitted response. I'm 
> sending the requests from a C# program using normal WebRequests. I've 
> configured DIGEST Auth following 
> http://docs.geoserver.org/latest/en/user/security/tutorials/digest/index.html 
> 
> Now, here's the data I'm sending:
> 
> <coverageStore><name>PRUEBA</name><workspace>new_workspace_csharp_2</workspace><enabled>true</enabled><source>file://\\192.168.1.15\\IMAGENES_SATELITE\\SENTINEL2\\S2A_OPER_MSI_L1C_DS_EPA_20150821T111616945Z_IrRG.ecw</source><format>ECW</format></coverageStore>
> 
> I've tried sending the method as PUT and POST but without success in both 
> cases.
> 
> So my questions are:
> 
> Is it possible to add a Covergae Store from the REST API?
> 
> Is ECW format supported for REST API - Coverage Store?
> 
> When sending the request, the url should be something like 
> http://mygeoserver.com/rest/TELEDETEKZIOA/coveragestores/S2A_OPER_MSI_L1C_DS_EPA_20150821T111616945Z_IrRG.ecw
>   ???
> 
> Any ideas why I'm getting a 405 response?
> 
> Thanks in advance. 
> 
> Regards,
> 
> Agur bero bat,
> 
> 
> David Alda Fernández de Lezea
> Área de Sistemas de Información Geográfica, Planificación Territorial y 
> Forestal Informazio Geografikoen Sistemak, Lurralde eta Baso Antolaketaren 
> Arloa.
> da...@hazi.eus | www.hazi.eus
> T 945 003 240 - M 627 923 170 - F 945 003 290 
> Hazi | Granja Modelo de Arkaute s/n | 01192 Arkaute - Araba
>  
> *********************  LEGE OHARRA   *******************   AVISOLEGAL   
> *******************   DISCLAIMER   *****************************
> Mezu hau pertsonala eta isilpekoa da eta baimenik gabeko erabilera debekatua 
> dago legalki. Jasotzailea ez bazara ezabatu mezua, bidali eta kontserbatu 
> gabe.
> Este mensaje es personal y confidencial y su uso no autorizado está prohibido 
> legalmente. Si usted no es el destinatario, proceda a borrarlo, sin 
> reenviarlo ni conservarlo.
> This message is personal and confidential, unauthorised use is legally 
> prohibited. If you are not the intended recipient, delete it without 
> resending or backing it.
> 
> 
> 
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to