PROJ.4 is a cartographic projections library written in C, originally written by Gerald Evenden (at that time at the USGS). It is in active use by quite a lot of applications, like QuantumGIS [http://www.qgis.org/], GRASS GIS [http://grass.itc.it/], MapServer, PostGIS, and many others. More information can be found here: http://trac.osgeo.org/proj/ Proj.4 is released under an MIT license and thus can be used quite freely. **Tcl binding for proj.4** [TR] (2010-06-10) It turned out, that making a Tcl binding to proj.4 was quite simple. It just took a few days to get all things right. There is a more or less well-defined API [http://trac.osgeo.org/proj/wiki/ProjAPI], that can be used and what I am currently coming up with is a new Tcl package with the main command proj::project. It works like this: ====== package require tclproj # give an input coordinate system in proj.4 format, # an output coordinate system, # and a list of x/y coordinate pairs in a list: proj::project "+proj=latlong +ellps=clrk66" "+proj=merc +ellps=clrk66 +lat_ts=33" {-16 20.25} -1495284.21147 1920596.78992 proj::project "+proj=latlong +ellps=WGS84" "+proj=merc +ellps=WGS84 +lat_ts=33" {-16 20.25 10.33 54.55 9.23433 55.01132} -1495251.43594 1920692.42348 965371.708328 6078165.01069 862977.824527 6152753.87339 ====== (2010-06-11) Today I added the proj::info command. It gives you the following: ====== # return the proj.4 release used here: proj::info version # return a list with the available projection identifiers and names: proj::info projections # return a list with the available ellipsoid identifiers and names: proj::info ellipsoids # return a list with the available datum identifiers and names: proj::info datums # return a list with the available conversion unit identifiers and names: proj::info units ====== As of now, there is basic error checking, and some other commands already, but the heart is the proj::project command. The extension can be built with the proj.4 library statically linked in, so there is no need of seperately installing proj.4 on your system. My test system is a Mac right now, but my build script should also work nicely on Unix. I don't know about Windows yet. It would be fairly easy to also add commands that correspond to the ones used in the [tcllib] module [mapproj]. If there is an interest for this work within the Tcl community, I can try to set up a place where you can download the source and maybe some binaries ... just drop me a line. ---- ** Download code and package** I have placed the current state of the package here (containing the library and a pkgIndex.tcl script, no separate installation of proj.4 needed): * tclproj-linux.zip [http://tcl.typoscriptics.de/proj/tclproj-linux.zip] * tclproj-mac.zip [http://tcl.typoscriptics.de/proj/tclproj-mac.zip], (for a x86_64 tclsh, i386 version soon following) * tclproj.c [http://tcl.typoscriptics.de/proj/tclproj.c], the current source code for the package (feel free to comment * test-tclproj.tcl [http://tcl.typoscriptics.de/proj/test-tclproj.tcl], a tcltest script for the new commands ---- Related topics: [geodesy] ---- '''[arjen] - 2010-06-11 03:06:59''' Torsten, you have beaten me to it :). Nice work. [TR] - Good to hear! <>Category Geography