[Geoserver-users] Issues uploading a geotiff coverage using REST & cURL (V2.2.1)

I’ve been able to upload a geotiff coverage to geoserver via REST & cURL but regardless of what I try I cannot get the coverage to be stored in the ‘coverages’ directory. Both of the following sets of commands result in a new directory under data_dir/data being created. Even if I specify URL for the coverageStore, it gets over-written when I load the image.

The images are loaded and are viewable but they’re not strictly where they’re meant to be. I’d prefer to keep vector & raster files separate.

Anyone with any ideas how to upload the images to the ‘coverages’ directory?

SINGLE STEP COMMAND (LOAD IMAGE DIRECTLY)
curl -u admin:geoserver -XPUT -H “Content-type:image/tiff”
–data-binary @imgtest_01.tif
http://localhost/gs221/rest/workspaces/niihau/coveragestores/imgtest_01/file.geotiff

TWO-STEP COMMAND (CREATE COVERAGESTORE THEN LOAD IMAGE)
curl -u admin:geoserver -v -XPOST -H “Content-type: application/xml”
-d “imgtest_9niihautrue”
http://localhost/gs221/rest/workspaces/niihau/coveragestores
curl -u admin:geoserver -v -XPUT -H “Content-type: image/tiff”
–data-binary @imgtest_9.tif
http://localhost/gs221/rest/workspaces/niihau/coveragestores/imgtest_9/file.geotiff

OUTPUT FROM RUNNING SINGLE STEP COMMAND

imgtest_01
GeoTIFF
true

niihau
http://localhost/gs221/rest/workspaces/niihau.xml

<__default>false</__default>
file:data/niihau/imgtest_01/imgtest_01.geotiff

<atom:link xmlns:atom=“http://www.w3.org/2005/Atom” rel=“alternate” href=“ht
tp://localhost/gs221/rest/workspaces/niihau/coveragestores/imgtest_01/file/cover
ages.xml” type=“application/xml”/>

···

Richard “Abe” CoughlinSPATIAL DATA & APPLICATIONS SPECIALIST

Pacific Islands Ocean Observing System
University of Hawaii 1-808-956-0822
www.pacioos.org

发自我的 iPad

在 2013-1-12,10:42,“Richard (Abe) Coughlin” <rac88@anonymised.com96…> 写道:

···

Richard “Abe” CoughlinSPATIAL DATA & APPLICATIONS SPECIALIST

Pacific Islands Ocean Observing System
University of Hawaii 1-808-956-0822
www.pacioos.org

It’s currently not possible to do this through only the REST API. You could use an alternative system (such as FTP) to put your coverages on the server in the folder you like and then use the same type of request as in your two-step process to configure it. Otherwise, some of GeoServer’s code would need to be modified in order to make this possible.

···

On Fri, Jan 11, 2013 at 11:34 PM, enri <enri.zhou@anonymised.com> wrote:

发自我的 iPad

在 2013-1-12,10:42,“Richard (Abe) Coughlin” <rac88@anonymised.com> 写道:

I’ve been able to upload a geotiff coverage to geoserver via REST & cURL but regardless of what I try I cannot get the coverage to be stored in the ‘coverages’ directory. Both of the following sets of commands result in a new directory under data_dir/data being created. Even if I specify URL for the coverageStore, it gets over-written when I load the image.

The images are loaded and are viewable but they’re not strictly where they’re meant to be. I’d prefer to keep vector & raster files separate.

Anyone with any ideas how to upload the images to the ‘coverages’ directory?

SINGLE STEP COMMAND (LOAD IMAGE DIRECTLY)
curl -u admin:geoserver -XPUT -H “Content-type:image/tiff”
–data-binary @imgtest_01.tif
http://localhost/gs221/rest/workspaces/niihau/coveragestores/imgtest_01/file.geotiff

TWO-STEP COMMAND (CREATE COVERAGESTORE THEN LOAD IMAGE)
curl -u admin:geoserver -v -XPOST -H “Content-type: application/xml”
-d “imgtest_9niihautrue”
http://localhost/gs221/rest/workspaces/niihau/coveragestores
curl -u admin:geoserver -v -XPUT -H “Content-type: image/tiff”
–data-binary @imgtest_9.tif
http://localhost/gs221/rest/workspaces/niihau/coveragestores/imgtest_9/file.geotiff

OUTPUT FROM RUNNING SINGLE STEP COMMAND

imgtest_01
GeoTIFF
true

niihau
http://localhost/gs221/rest/workspaces/niihau.xml

<__default>false</__default>
file:data/niihau/imgtest_01/imgtest_01.geotiff

<atom:link xmlns:atom=“http://www.w3.org/2005/Atom” rel=“alternate” href=“ht
tp://localhost/gs221/rest/workspaces/niihau/coveragestores/imgtest_01/file/cover
ages.xml” type=“application/xml”/>

Richard “Abe” CoughlinSPATIAL DATA & APPLICATIONS SPECIALIST

Pacific Islands Ocean Observing System
University of Hawaii 1-808-956-0822
www.pacioos.org


Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only – learn more at:
http://p.sf.net/sfu/learnmore_122912


Geoserver-users mailing list
Geoserver-users@anonymised.comurceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only – learn more at:
http://p.sf.net/sfu/learnmore_122912


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users