[Qgis-developer] GGL2 - QGIS integration

Fernando González fergonco at gmail.com
Mon Jun 18 00:14:56 PDT 2012


Hi all,

Although I've already taken part in the list once, I want to briefly
introduce myself. I'm freelance developer, I started with GIS
development in the beginnings of gvSIG. I work mainly with Java and
I'm just a basic QGIS user... until now. My brother Víctor (González)
and I are engaged in a new development that may be of interest for the
QGIS community.

One of the aims of this development is the integration of GGL2[1] in
QGIS. GGL2 is a geoprocessing specific language, which means that it
provides language constructions so that the user can specify and
combine geoprocessing operations easily. In other words: kind of SQL
but more GIS specific. As a small example, we have WKT literals in
GGL2:

a = POINT(10 10);

Another example: saving the previous point as a shapefile would be
something like this:

import ggl.shp;
a = POINT(10 10);
shape = [{the_geom=a}];
write SHP shape to '/tmp/result.shp';

There is raster support (limited so far) and more features. For more
examples, there is a "getting started" section[2] in the
documentation[3].

The integration with QGIS will make it possible to:
  (a) reference the layers in QGIS as if they were variables in the
GGL2 script and
  (b) show results with spatial component directly in QGIS. Thus, a
script to create a buffer on a QGIS layer and showing it in QGIS would
be something like:

import ggl.shp;
import ggl.geom;
buff = qgis_layer select(st_buffer(qgis_layer/the_geom)); // reference
to qgis layer
show buff in gis as SHP 'result'; // showing the result back in qgis

In the future I'd like to integrate it with SEXTANTE so that scripts
written in GGL2 can be reused through the SEXTANTE user interface.
This is out of budget though :( but I talked with Víctor (Olaya) and
it doesn't seem like a big task once the development is finished.

I hope it's interesting for some of you and, of course, any comments
of such an active and skilful community are very welcome. Mainly
because it's our very first development in python!

Best regards.
Fernando


[1] http://www.gearscape.org/
[2] http://www.gearscape.org/html/ggl2/tutorials/index.html
[3] http://www.gearscape.org/index.php/documentation
[4] https://xp-dev.com/svn/ggl2/ggl2/apis/python/


More information about the Qgis-developer mailing list