[Freegis-list] Geospatial graphics library based on Cairo?

Ari Jolma ari.jolma at tkk.fi
Mon Apr 2 16:27:21 CEST 2007


Sean Gillies wrote:
> I have a package in the works for Python:
>
> http://trac.gispython.org/projects/PCL/browser/PCL/branches/cairographics/PCL-Cairo
>
> The following C extension module renders a few GEOS C geometries using 
> Cairo:
>
> http://trac.gispython.org/projects/PCL/browser/PCL/branches/cairographics/PCL-Cairo/cartography/engine/cairo/_rcairomodule.c
>   

Let me write down my thinking a bit:

The general geovisualization pipeline is

create a canvas
define geospatial and general properties of the canvas
for all geospatial data layers (from bottom to top):
    render the layer
       render a geospatial object

The canvas would be a cairo context in this case. The library would need 
to link georeferencing and other data to it. A geospatial data layer 
could be many things (a set of GEOS geometries, an OGR layer, etc), but 
conceptually it consists of geometries, attributes, and attribute 
values. Additionally, there's style data that may hook up to attributes 
and tell how the values are utilized (for colors, symbols, etc) in the 
visualization. When rendering an object is requested, the caller knows 
the value and can thus can call specific visualization function or give 
a specific color etc. Thus the library would need three kind of routines:

1. define geospatial and general properties of the canvas (returns a 
handle to a "geocairo" context)
    - only one of this kind function is needed
    - a function to convert from geographic coordinates to context 
coordinates could be provided
2. render a layer on the cairo context
    - there would probably have to be a separate function for each layer 
implementation
3. render a geospatial object on the cairo context
    - again, several functions or macros, one for each object type & 
visualization class

The pipeline itself could be left for the user, thus a scripting 
language client would have a complete control over the visualization and 
could implement its own visualization routines etc.

For me to implement this would initially mean just reorganizing my code 
(currently in libral: 
http://libral.cvs.sourceforge.net/libral/libral/ral_pixbuf.h?revision=1.13&view=markup 
and other files) to use cairo. I'm probably going to do this anyway, I'm 
just trying to find out if there are similar interests.

Cheers,

Ari

> Cheers,
> Sean
>
>   


-- 
Prof. Ari Jolma
Geoinformaatio- ja paikannustekniikka / Geoinformation and positioning
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 451 3886 address: POBox 1200, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma




More information about the Freegis-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)