Addons

From PyWPS wiki

Jump to: navigation, search

Contents


This page contains references to user contributions and add-ons (original PyWPS with basic set of processes can be downloaded from download page).

[edit] Submitting a process

Before you submit a process, we invite you to respect all the points that follow; this will help to avoid problems, and create a better work.

[edit] Copyright and licensing information

Please be sure to include copyright and licensing information in the header comments of your code so that others may know how they can use, extend, modify, and redistribute your work.

e.g.

"""
Description of your process which can be seen with pydoc.
"""
# Author:	Your Name
#        	http://your.site
# Lince: 
# 
# Your Process Description
# Copyright (C) 2006 Your Name
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

# PREREQUISITES
# 1) PyWPS: http://pywps.wald.intevation.org
# 2) ...
[script follows]

[edit] Respect the standard

Please have a look at our script coding standards before submitting here.

[edit] Process in development

If you are submitting a process that is still at a development phase (for example if you need help to go on), please mark as Unstable in the description.

[edit] GRASS

[edit] Prerequisites

[edit] Additional Configuration

You need to have your data set folder set to allow pywps to write inside (a 775 can be ok)


[edit] Addons

[edit] Raster Analysis

  • minoreffortpath: This process uses r.walk and r.drain to found the minor efforts path on a DEM. In this example slope factor is used as cost.

Author: Luca Casagrande

  • profile: (STILL IN DEVELOPMENT) This process uses r.profile to create a table and a graph, of the elevation profile between 2 points.

Author: Luca Casagrande

[edit] R/R-SPATIAL

[edit] Prerequisites

   maptools
   spgpc
   sp
   gpclib
   foreign 

[edit] Additional Configuration

Once installing the above software packages, some special configuration on Linux should be done to integrate a python script that wraps R functions into PyWPS.

  • Setting up Xvfb

Xvfb is a virtual framebuffer X server, which is available at your linux installation CD. If a R WPS Process makes an image by calling jpeg()/png() functions, the Xvfb setting needs to be done. First installing and booting Xvfb server, then not forgeting to add into /etc/profile the following two lines:

   DISPLAY = :1
   export DISPLAY
  • Scripting Using Python, RPy and GNU R

When Python imports RPy module, it prints into stdout the verbose infomation that indicates RPy is loaded correctly. GNU R does too when loading R-Spatial libraries. The above verbose output causes a big conflict because PyWPS is a cgi program that also uses stdin/stdout to communicate with its client program.

To make a python cgi script work with R smoothly, the script should forward the verbose into '/dev/null' when RPy and R-Spatial libraries are loaded. See the following examples for more detail.

[edit] Addons

  • rspatial: Generating a png image from a vector shape file using gnu r plus sp/maptools.

Authors: Xianfeng Song, Junzhi Liu

Personal tools