Access to geoprocesses with Scripting Framework for gvSIG 2.x

You will be allow to execute SEXTANTE algorithms and gvsig-geoprocesses inside your jython scripts.
Also i will be developing ‘gvpy’ library that will extremly simplify all your code.

Follow me on: or @masquesig

Learn more – Weekly reports

What is gvSIG 2 and his new Scripting Framework?

You will learn how to develop your own tools!

Desktop Application

gvSIG Desktop is a powerful geographic information system (GIS) designed to offer a free solution to all needs related to geographic information management.


Scripting Framework

New module for gvSIG 2.x that will help you to create your own tools using Jython (it’s like Python), easy language even if you never write code before.


So.. What is gvpy?

Less code, more powerful

This library will help you to develop your tools quickly. Also, now is not available execute any geoprocess from your script. This will allow you to use one powerful extension like SEXTANTE with one line of code. 

Execute your tool with one click


You can check in my blog a lot of examples about this, how to create shapes with scripts, features, geometries... Sometimes can be a little bit tricky and require practice with gvsig code. 

But with gvpy..

You could create the image above with one click, and i’m sure you will undertand all the code you need. It will be like this:

from gvpy import *

def main(*args):
        layer = gvsig.currentLayer()       #Base layer

        #Create new shapes
        layer1 = newLayer(layer,"C:/gvsig/point_shape.shp", 1)
        layer2 = newLayer(layer,"C:/gvsig/line_shape.shp", 2)
        layer3 = newLayer(layer,"C:/gvsig/polygon_shape", 3)

        #Add new features
        addFeature(layer1, "point", "01", [50,80])          #New Points 
        addFeature(layer1, "point", "02",[150,50])
        addFeature(layer1, "point", "03",[100,10])
        addFeature(layer1, "point", "04",[0,10])

        addFeature(layer2, "line", "01", [[50,80],[150,50],[100,10],[0,10],[50,80]])         #New Line

        addFeature(layer3, "polygon", "01", [[50,80],[150,50],[100,10],[0,10],[50,80]])          #New polygon 

        #Modify all values in one column
        modifyFeatures(layer1, "field1", "Points_gsoc")
        modifyFeatures(layer2, "field1", "Lines_gsoc")

        #Modify schema

        #Execute SEXTANTE: algorithm ’perturbate points’
        r = gvpy.runalg("perturbatepointslayer", LAYER = layer1,MEAN = 5, STDDEV = 5 )

Easy, right?


You could find more info on my blog
and the code in Github.

Any help will be appreciated, you can contact with me here:

Óscar Martínez