Hi all,
following up on this topic, I've implemented the support for gdal_translate
and gdaladdo in
the importer, generalizing a bit the tranfsormation chains, and providing
support for other
command line invocations, should we want to add more in the future.

You can look at the work here:
https://github.com/aaime/geoserver/commit/fefb4da90259a1e14e7a57d786ff4c57bbdacd9f

The transforms are to be used in a direct import, and are available only
from the REST api
(not the first example, there are others already).

Say you want to upload a tiff file and then retile/add overviews to it,
you'd use the following commands:

1) Create import:
curl -u admin:geoserver -XPOST -H "Content-type: application/json" -d
@import.json "http://localhost:8080/geoserver/rest/imports";

Where import.json is:

{
   "import": {
      "targetWorkspace": {
         "workspace": {
            "name": "sf"
         }
      }
   }
}

2) Upload the tiff file:

curl -u admin:geoserver -F name=test -F
filedata=@/home/aaime/devel/gisData/rain.tif "
http://localhost:8080/geoserver/rest/imports/0/tasks";

3) Append the transformations:

curl -u admin:geoserver -XPOST -H "Content-type: application/json" -d
@gtx.json "http://localhost:8080/geoserver/rest/imports/0/tasks/0/transforms
"
curl -u admin:geoserver -XPOST -H "Content-type: application/json" -d
@gad.json "http://localhost:8080/geoserver/rest/imports/0/tasks/0/transforms
"

Where gtx.json is:

{
  "type": "GdalTranslateTransform",
  "options": [ "-co", "TILED=YES", "-co", "BLOCKXSIZE=512", "-co",
"BLOCKYSIZE=512"]
}

and gad.json is:

{
  "type": "GdalAddoTransform",
  "options": [ "-r", "average"],
  "levels" : [2, 4, 8, 16]
}

4) Run the import:

curl -u admin:geoserver -XPOST "
http://localhost:8080/geoserver/rest/imports/0";

If people have no objections, I'll use the above example in the docs, and
turn that github link above in a pull request

Not sure if you have feedback on the other two topics in my first mail in
this thread (have the server fetch files from
shares, indirect raster import), if I don't hear anything I'll pick my
choice next week and more on to implement those
as well

Cheers
Andrea


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to