Georeferencing Images by Control Points: TransGen and gcps2wld utility

Wednesday, July 23, 2008

We have just released TransGen, a utility based on GeoTools/Java. It allows you to generate a best fitting affine transformation from the set of control points.

The set of control points can be generated for example by our online tool prototype and has a simple text format: "latitude longitude pixelx pixely" per line. A sample of file with GCPS points and related JPG image derived from Natural Earth II is available in our code repository.

The utility generates a World File, which represents the best fitting transformation for given set of ground control points (GCPs) in a format that can be used by virtually any GIS system.

The process of image registration is done by an algorithm, which allows you to restrict some of the standard operations. By default all the six affine operations are applied (translate x, translate y, scale x, scale y, rotate, skew).



But you can set constant value for some of the operations, thus for example eliminating the skew/shear (this is what you need for generation of KML for Google Earth which only supports affine5) or rotation (when you know that the map has north orientation already). There is also a possibility to compute the best similarity transformation.

You can download the command line utility implementing this algorithms:


TransGen source code is available in our code repository. The programming and design of the algorithm was done by Jan Jezek and was funded from our grant. The main functionality is now available as part of Java GeoTools package, and therefore available to the community as well as to other programmers.

We are going to embed the algorithms from this tool in the user friendly web-based tool we plan to develop to produce georeference for scanned maps. We have converted this utility to the Python programming language for production use (gcps2wld.py), where we used Affine6 and Affine5 implementation from excellent open-source MapAnalyst application.

Note:
GeoTools.org is being used by OpenSource projects like GeoServer or uDig. Plenty of websites and information systems are profiting from the functionality provided by this library. For example Great Britain Historical GIS Project is utilizing it for development of its http://www.visionofbritain.org.uk/ website)
Tags: georeference, announcement