geocanvas image
Geocanvas aims to provide a very small and simple set of API's to assist the developer in creating geographically referenced canvas applications within the GTK-2 environment.

Geovpf is an additional library that is used to render Vector Product Fromat including Digitial Nautical Charts.

This library is designed to work with versions of GTK older than 2.8. Projects that have the ability to use newer versions of GTK should use the newer geoc. The geoc library has many API simplifications that are not available in this older library.

Geocanvas provides a set of drawing objects that are based on objects defined in the foocanvas library from Gnome CVS. The foocanvas library is included as part of this package and therefore does not need to be downloaded and compiled separately.

geocanvas features

  • Complete GObject developer interface hides low level interaction.
  • Automatic viewport and scroll region management.
  • Common interface routines for construction of poly and point objects.
  • Complete Python language bindings.
  • sample code

    GeoCanvas *canvas;
    GeoCanvasGroup *group;
    /* The GeoCanvas will create its own projection if one is not specified.
     * Here the panning is enabled continuously via mouse the middle mouse button.
    canvas = GEO_CANVAS(g_object_new (GEO_TYPE_CANVAS, 
            "pan_state", GEO_CONTINUOUS_ACTIVE,
            "pan_button", 2, 
    /* This example draws a rectangle centered around 41:15N, 71:15W.
     * The GeoCanvasGroup object has a common interface for drawing lines, polygons,
     * and point features.
    group = geo_canvas_group_new(foo_canvas_root (FOO_CANVAS(canvas)),
            "itemtype", FOO_TYPE_CANVAS_LINE,
            "fill_color_rgba", 0xff0000ff, NULL);
    geo_canvas_group_add_point(group, -71.5, 41.0);
    geo_canvas_group_add_point(group, -71.0, 41.0);
    geo_canvas_group_add_point(group, -71.0, 40.5);
    geo_canvas_group_add_point(group, -71.5, 40.5);

    python sample code

    import geocanvas
    canvas = geocanvas.Canvas()
    group = canvas.root().add(geocanvas.CanvasLines,
            itemtype = geocanvas.foocanvas.CanvasLine,
            fill_color_rgba = 0xff0000ffL)
    group.add_point(-71.5, 41.0)
    group.add_point(-71.0, 41.0)
    group.add_point(-71.0, 40.5)
    group.add_point(-71.5, 40.5)

    geocanvas dependencies:


    geocanvas reference docs here

    download here


    In order to minimize build dependencies this library has incorporated work from other projects most noteably tkGeomap and libfoocanvas. libfoocanvas is presently available only via Gnome CVS.


    geovpf provides a GObject interface that is used to plot Vector Product Format (VPF) onto the geocanvas.

    screenshot geovpf dnc-demo program

    geovpf features

  • Plots VPF directly without conversion to intermediate datasets.
  • Supports thematic display and limited expression queries.
  • Optional automatic library selection mechanism based on current viewport.
  • Complete Python language bindings.
  • sample code

    /* The GeovpfCanvasTheme is used to display all feature types - edge, face,
     * entity_node, connected_node, and text..
     * library_path: location of the library.  Use of directory path can be avoided
     * by using the GeovpfDatabaseLookup object.
     * coverage: a set of topologically related feature classes.  Earth coverage in
     *              in this case.
     * feature_class: features that share a homogenous set of attributes.  Earth
     *              coverage areas in this case.
     * expression: thematic information (a limited database query).  
     *             This example queries for land and island coverage.
    foo_canvas_item_new(group, GEOVPF_TYPE_CANVAS_THEME,
            "library_path", "/home/username/dnc/dnc17/a1707420",
            "coverage", "ecr",
            "feature_class", "ecrarea",
            "expression", "F_CODE=BA030 or F_CODE=DA010",
            "fill_color_rgba", 0xBDAF1Bff,

    geovpf dependencies

    geocanvas, gtk-2.0, and a VPF dataset.

    The VPF dataset shown in the screenshot is from Digital Nautical Chart (DNC) 17 available from this link.

    The demo program included in the package is written specifically for DNCs. It will show a blank map unless dnc information is available at the ~/dnc directory level.

    geovpf reference docs here

    download geovpf from the here


    This library uses some of the original vpfview source code. The vpfview source is available in its entirety at There is also a working binary available for Windows systems at the same site.