[Qgis-developer] Data exchange between QGIS and SAGA [was: QGIS Processing Framework]

Johan Van de Wauw johan.vandewauw at gmail.com
Thu Jul 7 04:36:40 EDT 2011


On Wed, Jul 6, 2011 at 7:30 PM, Camilo Polymeris <cpolymeris at gmail.com> wrote:
>
> One of the most important and difficult remaining parts is data
> exchange (raster & vector). I have been studying SAGA's API [4], but
> am not sure how to handle it & would appreciate comment from people
> more familiar with it.
>
> Do you think it would be easier (or cleaner) to interface SAGA's
> relevant data structures to QGIS' dataproviders or layer structures?
> For comparison, see the QGIS API docs.[5]
>
Camilo,

I think the only feasible way, definitely on short term, is saving
every needed qgis data-object on disk in saga's native file format
(shp for vector data, sgrd/sdat for raster data(requires gdal 1.7)),
running the saga module (like you would do if you were running the
command line version) and then opening the resulting files in qgis.
You could use the api to find out which objects in qgis may be passed
to saga, eg make sure that only polygon vectors show up as an option
in the dialog, but for actually passing the data, I think you should
write to the disk.
I think the same will be true for many other processing frameworks,
and I even noticed that when I calculate voronoi polygons in qgis I
have to save my files prior to running, so even here it seems to work
like that.
Direct access of the files like they are loaded in qgis would most
likely require non-obvious changes in the saga api, which -imho- go
outside the scope of your project, certainly if you want to have a
general processing framework.
It is also a non-essential feature: it may be added later if the
plugin is successful, with the 'write to disk method' as a safe
fallback option.

Kind Regards,
Johan


More information about the Qgis-developer mailing list