Bookmark this page: Add Conversion between ECEF to local Geodetics datum to Yahoo MyWeb Add Conversion between ECEF to local Geodetics datum to Google Bookmarks Add Conversion between ECEF to local Geodetics datum to Windows Live Add Conversion between ECEF to local Geodetics datum to Del.icio.us Digg Conversion between ECEF to local Geodetics datum! Add Conversion between ECEF to local Geodetics datum to Netscape
  •  
  • Subject
  • Author
  • Date
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by Johnson L on April 21, 2009, 11:05 pm


Could anybody please provide me a link or material to convert from ECEF to
local Geodetics datum (like East-North-Sky)? Better with plots. Any other
paper about datum conversion are also welcome.

Thank you!



Posted by David L. Wilson on April 21, 2009, 11:19 pm



> Could anybody please provide me a link or material to convert from ECEF to
> local Geodetics datum (like East-North-Sky)? Better with plots. Any other
> paper about datum conversion are also welcome.
> Thank you!

You might want to look at
http://www.ngs.noaa.gov/PC_PROD/XYZWIN/



Posted by KBH on April 22, 2009, 2:06 am



Johnson L wrote:

> Could anybody please provide me a link or material to convert from ECEF to
> local Geodetics datum (like East-North-Sky)? Better with plots. Any other
> paper about datum conversion are also welcome. Thank you!


KBH wrote:

Here is some KBH code...just straight out of my files...for Delphi console
mode. And so the code will convert ECEF XYZ coordinates in meters to
latitude and longitude. Then the latitude and longitude can be
converted...with other programs...to UTM or to State Plane or to Local
Topocentric. (And I might have some Local Topocentric code but I don't post
my UTM code.)


Var
a: string;

Procedure Latlon;
Var
ra, lat, lon, x, y, z: double;
a, ee, v, h: double;
nr, ea, ht: double;
Begin
{KBH Code}
ra:= 180 / Pi;
a:= 6378137;
ee:= 0.006694379990;
WriteLn;
Write(' Input latitude in degrees: ');
ReadLn(lat);
Write(' Input longitude in degrees: ');
ReadLn(lon);
Write(' Input ellipsoidal height in meters: ');
ReadLn(h);
lat:= lat / ra;
lon:= lon / ra;
v:= a / Sqrt(1 - (ee * Sqr(Sin(lat))));
x:= (v + h) * Cos(lat) * Cos(lon);
y:= (v + h) * Cos(lat) * Sin(lon);
z:= ((1 - ee) * v + h) * Sin(lat);
WriteLn;
WriteLn(' x coordinate y coordinate z coordinate');
WriteLn;
WriteLn(x:18:3, y:18:3, z:18:3);
WriteLn;
{xyz to topocentric:}
{lat:= 45 / ra;
lon:= 0 / ra;}
lat:= 0;
lon:= 0;
nr:= (-x * Sin(lat) * Cos(lon)) + (-y * Sin(lat) * Sin(lon)) + (z *
Cos(lat));
ea:= (-x * Sin(lon)) + (y * Cos(lon));
ht:= (x * Cos(lat) * Cos(lon)) + (y * Cos(lat) * Sin(lon)) + (z * Sin(lat));
WriteLn(nr:18:3, ea:18:3, ht:18:3);
WriteLn;
End;

Procedure Xyzs;
Var
r, ra, lat, lon, x, y, z: double;
a, ee, f, p, u, la, lt, ha, hb, h, fm: double;
Begin
{KBH Code}
ra:= 180 / Pi;
a:= 6378137;
f:= 0.003352811;
fm:= 1 - f;
ee:= 0.006694379990;
WriteLn;
Write(' Input x coordinate in meters: ');
ReadLn(x);
Write(' Input y coordinate in meters: ');
ReadLn(y);
Write(' Input z coordinate in meters: ');
ReadLn(z);
If (x = 0) Then x:= 0.0001;
{If (x > a) Or (y > a) Then Exit;
If (x < -a) Or (y < -a) Then Exit;}
p:= Sqrt(Sqr(x) + Sqr(y));
r:= Sqrt(Sqr(p) + Sqr(z));
u:= z / p * (fm + (ee * a / r));
u:= ArcTan(u);
lon:= ArcTan(y / x);
la:= (z * fm) + (ee * a * Sin(u) * Sqr(Sin(u)));
lt:= fm * (p - (ee * a * Cos(u) * Sqr(Cos(u))));
lat:= ArcTan(la / lt);
ha:= p * Cos(lat) + (z * Sin(lat));
hb:= a * Sqrt(1 - (ee * Sqr(Sin(lat))));
h:= ha - hb;
lon:= lon * ra;
lat:= lat * ra;
If (x < 0) Then lon:= 180 + lon;
If (lon > 180) Then lon:= lon - 360;
WriteLn;
WriteLn(' Latitude Longitude');
WriteLn;
WriteLn(lat:18:6, lon:18:6, h:18:3);
WriteLn;
End;

