[Gdal-dev] Conversion formula

Curt, WE7U archer at eskimo.com
Wed Jan 7 13:01:21 EST 2004


On Wed, 7 Jan 2004, Daniel McAferty wrote:

> I had the same question a few weeks ago. It is a lot tougher than I thought
> but I got things to work.
> Here are some web sites that helped me get the info I was looking for.
> http://www.gpsy.com/gpsinfo/geotoutm/
>     This is good starting place as it has many links to places that has info
>
> http://www.posc.org/Epicentre.2_2/DataModel/ExamplesofUsage/eu_cs34.html
>     This is a paper that explains some of the different datums and the math
> formulas
>     to convert from Lat/long to UTM and back. It also has a link to an
> example to convert from
>     lat/long to UTM. It only goes the one direction. But I found the souce
> code of that html example
>     helpful in my own programs.
>
> I also found some helpful code examples on
> http://www2.ifjf.uib.no/latlong2UTM/

I just went through this exercise a couple of months ago, and found
out about some things that are often implemented incorrectly.  The
final solution I came up with is not what I would call optimal, but
it'll work for us:

The problems in the UTM grid come about in the Southern Norway area
and north of there in the top band.  There are irregular grids there
(not 6-degree spacing) used by some forms of UTM.  There's very
little mention of these irregular grids when prowling around web
sites looking for info.

Various sources told me that these irregular grids are used only
when computing MGRS coordinates.  I first implemented it that way,
using the irregular zones only for MGRS and regular six-degree zones
for UTM.

Later, one of my users in the affected area complained about it, as
their civilian UTM maps use the irregular grids.  I added another
option, so we now have these choices for displaying coordinates:

    dd.ddddd
    dd mm.mmm
    dd mm ss.s
    UTM
    UTM w/special zones
    MGRS

What was interesting about using the special zones:  The
Eastings/Northings don't change, only the grid number itself.

Another interesting thing is the NATO letter after the zone number
that some people use.  Others drop it entirely.  Some use a N/S or a
+/- to designate the northern/southern hemisphere.  Without _some_
indication of which hemisphere you're in, UTM coordinates are not
sufficient to tell you where on the earth you are.  Zone and
Easting/Northing aren't sufficient to describe an unambiguous
position.  We chose to use the NATO letters after the zone number.
It matches what a lot of our GPS's display.

Our source code is freely available under the GPL license if anyone
is interested in looking at it.

-----------------------------------------------------------------
Curt, WE7U			    archer at eskimo dot com
Arlington, WA, USA		http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"




More information about the Gdal-dev mailing list