The tcl-map GSoC2009 project

This GSoC2009 project is successfully completed. The bindings have been submitted to GDAL/OGR for integration (also found in the SVN ). The demo application can be downloaded from here: .

The goal of this project was to produce the necessary language extensions to facilitate programming of GIS systems in Tcl. In particular:

  • Reading/Writing of files (and URLs) in popular GIS formats
  • Presenting GIS data visually in a Tk canvas
  • Helper procedures to zoom in/out, etc.

This GSoC 2009 project attempted to extend Tcl support for GIS applications in general. In particular it introduces Tcl bindings to GDAL/OGR libraries, that allow access to many different raster and vector geo-spatial data formats.

The exact supported GIS file formats can be found at:

License: The bindings under the same license as the GDAL/OGR bindins (X11/MIT). The rest of the code under GPLv3 (e.g. the Tcl extension for rendering, the demo application etc.)

Author: Alexandros Stergiakis

Copied from GSoC student application comment section:

This comment will attempt to clarify a bit the relation of this GSoC project with other GIS-related Tcl (and not) projects. This belongs to the design phase, which is work in progress.

mapproj package in tcllib [1 ]

This package is used to map world coordinates (latitude and longitude) to/from map co-ordinates on a number of different map projections. This function is important for this SoC project, when visualizing a GIS data file. Most precisely the generated canvas widget must be able to report the correct 2D & 3D coordinates for any point on the map or geometry in it. Nevertheless, the OGR/GDAL library natively has very comprehensive support for projections and conversions between them. Therefore, there is no need for using the mapproj package of tcllib.

Ref: [2 ]

canvas::sqmap [3 ]

This canvas variation is simply the regular canvas with background comprised of tiles of images. It cannot really help this project, as it has limited support for vector graphics (needed for OGR). In any case, its functionality can be easily reimplemented in tkpath/tkzinc.

SpatiaLite [4 ]

This is an SQLite extension to support storing of spacial data and query of them in standard SQL syntax. This is handy because complex queries can be expressed easily in SQL (rather than as code in some programming language). There is also a plugin for it (VirtualShape) to access to ESRI shapefiles as DB tables. However, it only supports read-only access, and only for ESRI shapefiles, which are quickly becoming obsolete. This project will be further investigated.

tclTiger [5 ]

This is simply a script that initially converts some given coordinates to those understood by Google Maps, and later-on requesting via the JavaScript Google Maps API the respective map to be generated and displayed in a Web Browser. This SoC Project goals differ with tclTiger in that 1) the GIS info are stored in local files, not in google's GIS DB, 2) it distinguishes the various geometries displayed in the generated map (is not a monolithic image), 3) the visualization is done on a Tk canvas, rather than as a stale image.

GRASS [6 ]

GRASS is a stand-alone program used for geo-spatial data management and analysis, image processing, graphics/maps production, spatial modeling, and visualization. That is much more than what this project is trying to achieve. It's heavy-weight and not embeddable in a Tk window. No correlation with this SoC project, except that it is also based on the OGR/GDAL library.

gpsmanshp [7 ]

This is a Tcl Package to Read and Write ESRI Shapefiles. It relies on the shapelib library [8 ]. It has the shortcoming that it only supports the ESRI shapefile format, whereas OGR/GDAL provide a common interface to many file formats. It hasn't been updated for Tcl 8.5.

Tkgeomap [9 ]

This is a Tcl/Tk project that allows to draw vector maps in a derivative of the Tk canvas widget. The GIS data is provided either by calls at run-time or read from files. It also provides for applying various GIS calculations (calculating geographic distances and angles, applying common map projections, creating named places, and creating sets of anonymous points). It sounds very similar to what this GSoC project is proposing, but it differs in one very notable way: It reads/writes in non-standard file formats (no shapefiles or otherwise). Nevertheless, this package will be investigated further, because it might give ideas for GIS calculations, and overall architecture (it has one Tcl package to read/write GIS data and make calculations, and another one for displaying the GIS data on a canvas widget).

spherekit [10 ]

This is a toolkit to calculate spatial interpolation, that is to estimate variables at unobserved locations in geo-space, based on the values at observed locations. Albeit not directly relevant, the techniques of this toolkit can be used by an application of this GSoC project to visualize spacial variables on generated GIS-enabled canvases.

I (nb) downloaded the windows executable got an error upon start-up "couldn't load library blah/path_to_tmp/TCL19B.tmp A function specified in the import table could not be resolved by the system. Windows is not telling which one, I'm sorry...while executing load path_to_insta/GISViewer.exe/lib/osgeo-1.0/gdal.dll etc."... I'm running XP SP3. Depends only shows missing IESHIMS and WER dll, but I thought they're delay loaded anyway...