Begin
{KBH Code}
WriteLn;
a:= 'lat';
While (a = 'lat') Or (a = 'xyz') Do
Begin
Write(' Enter "lat" for lat/lon to xyz or enter "xyz" for xyz to lat/lon:
');
ReadLn(a);
If (a <> 'lat') And (a <> 'xyz') Then
Begin
WriteLn;
WriteLn(' Program end: Hit [Enter]');
End;
If (a = 'lat') Then Latlon;
If (a = 'xyz') Then Xyzs;
End;
ReadLn;
End.


And those are ellipsoidal conversions...



Posted by KBH on April 22, 2009, 2:36 am


I did a google search for my Local Topocentric code and found it at
sci.tech-archive.net:

{Latitude and longitude to ECEF xyz}
{KBH Code}
ra:= 180 / Pi;
a:= 6378137;
ee:= 0.006694379990;
Write(' Input latitude in degrees: ');
ReadLn(lat);
Write(' Input longitude in degrees: ');
ReadLn(lon);
Write(' Input ellipsoidal height in meters: ');
ReadLn(h);
lat:= lat / ra;
lon:= lon / ra;
v:= a / Sqrt(1 - (ee * Sqr(Sin(lat))));
x:= (v + h) * Cos(lat) * Cos(lon);
y:= (v + h) * Cos(lat) * Sin(lon);
z:= ((1 - ee) * v + h) * Sin(lat);


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


{ECEF xyz to local topocentric}
{KBH Code}
nr:= (-x * Sin(lat) * Cos(lon)) + (-y * Sin(lat) * Sin(lon)) + (z *
Cos(lat));
ea:= (-x * Sin(lon)) + (y * Cos(lon));
ht:= (x * Cos(lat) * Cos(lon)) + (y * Cos(lat) * Sin(lon)) + (z * Sin(lat));


{Note the first input is the lat and lon of the first xyz point converted to
local topocentric and then that lat and lon is held in the computations for
all the next xyz input points going to the same local topocentric system}


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


{ECEF xyz to latitude and longitude}
{KBH Code}
ra:= 180 / Pi;
a:= 6378137;
f:= 0.003352811;
fm:= 1 - f;
ee:= 0.006694379990;
WriteLn;
Write(' Input x coordinate in meters: ');
ReadLn(x);
Write(' Input y coordinate in meters: ');
ReadLn(y);
Write(' Input z coordinate in meters: ');
ReadLn(z);
If (x = 0) Then x:= 0.0001;
{If (x > a) Or (y > a) Then Exit;
If (x < -a) Or (y < -a) Then Exit;}
p:= Sqrt(Sqr(x) + Sqr(y));
r:= Sqrt(Sqr(p) + Sqr(z));
u:= z / p * (fm + (ee * a / r));
u:= ArcTan(u);
lon:= ArcTan(y / x);
la:= (z * fm) + (ee * a * Sin(u) * Sqr(Sin(u)));
lt:= fm * (p - (ee * a * Cos(u) * Sqr(Cos(u))));
lat:= ArcTan(la / lt);
ha:= p * Cos(lat) + (z * Sin(lat));
hb:= a * Sqrt(1 - (ee * Sqr(Sin(lat))));
h:= ha - hb;
lon:= lon * ra;
lat:= lat * ra;
If (x < 0) Then lon:= 180 + lon;
If (lon > 180) Then lon:= lon - 360;


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




Posted by KBH on April 22, 2009, 2:55 am


>I did a google search for my Local Topocentric code and found it at
>sci.tech-archive.net:
> {Latitude and longitude to ECEF xyz}
> {KBH Code}
> ra:= 180 / Pi;
> a:= 6378137;
> ee:= 0.006694379990;
> Write(' Input latitude in degrees: ');
> ReadLn(lat);
> Write(' Input longitude in degrees: ');
> ReadLn(lon);
> Write(' Input ellipsoidal height in meters: ');
> ReadLn(h);
> lat:= lat / ra;
> lon:= lon / ra;
> v:= a / Sqrt(1 - (ee * Sqr(Sin(lat))));
> x:= (v + h) * Cos(lat) * Cos(lon);
> y:= (v + h) * Cos(lat) * Sin(lon);
> z:= ((1 - ee) * v + h) * Sin(lat);
> ----------------------------------------------------
> {ECEF xyz to local topocentric}
> {KBH Code}
> nr:= (-x * Sin(lat) * Cos(lon)) + (-y * Sin(lat) * Sin(lon)) + (z *
> Cos(lat));
> ea:= (-x * Sin(lon)) + (y * Cos(lon));
> ht:= (x * Cos(lat) * Cos(lon)) + (y * Cos(lat) * Sin(lon)) + (z *
> Sin(lat));
> {Note the first input is the lat and lon of the first xyz point converted
> to local topocentric and then that lat and lon is held in the computations
> for all the next xyz input points going to the same local topocentric
> system}
> -----------------------------------------------------
> {ECEF xyz to latitude and longitude}
> {KBH Code}
> ra:= 180 / Pi;
> a:= 6378137;
> f:= 0.003352811;
> fm:= 1 - f;
> ee:= 0.006694379990;
> WriteLn;
> Write(' Input x coordinate in meters: ');
> ReadLn(x);
> Write(' Input y coordinate in meters: ');
> ReadLn(y);
> Write(' Input z coordinate in meters: ');
> ReadLn(z);
> If (x = 0) Then x:= 0.0001;
> {If (x > a) Or (y > a) Then Exit;
> If (x < -a) Or (y < -a) Then Exit;}
> p:= Sqrt(Sqr(x) + Sqr(y));
> r:= Sqrt(Sqr(p) + Sqr(z));
> u:= z / p * (fm + (ee * a / r));
> u:= ArcTan(u);
> lon:= ArcTan(y / x);
> la:= (z * fm) + (ee * a * Sin(u) * Sqr(Sin(u)));
> lt:= fm * (p - (ee * a * Cos(u) * Sqr(Cos(u))));
> lat:= ArcTan(la / lt);
> ha:= p * Cos(lat) + (z * Sin(lat));
> hb:= a * Sqrt(1 - (ee * Sqr(Sin(lat))));
> h:= ha - hb;
> lon:= lon * ra;
> lat:= lat * ra;
> If (x < 0) Then lon:= 180 + lon;
> If (lon > 180) Then lon:= lon - 360;
> ------------------------------------------------------

Okay...I found a source that says that Topocentric Coordinates are often
called EHN (East North Height).