[Qgis-developer] QGIS libs and python bindings

Martin Dobias wonder.sk at gmail.com
Thu Apr 13 14:19:39 EDT 2006


Hi all,

I'd like to introduce you my plan with QGIS for near future: my
intention is to finish refactoring into libraries which Tim has
started in January and create python bindings for simpler use of QGIS
API for 3rd party apps (and also plugins).

First let me explain why I want to start now and not wait until
release of 0.8. It's because these improvements are part of my school
assignment and it would cause me quite a lot of problems if I don't
manage to prepare it on time. My deadline is at end of May, including
writing a sample application with GPS and routing support and writing
documentation for it.

I would like to do the development in a separate branch ... Gary,
please could you create one for me? I will keep it up-to-date with
trunk, so probably some other development for 0.9 could take place
there.

Let's continue with technical aspects:

QGIS libraries - my idea is to have only 2 libraries for use by 3rd
party apps: CORE a GUI. There's not much sense to have more of them
(e.g. legend library, raster library etc.) as all QGIS functionality
can take place in core or gui library. Also because of on-demand
library loading there's no need to be afraid that it will take more
time to load the libs if they're bigger, because only those parts of
library which are needed are loaded - not the whole lib.

Core library should contain some more classes which are currently in
gui lib because of unresolved gui dependencies - e.g. code regarding
layers and rendering. GUI dependent stuff in core classes should be
moved to GUI library. The result should be that anyone should be able
to create an application without GUI which will use QGIS rendering or
utilities for editing layers etc.

Gui library should also include plugins for Qt designer so map canvas
and lengend (and probably some more widgets) could be included easily
in other apps.

Also I'd like to propose this change for code organization - let's
have only 2 directories under src: core and gui (representing the
libraries), for easier orientation in code it would be good to have
subdirectories for classes with similar functionality. This means that
e.g. composer or legend won't have a separate library, but will be
divided from other gui code by having their own directories.
Miscellanous classes can be left as they are, without being in a
specific directory of the library.

This is an example how the directory structure could look:

core
- providers
- exceptions
- search
- render
- symbology
- raster

gui
- composer
- legend
- layer_properties
- map_canvas
- projection_selector
- ui_files

For Python bindings I've decided to use SIP4 together with PyQT4 to
create these bindings. These utilities are not yet officially
released, but there are daily snapshots available at
http://www.riverbankcomputing.com/Downloads/Snapshots/ and they look
already quite stable after doing some tests.


Martin



More information about the Qgis-developer mailing list