Embrio UserDocs
From PyWPS wiki
Contents |
[edit] Install HOWTO
[edit] Introduction
Just to make the installation process easier, let's see what's the task of Embrio interface. As you known, pywps receives a call from the web, runs a process and then returns an output; the task of Embrio is to make this process easier and better look. Embrio is a web interface to interact with PyWPS.
In this guide we don't talk (at least for this version) about how configure pywps; you can found all the info you need here.
[edit] Software Requirements
In your server you shoud have properly installed this softwares:
- APACHE+PHP
- PHP/MAPSCRIPT
[edit] Getting the code
Create a web directory and go inside it.Then get the whole sourcecode (both pywps and embrio interface) from svn using this line:
svn checkout https://svn.wald.intevation.org/svn/pywps/trunk
As i told you before, you will get also the pywps development code, but it's a nice way to use the stable one. You can see more info on the Pywps installation doc.
[edit] Configure Embrio to suit your needs
There are 2 things you must keep in mind to configure the embrio interface: the web part (module) and the pywps part (process). We'll use v_net_path modules as example, but once you understand the idea, you are ready for any other module.
[edit] Pywps section
The first things you have to do is to edit 2 files inside pywps/etc folder: settings.py and grass.py. Inside the pywps documentation you'll found all the info that you need to do this. Now go inside pywps/process/ folder and open Shortestpath.py, the module we're gone to use. This are the section you need to change:
[..] self.Abstract="Find the shortes path on the roads map on Czech republic road network" self.grassLocation="/var/www/wps/spearfish61/" [..]
Here add the path to your GRASS dataset
[..]
os.system("echo '0 %s %s %s %s ' | v.net.path in=siln out=path afcolumn=COST2 dmax=5000 abcolumn=COST2 1>&2" %\
[..]
The process, takes input from a vector file inside your grassdata, called siln; change this to the file you need to use for your network
[..]
os.system("echo '0 %s %s %s %s ' | v.net.path in=siln out=path dmax=5000 1>&2" %\
[..]
Same of the previous step.
The idea that you must keep in mind, when editing a process (or creating a new one), is that you work as you were inside GRASS, so use inputs file that exist in your grassdata.
[edit] Web section (module)
Go inside
/path/myserver/yourfolder/trunk/web/embrio/vector/v_net_path/
This is the folder the contains all items that are needed to run it, but the one you need to edit, it's just the config.php inside include folder. so go inside it and take a look at config.php.dist:
$script_name = "name of your script"; $map_path = "path/to/your/mapfile"; $map_file = "yourmapfile.map"; $img_path = "path/to/your/image/tmp_dir/";# write enabled, web server visible $img_rel_path = "../rel/path/to/your/img_path"; $pywps_outputPath = "path/to/your/pywps/temp_dir"; #same outputPath as in settings.py $cgi_executable = "http://myserver.org/cgi-bin/pywps.py";
The comments, should help you to set all variables to suite your need; just keep an eye on the latest 2 cause they must respect, your pywps installation.
N.B: If you'll use an installation of pywps that is already on your machine, link the $cgi_executable to it, and not to the one you just downloaded via SVN
[edit] Create input files
As you see in the previus paragraph, you must set the path (and the name), of the mapfile you are gone to use with pywps. To make easier to understand this, think in this way:
- Embrio read and display the items on your mapfile
- Pywps create the output of the process (in this example a GML vector file)
- Embrio update the mapfile with a new layer that display the output
You can add anything you want to the mapfile, but of course the data has to be the same of the grassdata to avoid projection problem.
In the Grass Wiki, you cna found a way to add raster and vector data, using your grassdata as source ( read in the wiki about raster known problem, and don't forget that you need gdal-grass to display raster data)
[edit] Conclusion
Basically the errors that we encountered, can be split in 2 cateogories:
- Path problem: Check permission and the path of the folders that you use. Basically embrio creates 2 kinds of output: the pypws process output and the image from mapserver. We used 2 differents path for those items, but you can do anything you like.
- Internal Server Error: You have probably missed something in the pywps configuration. Check the process for any error. Once you have set up pywps, you can use this line in the browser:

