What is this?
-------------
This is SWIG based python wrapping for GRASS API
which allows to call GRASS library functions from Python programs.
How to INSTALL?
---------------
1. Install SWIG, the Simplified Wrapper and Interface Generator
http://www.swig.org
2. Be sure you configured GRASS with support for Python (example):
./configure --with-python=/usr/bin/python2.5-config
3. Run make in the swig/python/ directory
It will create a series of .py Python files and of .so library files
4. TODO: STILL VALID??:
From within GRASS (or a fake grass session) run "python test.py" to
test and to automatically create a byte-compiled version of the module
(python_grass7.pyc). The .pyc file is platform independent and may be
safely shared among systems. Even so, it doesn't hurt to rebuild it
ourselves while we still have write permissions and to make sure we
are using an up to date copy. (out of date copies will be ignored)
5. It is useful to build the NumPtr module as well.
- see README.GRASS in that directory for instructions
How to use it?
--------------
import grass
GRASS functions will be available in this module.
Eg:
import grass
mapset=grass.G_mapset()
print mapset
See examples/m.distance.py for an example of a working SWIG-Python module.
More examples can be found on the GRASS Wiki site's Python page:
http://grass.osgeo.org/wiki/GRASS_and_Python#Python-SWIG-GRASS_interface
DEBUGGING
----------
gdb --args python
e.g.
gdb --args python rasteraccess.py
TODO
-----
See TODO in this directory.
AUTHORS
-----
Initial version:
Sajith VK sajithvk at gmail.com
Thu, 9 Mar 2006 16:02:50 +0530
http://lists.osgeo.org/pipermail/grass-dev/2006-March/021800.html
http://freegis.gnu.org.in/temporary/python_grass6.tar.bz2
Further work:
Markus Landa
Glynn Clements
...