Geography Reference
In-Depth Information
Chapter 13
GIS Scripting
Most GIS users that I know end up doing a bit of programming, regard-
less of the software they are using. There is always some little task that
is easier done with a script or a bit of code. In this chapter, we'll look at
some methods for automating tasks in OSGIS software. You don't have
to be a programmer to do a bit of script writing, especially when you
can get jump-started by downloading examples and snippets.
The script languages available to you depend on the application you
are using. Applications and tools with a command-line interface (CLI)
can be scripted with most any language available. Others have bind-
ings for specific languages. Some nonexhaustive examples include the
following:
• GRASS: Shell, Tcl/Tk, Perl, Ruby, Python
• QGIS: Python
• GDAL/OGR: Shell, Perl, Ruby, Python
• PostGIS: Any language that works with PostgreSQL, such as Perl,
Python, PHP, and Ruby
Some OSGIS applications even provide bindings that allow you to write
a custom application using a language such as Python. In this chapter,
we will explore some of the techniques used with these applications.
13.1
GRASS
Since the real core of GRASS is comprised of CLI applications, it's pretty
easy to use most any scripting language to perform tasks. From Perl,
Python, Ruby, and Tcl/Tk, you can “call” an application and capture
the output. This makes GRASS easy to automate.
 
 
 
 
Search WWH ::




Custom Search