Version 23 (modified by djay, 15 years ago) |
---|
ZooKernel description page
On this page you will find everything you need to know about the ZooKernel.
Current status
Acutaly, you could compile and use the code available on the svn server on your own GNU / LINUX platform this way :
Requirements
To be able to compile the current source, you need to have some library allready installed on your system :
- FastCGI (installed in /path/to/trunk/dist/, using --prefix=/path/to/trunk/dist configure option),
- cgic (same, use just make from the /path/to/trunk/../third/cgic/ ) .
- libxml2,
- cURL,
- Python.
Getting the source code
To get the source code and compile on your platform, use the following command :
cd zoo/trunk/
svn checkout svn+ssh://dev.cartography.st/mnt/data3/zoo-project/trunk/zoo-kernel zoo-kernel
Compiling the source code
First of all, you'll need to edit the Makefile and uncomment "-DLINUX_FREE_ISSUE" on the first line, then use the following commands :
cd zoo-kernel
make
make zoo_loader.cgi
make demo_service.zo
Now, you get the ZooKernel (Shell and Cgi version) and two "service providers" of different kind : demo_service.zo (C++) and test_service.py (Python).
Using the code
From the command line
To run request with ZooKernel from command command line, use the following example :
./service_loader ./ test_service.zo GetCapabilities ./service_loader ./Buffer.zcfg test_service.zo DescribeProcess ./service_loader ./Buffer.zcfg ./demo_service.zo Execute helloworld ./service_loader ./Buffer.zcfg ./demo_service.zo Execute printAgrument 1 2 ./service_loader ./Buffer.zcfg ./demo_service.zo Execute printAgrument 1 2 bg PYTHONPATH=. ./service_loader ./Distance.zcfg test_service Execute helloworld
From an apache web server
You could use the cgi version of zoo_loader on your own apache server. Do do this, use the following instruction.
Copy the cgi script, the demo service and the required files in your cgi-bin directory.
cp /path/to/trunk/zoo-kernel/zoo_loader.cgi /var/www/localhost/cgi-bin cp /path/to/trunk/zoo-kernel/demo_service.zo /var/www/localhost/cgi-bin/test_service.zo cp /path/to/trunk/zoo-kernel/*zcfg /var/www/localhost/cgi-bin cp /path/to/trunk/zoo-kernel/*cfg /var/www/localhost/cgi-bin
Create a file .htaccess in a zoo directory from the directory index of your apache instalaltion.
cat > /var/www/localhost/htdocs/zoo/.htaccess << EOF
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !=%{DOCUMENT_ROOT}/login.php
RewriteRule (.*)/(.*)/(.*) /cgi-bin/zoo_loader.cgi?ServiceProvider=$2&metapath=$1 [L,QSA]
RewriteRule (.*)/(.*)/ /cgi-bin/zoo_loader.cgi?ServiceProvider=$2&metapath=$1 [L,QSA]
RewriteRule (.*)/(.*) /cgi-bin/zoo_loader.cgi?ServiceProvider=$1&metapath= [L,QSA]
EOF
Then you have to request your installation using your favorite browser. For instance, this link should work from your Apache web server.
You could also see the Cgi Version from Shilpa !
Some samples requests running on the Shilpa server (using KVP only) :
- DescribeProcess? samples :
- Execute samples :
- Arithmetics Service Provider :
- Basic GDAL Service Provider :
- Using Gdal_Translate to convert a GeoTiff datasource to an AAIGrid datasource.
- Using Gdal_Translate to crop a GeoTiff datasource and potentialy convert datasource format
- Use an xlink:href value (this is the used url)
- Use a WFS Request as an xlink:href valur (the WFS request used). See here to see maps data structure extracted from the apache error log correspoding to this request)
- Basic OGR Service :
- The WKS (Well Known Service :) ) Buffer Operation using a xlink:href WFS query URL-Encoded as a DataInputs? value
- Distance
- GetArea
- Buffer
- Boundary
Some sample (using POST XML requests), to use those examples you will have to put the following XML documents in the textare on this page, then press "run using XML Request" to see the ZooKernel process your query :
- A simple DescribeProcess? request :
<DescribeProcess xmlns="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsDescribeProcess_request.xsd" service="WPS" version="1.0.0" language="en-CA"> <ows:Identifier>Buffer</ows:Identifier> <ows:Identifier>Boundary</ows:Identifier> <ows:Identifier>GetArea</ows:Identifier> </DescribeProcess>
- A sample Execute request using ResponseDocument? (same as previous example using Buffer from basic ogr service) :
<wps:Execute service="WPS" version="1.0.0" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> <ows:Identifier>Buffer</ows:Identifier> <wps:DataInputs> <wps:Input> <ows:Identifier>InputPolygon</ows:Identifier> <ows:Title>Playground area</ows:Title> <wps:Reference xlink:href="http://carto.languedoc-roussillon.ecologie.gouv.fr/webservices/wfs/diren_general/?VERSION=1.1.0&service=WFS&request=GetFeature&typename=Znieff1&maxfeatures=1"/> </wps:Input> <wps:Input> <ows:Identifier>BufferDistance</ows:Identifier> <ows:Title>Distance which people will walk to get to a playground.</ows:Title> <wps:Data> <wps:LiteralData>400</wps:LiteralData> </wps:Data> </wps:Input> </wps:DataInputs> <wps:ResponseForm> <wps:ResponseDocument storeExecuteResponse="true"> <wps:Output asReference="true"> <ows:Identifier>BufferedPolygon</ows:Identifier> <ows:Title>Area serviced by playground.</ows:Title> <ows:Abstract>Area within which most users of this playground will live.</ows:Abstract> </wps:Output> </wps:ResponseDocument> </wps:ResponseForm> </wps:Execute>
- A sample Execute request using RawData? (same as previous example using Buffer from basic ogr service) :
<wps:Execute service="WPS" version="1.0.0" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> <ows:Identifier>Buffer</ows:Identifier> <wps:DataInputs> <wps:Input> <ows:Identifier>InputPolygon</ows:Identifier> <ows:Title>Playground area</ows:Title> <wps:Reference xlink:href="http://carto.languedoc-roussillon.ecologie.gouv.fr/webservices/wfs/diren_general/?VERSION=1.1.0&service=WFS&request=GetFeature&typename=Znieff1&maxfeatures=1"/> </wps:Input> <wps:Input> <ows:Identifier>BufferDistance</ows:Identifier> <ows:Title>Distance which people will walk to get to a playground.</ows:Title> <wps:Data> <wps:LiteralData>400</wps:LiteralData> </wps:Data> </wps:Input> </wps:DataInputs> <wps:ResponseForm> <wps:RawDataOutput> <ows:Identifier>BufferedPolygon</ows:Identifier> </wps:RawDataOutput> </wps:ResponseForm> </wps:Execute>
No sample using the GetCapabilities? request, only because we get issue in another level for GetCapabilities? request, even the KVP is not working for every ServiceProvider?.