1 | .. _kernel-sagagis: |
---|
2 | |
---|
3 | Optional SAGA GIS support |
---|
4 | ====================== |
---|
5 | |
---|
6 | `SAGA GIS <http://orfeo-toolbox.org/otb/>`_ provides a comprehensive set of geoscientific methods and spatial algorithms. The optional SAGA GIS support is available since `ZOO-Project 1.5 <http://zoo-project.org>`__. It allows to execute the `SAGA Modules <http://www.saga-gis.org/saga_module_doc/2.1.4/index.html>`_ directly as ZOO WPS Services thanks to a :ref:`kernel_index` specific internal mechanism which is detailed in this section. |
---|
7 | |
---|
8 | .. note:: |
---|
9 | |
---|
10 | |saga| `SAGA GIS <https://www.orfeo-toolbox.org>`__ is the System for Automated Geoscientific Analyses. Learn more on official `website <http://www.saga-gis.org/en/index.html>`__. |
---|
11 | |
---|
12 | |
---|
13 | .. |saga| image:: ../_static/sagagis.png |
---|
14 | :height: 100px |
---|
15 | :width: 100px |
---|
16 | :scale: 45% |
---|
17 | :alt: SAGA GIS logo |
---|
18 | |
---|
19 | |
---|
20 | How does it work ? |
---|
21 | ------------------------- |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | Installation and configuration |
---|
26 | ------------------------------ |
---|
27 | |
---|
28 | Follow the step described bellow in order to activate the ZOO-Project optional SAGA GIS support. |
---|
29 | |
---|
30 | Prerequisites |
---|
31 | ............. |
---|
32 | |
---|
33 | * latest `ZOO-Kernel <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel>`_ trunk version |
---|
34 | * SAGA GIS (`SAGA-GIS 2.1.4 <http://saga-gis.org>`_ ) |
---|
35 | * libLAS-1.2 (`LibLAS-1.2 <https://github.com/libLAS/libLAS-1.2>`_ ) |
---|
36 | |
---|
37 | Installation steps |
---|
38 | ........................... |
---|
39 | |
---|
40 | .. Note:: These installation steps were successfully tested on Ubuntu 14.4 LTS |
---|
41 | |
---|
42 | Download lastest ZOO-Kernel code from SVN. |
---|
43 | |
---|
44 | .. code-block:: guess |
---|
45 | |
---|
46 | svn checkout http://svn.zoo-project.org/svn/trunk/zoo-kernel zoo-kernel |
---|
47 | |
---|
48 | Then compile ZOO-Kernel using the needed configuration options as shown bellow: |
---|
49 | |
---|
50 | .. code-block:: guess |
---|
51 | |
---|
52 | cd zoo-kernel |
---|
53 | autoconf |
---|
54 | ./configure --with-saga=/usr/local/ |
---|
55 | make |
---|
56 | |
---|
57 | And copy the newly created zoo_loader.cgi to ``/usr/lib/cgi-bin`` : |
---|
58 | |
---|
59 | .. code-block:: guess |
---|
60 | |
---|
61 | cp zoo_loader.cgi /usr/lib/cgi-bin |
---|
62 | |
---|
63 | Configuration steps |
---|
64 | ************************* |
---|
65 | |
---|
66 | Main configuration file |
---|
67 | ^^^^^^^^^^^^^^^^^^^^^^^ |
---|
68 | |
---|
69 | Add the following content to your ``/usr/lib/cgi-bin/main.cfg`` file |
---|
70 | in the ``[env]`` section: |
---|
71 | |
---|
72 | .. code-block:: guess |
---|
73 | |
---|
74 | ITK_AUTOLOAD_PATH=/usr/local/lib/otb/applications |
---|
75 | |
---|
76 | Services configuration file |
---|
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
78 | |
---|
79 | The build of the `otb2zcfg <http://zoo-project.org/trac/browser/trunk/thirds/otb2zcfg>`_ utility is required to activate the available OTB Applications as WPS services. This can be done using the following command: |
---|
80 | |
---|
81 | .. code-block:: guess |
---|
82 | |
---|
83 | mkdir build |
---|
84 | cd build |
---|
85 | ccmake .. |
---|
86 | make |
---|
87 | |
---|
88 | Run the following command to generate all the needed zcfg files for the available OTB Application: |
---|
89 | |
---|
90 | .. code-block:: guess |
---|
91 | |
---|
92 | mkdir zcfgs |
---|
93 | cd zcfgs |
---|
94 | export ITK_AUTOLOAD_PATH=/your/path/to/otb/applications |
---|
95 | ../build/otb2zcfg |
---|
96 | mkdir /location/to/your/cgi-bin/OTB |
---|
97 | cp *zcfg /location/to/your/cgi-bin/OTB |
---|
98 | |
---|
99 | .. warning |
---|
100 | |
---|
101 | The ITK_AUTOLOAD_PATH environment variable is required in the [env] section of your main.cfg. |
---|
102 | |
---|
103 | Test the ZOO SAGA support |
---|
104 | ^^^^^^^^^^^^^^^^^^^^^^^ |
---|
105 | |
---|
106 | Once done, OTB Applications should be listed as available WPS Services when runing a GetCapabilities request |
---|
107 | |
---|
108 | .. code-block:: guess |
---|
109 | |
---|
110 | http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS |
---|
111 | |
---|
112 | Each OTB Service can then be described individually using the DescribeProcess request, as for example: |
---|
113 | |
---|
114 | .. code-block:: guess |
---|
115 | |
---|
116 | http://localhost/cgi-bin/zoo_loader.cgi?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=OTB.BandMath |
---|
117 | |
---|
118 | And executed according to your needs, as for the following example executing OTB.BandMath with the OTB sample data as input |
---|
119 | |
---|
120 | .. code-block:: guess |
---|
121 | |
---|
122 | http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=OTB.BandMath&DataInputs=il=Reference@xlink:href=http://hg.orfeo-toolbox.org/OTB-Data/raw-file/ca154074b282/Examples/verySmallFSATSW.tif;il=Reference@xlink:href=http://hg.orfeo-toolbox.org/OTB-Data/raw-file/ca154074b282/Examples/verySmallFSATSW_nir.tif;out=float;exp=im1b3*cos%28im1b1%29,im1b2*cos%28im1b1%29,im1b1*cos%28im1b1%29&RawDataOutput=out@mimeType=image/png |
---|
123 | |
---|
124 | When executing OTB applications as WPS Services, it is also possible to check the OTB process status, using the usual ZOO GetStatus request. |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | |
---|
134 | |
---|