Jcoord

Easily convert between latitude/longitude, Universal Transverse Mercator (UTM) and Ordnance Survey (OSGB) references with Java using the Jcoord package.
Stable version: 1.0 (11th February 2006)
Development version: 1.1-b (3rd April 2006)

Features | Download | Documentation | Examples | Development | Version History | Licensing

12th June 2011 - People have been asking whether Jcoord is still being maintained. The answer to this is yes, and I am currently spending time working through all the comments and e-mails that have been sent through to me over the past few years and will be releasing a new version in the coming few weeks.

Conversion between latitude/longitude and grid references is not as simple as one would expect. Indeed, the maths involved is rather complex and not really for the faint-hearted! I have created a Java package which provides a simple API to allow conversion between OSGB (Ordnance Survey of Great Britain) grid references, UTM (Universal Transverse Mercator) references and latitude/longitude. OSGB Grid references can be returned as a standard six-figure grid reference using the 100km grid square letters (e.g. SK619847).

The Jcoord script also contains a method to allow the calculation of the surface distance between two points of latitude/longitude.

Looking for the same thing but with JavaScript or PHP? Translations of this package with the same functionality are available for JavaScript (see JScoord) and PHP (see PHPcoord).

Information on converting between UTM and latitude/longitude is available at www.posc.org.

The Ordnance Survey have published a concise guide on converting between OSGB and latitude/longitude which is available at www.gps.gov.uk.

Bear in mind that Jcoord is still in development, so check back often for updates. To contact me about Jcoord, send an e-mail to jcoord@jstott.me.uk.

Features

Jcoord contains the following features:

Download

jar files contain both the source code and compiled bytecode.

Current Version

Documentation

Jcoord API documentation is available online for the following versions:

Examples

The Jcoord download contains a uk.me.jstott.jcoord.Test class which shows how to use the various classes and method provided in the Jcoord package.

Development Version

I am currently working on version 1.1 of Jcoord which will be released in the near future. A complete jar file including all the source code and documentation is available for testing purposes.

Version 1.1 will be a significant update, including the ability to covert co-ordinates between various datums as well as adding the ability to convert easily between any one of six different co-ordinate systems. Here's a list of supported co-ordinate systems:

It is possible to convert between a co-ordinate in any system simply by first converting the co-ordinate to a latitude/longitude and then converting that to the other system. Here's an example to show how easy it is to convert between an Irish National Grid Reference and a UTM reference:

IrishRef i = new IrishRef("G099361");
LatLng ll = i.toLatLng();
ll.toDatum(WGS84Datum.getInstance());
UTMRef u = new UTMRef(ll);

Here's a comprehensive list of new features and fixes being added to the current development version:

If you have any suggestions for future enhancements or find a problem with the current development version, let me know by e-mail at jcoord@jstott.me.uk.

Version History

Licensing

This software product is available under the GNU General Public License (GPL) which permits the use of this product subject to a number of conditions as described in the license. A commercial license is also available for this product which provides the added benefits of royalty-free use and distribution in proprietary applications as well as prioritised technical support by e-mail. Contact me for more information about commercial licenses for this product.

Solution Graphics

If you do not require a commercial license but still want to contribute, perhaps you would like to consider making a donation:

Commercial licenses for this product are available at the following prices:

Note that you will be billed in Pounds Sterling, so the relevant exchange rate from your currency will apply at the time of purchase. A copy of the license will be forwarded to the address provided at the time of purchase.

Save up to $90 with Dreamhost