Re: CornerScaling

From: Jean Thioulouse (Jean.Thioulouse@biomserv.univ-lyon1.fr)
Date: Fri Feb 06 1998 - 11:04:44 MET


tito@bouake.orstom.ci (L. Tito) ecrit:
>Je voudrais utiliser cornerScaling pour convertir des coordonnées Deg Min Sec en UTM

C'est malheureusement impossible. Cf ci-dessous ce que j'ai trouve avec Altavista.
Si c'est d'interet general, ca peut etre rajoute dans MapUtil.

Jean

Converting Latitude/Longitude to Universal Transverse Mercator (UTM)

On October 5th, I posted a request on sci.geo.geology and
sci.geo.satellite-nav asking about conversion formulas between
latitude/longitude and UTM coordinate systems. I was a bit overwhelmed
by the response. All of them were excellent. I've included all the
responses below, the authors kindly gave me permission to reproduce
their messages.
One note of caution is reflected in Richard Koolish's message below.
Depending on the geodetic datum used, your results may vary. The C
source listed below using datum from the Clark 1866 ellipsoid which is
not the same as the WGS84 ellipsoid that is "the most accurate" --
although perhaps not the most widely used (yet). You can steal the
proper geoidal values from the Fortran or QBasic code on Peter's site --
that's what I did.

My original posting to sci.geo.geology & sci.geo.satellite-nav

Hi -

I was wondering if there was a computationally simple way to produce
UTM readings given lat/lon. Is there something simple? Alternately, can
someone recommend a good textbook on the different map systems (and
conversion principles)?

------------------------------------------------------------------------

Source Code

Date: Mon, 07 Oct 96 07:30:48 -0700
From: Chuck Gantz (chuck.gantz@globalstar.loral.com)
To: karen.nakamura@Yale.edu
Newsgroups: sci.geo.satellite-nav, sci.geo.geology
Subject: Re: Lat/long to UTM?

This is my program to do that.

void toUTM(float Lat, float Long, float &Northing, float &Easting)
{
//converts lat/long to UTM coords. From USGS Bulletin 1532 using
//Clark 1866 ellipsoid.

        double a = 6378206.4;
        double eccSquared = 0.00676866;
        double k0 = 0.9996;

        double LongOrigin;
        double eccPrimeSquared;
        double N, T, C, A, M;

        if(Long == 0) LongOrigin = -3;//origin at 0 longitude is 3W
        else LongOrigin = int(Long/6)*6+3*int(Long/6)/abs(int(Long/6));

    eccPrimeSquared = (eccSquared)/(1-eccSquared);

        N = a/sqrt(1-eccSquared*sin(Lat*deg2rad)*sin(Lat*deg2rad));
        T = tan(Lat*deg2rad)*tan(Lat*deg2rad);
        C = eccPrimeSquared*cos(Lat*deg2rad)*cos(Lat*deg2rad);
        A = cos(Lat*deg2rad)*(Long-LongOrigin)*deg2rad;

        M = 111132.0894*Lat - 16216.94*sin(2*Lat*deg2rad)
                + 17.21*sin(4*Lat*deg2rad) - 0.02*sin(6*Lat*deg2rad);

        Easting = k0*N*(A+(1-T+C)*A*A*A/6
                                        +
(5-18*T+T*T+72*C-58*eccPrimeSquared)*A*A*A*A*A/120)
                                        + 500000.0;

        Northing =
k0*(M+N*tan(Lat*deg2rad)*(A*A/2+(5-T+9*C+4*C*C)*A*A*A*A/24
                                 +
(61-58*T+T*T+600*C-330*eccPrimeSquared)*A*A*A*A*A*A/720));

}

--
Jean Thioulouse - Laboratoire de Biometrie -  Universite Lyon 1
69622 Villeurbanne Cedex - France           Fax: 04 78 89 27 19
Tel: 04 72 43 29 01 http://pbil.univ-lyon1.fr/ADE-4/JTHome.html



This archive was generated by hypermail 2b30 : Sat Feb 10 2001 - 10:21:50 MET