Developing with GeoScript

This section describes how to set up a GeoScript development environment.

Install Jython

Jython version 2.7.2 or greater is required for GeoScript.

  • Install Jython

    For the remainder of the document the Jython installation root will be referred to as JYTHON_HOME_DIR.

Install setuptools

  1. Downlaod ez_setup.py

  2. Execute ez_setup.py with the jython command:

    $ <JYTHON_HOME_DIR>/bin/jython ez_setup.py
    

Upon success <JYTYON_HOME>/bin/easy_install will be created.

Install virtualenv

Note

Creating a virtualenv for GeoScript is not neccessary but is highly recomended.

  1. Using easy_install installed in the previous section easy install the virtualenv library:

    $ <JYTHON_HOME_DIR>/bin/easy_install virtualenv
    
  2. Create a new virtualenv named geoscript:

    $ <JYTHON_HOME_DIR>/bin/virtualenv geoscript
    
  3. Activate the geoscript virtualenv:

    $ source geoscript/bin/activate
    

Obtain Source Code

The GeoScript sources are stored in a git repository hosted at github.

  1. Install git

  2. Clone the geoscript git repository:

    (geoscript)$ git clone git://github.com/jdeolive/geoscript-py.git
    

Obtain GeoTools Libraries

GeoScript requires the GeoTools libraries to function. There are a number of ways to obtain them.

Maven

If `Apache Maven <>`_ is installed on the system execute the following command from the root of the local git repository:

$ mvn install

Upon success the required GeoTools libraries will be located in the jars directory.

Ant

If `Apache Ant <>`_ is installed on the system execute the ant comand from the root of the local git repository:

$ ant

Upon success the required GeoTools libraries will be located in the jars directory.

Download

If neither of the above methods are appealing:

  1. Download the latest GeoTools 2.6 release

  2. Unpack the zip archive

  3. Copy geotools-2.6.?/*.jar into the jars directory

Setup the CLASSPATH

Once the GeoTools libraries are located in the jars directory source the classpath file located in the root the local git repository:

$ source classpath

Install Python Dependencies

GeoScript also requires a few Python dependencies.

  • Easy install simplejson:

    (geoscript)$ easy_install simplejson
    
  • Easy install py-dom-xpath:

    (geoscript)$ easy_install py-dom-xpath-redux
    

Install nose

Running GeoScript unit tests requires the nose library.

  • Easy install nose:

    (geoscript)$ easy_install nose
    

Install sphinx

Writing GeoScript documentation requires the sphinx library.

  • Easy install sphinx:

    (geoscript)$ easy_install sphinx