Geodesy and Surveying (COGO)

 

| HOME |

The following are examples in geodesy and surveying.

The users are encouraged to explore all other available functions in "Ellipsoid" class, such as computation of geometric quantities of an ellipsoid, distances and directions on an ellipsoid, normal sections, direct problem, inverse problem, etc.

COGO functions are essentially in class "Pt2D".  Class "Pt3D" can perform some COGO but at a less extent.

Moreover, class "VecIdPt2D" and "VecPt3D" have functions to do coordinate transformation.  Mathematic models available are 2D conformal, 3Dconformal, affine, projective and 2nd degree polynomial.  Coordinates of one system can be kept fixed or both systems can be treated as observation.  Each single point can have its own standard deviation, or weight.  For non-linear mathematic model, 3Dconformal and projective, there is no need to input any approximation, for they are automatically determined inside the functions.  All coordinate transformation adjustments use Least Squares technique.

Class "VecIndx", "VecPt2D" and "VecPt3D" can be viewed as a different type of polylines.  In order to store and handle more than one polyline, class "VecRCpline", "VecXYpline" and "Vec3Dpline" are made possible to the user.

Examples of Traverse computation and Least Square Leveling Network Adjustment are written as external programs.  They can be found in section External User Defined Function and Program Repository.


| HOME | UP |

Space rectangular coordinate transformation

GPS nowadays measures coordinates on earth as space rectangular coordinate, based on a 3D x y z axes, origin at center of the earth.  This is a sort of conventional global system in which x-axis will point to Greenwich, the zero longitude, and the z axis will parallel to the rotation axis of the earth. 

To compute space rectangle coordinate, we use the following formulas.

X = (N + h) cos f cos l

Y = (N + h) cos f sin l

Z = (N (1-e2) + h) sin f

The class "Ellipsoid" Noobeed has functions to convert between geographic coordinate, latitude, longitude and height, and space rectangular coordinate back and forth.  For example a point having latitude 40 deg 30 min 15.276 sec, longitude -99 deg 20 min 30.256 sec, h = 20 meters, can be transform to space rectangular coordinate as follows.

->E = Ellipsoid()

->E.set("GRS80")

->pt = E.geo2xyz(deg(40.3015276), deg(-99.2030256), 20)

->print pt

 ( -788327.206 , -4792135.474 , 4120731.170)

Please note that "GRS80" is a name of pre-defined ellipsoid in Noobeed.  By using a pre-defined ellipsoid name, coorect parameters, a and f of an ellipsoid, will be assigned automatically to the ellipsoid object.  To see a list of pre-defined ellipsoid, use command "list ellipsoid".

To convert back to geographic coordinate, we do the following.

->pt1 = E.xyz2geo(pt.x(), pt.y(), pt.z())

->print pt1

 ( 40.504 , -99.342 , 20.000)

->dms(pt1.x(), 5)

 ans = 40 30 15.27600
 

 


| HOME | UP |

Topocentric coordinate transformation

On the other hand, surveying local coordinate system is often established on the earth surface for a purpose of data collection using terrestrial equipments such as theodolites.  Such a system is called Topcentric coordinate system, as oppose to Geocentric coordinate system (Space rectangular System).  Sometimes, Topocentric system is referred as Local coordinate system.  The origin of a topocentric system is at a point on surface of the earth, with its x-axis point to to the East direction and the y-axis point to the North.  The z-axis is pointing up perpendicular to the xy plane, having z coordinates analogous to heights.  Therefore topocentric coordinates are often expressed by ENH (East North Height), analogous to x y and z coordinate.

The reader might come across some literatures which describe a topocentric system as a left-hand system, NEH, rather than ENH.  However, in Noobeed the convention coordinate order of topocentric system is ENH, and it is a right-hand system.

Many situations may arise and require coordinate transformation between the two systems.  An  example is to compute a geographic coordinate, latitude and longitude, from a topocentric coordinate, ENH.  This requires transformation from ENH to XYZ then from XYZ to geographic coordinate.  

Another example is related to earth curvature distortion in Photogrammetry, where conventional ground control coordinates, easting and Northing from map projection and height from mean sea level, are not real 3D cartesian coordinates, since the z-axis does not perpendicular to xy plane all the time, but rather follows direction of gravity on earth surface.  This is not a kind of desired coordinate system used in collinearity condition in Photogrammetry, thus results in compensation for earth curvature distortion.  Earth curvature correction is not accurate, due to all formulas are just an approximation.   However, if the topocentric coordinate system can be used as an intermediate coordinate system, there will be no earth curvature effect.  This requires space coordinate transformation back and forth between Space Rectangular and Topocentric coordinates. 

The following demonstration follows the previous example.

 

->phe_0 = 40

->ram_0 = -99

->h_0 = 0

->pt2 = E.xyz2enh(pt.x(), pt.y(), pt.z(), phe_0, ram_0, h_0)

->print pt2

 ( -28966.441 , 56045.899 , -292.557)


 

The function "enh2xyz" can be used to convert local coordinates to space rectangular coordinates.

 


| HOME | UP |

Coordinate transformation between different datums and different ellipsoid

There are more than 150 predefined geodetic datums available in Noobeed,  as well as more 15 predefined ellipsoids.  In fact an ellispoid is a part of a definition of datum.  Users can set an ellipsoid to one of the predefined ellipsoid by using the function "set".  Or users can set an ellipsoid to a particular datum by using the function "setdatum".  A datum comes with three shifts of its origins in x y and z direction from the center of the earth.  To simplify the story, the three shifts, Cx, Cy, Cz of an ellipsoid is enable coordinate transformation between the space rectangular coordinate in that particular datum to WGS84 datum.  Hence WGS84 is consider a geocentric system, where its origin is at center of the earth.

Cx = X(WGS84) - X(other)
Cy = Y(WGS84) - Y(other)
Cz = Z(WGS84) - Z(other)

 

or

X(other) = X(WGS84) - Cx

and so on

 

It should be mention that the user is freely allowed to set to an ellipsoid object any parameter as he wishes, using "l-function".  The predefined datums and ellipsoids are so provided for a convenience purpose.  To set an ellipsoid object, we do the following:

->E = Ellipsoid()

->E.set("GRS80")

or

->E = Ellipsoid()

->E.setdatum("INDIAN75")

 

Now the following example is to show how to convert a geographic coordinate from one datum to another.  Please note that Noobeed does not provide class function for this because it is quite simple to make an external user-defined function.

For example a point in "NAD27_MEXICO" datum having latitude 40 deg 30 min 15.276 sec, longitude -99 deg 20 min 30.256 sec, h = 20 meters, can be transform to "NAD83_MEXICO" datum as folows.

->E1 = Ellipsoid()
->E1.setdatum("NAD27_MEXICO")
->E2 = Ellipsoid()
->E2.setdatum("NAD83_MEXICO")
->cx1 = E1.cx()
->cy1 = E1.cy()
->cz1 = E1.cz()
->cx2 = E2.cx()
->cy2 = E2.cy()
->cz2 = E2.cz()
->pt = E1.geo2xyz(deg(40.3015276), deg(-99.2030256), 20)
->pt.x() = pt.x() + cx1 - cx2
->pt.y() = pt.y() + cy1 - cy2
->pt.z() = pt.z() + cz1 - cz2
->pt2 = E2.xyz2geo(pt.x(), pt.y(), pt.z())
->print pt2
( 40.504 , -99.342 , 16.582)
->dms(pt2.x(),5)

  ans = 40 30 15.00540

->dms(pt2.y(),5)

  ans = -99 20 31.65513
 

It is worthwhile to know that a "Projection" object has an "Ellipsoid" object as one of its member data.  Therefore, a projection object can handle both map projection coordinate transformation and datum change in one go.  Please look at those functions like "tranxy2xy" "tranxy2geo" etc. in "Projection" class.

 

The following are lists of predefined ellipsoids and predefined datums that are available from Noobeed.  Two global function can be used to get a list of them, namely "list ellipsoid" and "list datum".  Also "list" and "flist" can be used interchangeably.  Another way to get a list is from the class function, of ellipsoid, "list" and "listdatum". 


| HOME | UP |

List of predefined Ellipsoids

Ellipsoid

name : AIRY
semi-major axis (a) : 6377563.39600
1/flattening (1/f) : 299.3249646000

 

Ellipsoid

name : AUSTRALIAN_NATIONAL
semi-major axis (a) : 6378160.00000
1/flattening (1/f) : 298.2500000000

 

Ellipsoid

name : BESSEL
semi-major axis (a) : 6377397.15500
1/flattening (1/f) : 299.1528128000

 

Ellipsoid

name : BESSEL_NAMBIA
semi-major axis (a) : 6377483.86500
1/flattening (1/f) : 299.1528128000

 

Ellipsoid

name : CLARKE66
semi-major axis (a) : 6378206.40000
1/flattening (1/f) : 294.9786982000

 

Ellipsoid

name : CLARKE80
semi-major axis (a) : 6378249.14500
1/flattening (1/f) : 293.4650000000

 

Ellipsoid

name : EVEREST
semi-major axis (a) : 6377276.34500
1/flattening (1/f) : 300.8017000000

 

Ellipsoid

name : EVEREST_1948
semi-major axis (a) : 6377304.06300
1/flattening (1/f) : 300.8017000000

 

Ellipsoid

name : EVEREST_1956
semi-major axis (a) : 6377301.24300
1/flattening (1/f) : 300.8017000000

 

Ellipsoid

name : EVEREST_1969
semi-major axis (a) : 6377295.66400
1/flattening (1/f) : 300.8017000000

 

Ellipsoid

name : EVEREST_SABAH
semi-major axis (a) : 6377298.55600
1/flattening (1/f) : 300.8017000000

 

Ellipsoid

name : FISCHER_1960
semi-major axis (a) : 6378166.00000
1/flattening (1/f) : 298.3000000000

 

Ellipsoid

name : FISCHER_1968
semi-major axis (a) : 6378150.00000
1/flattening (1/f) : 298.3000000000

 

Ellipsoid

name : GRS67
semi-major axis (a) : 6378160.00000
1/flattening (1/f) : 298.2471674270

 

Ellipsoid

name : GRS75
semi-major axis (a) : 6378140.00000
1/flattening (1/f) : 298.2570000000

 

Ellipsoid

name : GRS80
semi-major axis (a) : 6378137.00000
1/flattening (1/f) : 298.2572221010

 

Ellipsoid

name : HELMERT
semi-major axis (a) : 6378200.00000
1/flattening (1/f) : 298.3000000000

 

Ellipsoid

name : HOUGH
semi-major axis (a) : 6378270.00000
1/flattening (1/f) : 297.0000000000

 

Ellipsoid

name : INDONESIAN_1974
semi-major axis (a) : 6378160.00000
1/flattening (1/f) : 298.2470000000

 

Ellipsoid

name : INTERNATIONAL
semi-major axis (a) : 6378388.00000
1/flattening (1/f) : 297.0000000000

 

Ellipsoid

name : KRASSOVSKY_1940
semi-major axis (a) : 6378245.00000
1/flattening (1/f) : 298.3000000000

 

Ellipsoid

name : MODIFIED_AIRY
semi-major axis (a) : 6377340.18900
1/flattening (1/f) : 299.3249646000

 

Ellipsoid

name : MODIFIED_FISCHER
semi-major axis (a) : 6378155.00000
1/flattening (1/f) : 298.3000000000

 

Ellipsoid

name : SOUTH_AMERICAN_1969
semi-major axis (a) : 6378160.00000
1/flattening (1/f) : 298.2500000000

 

Ellipsoid

name : WGS60
semi-major axis (a) : 6378165.00000
1/flattening (1/f) : 298.3000000000

 

Ellipsoid

name : WGS66
semi-major axis (a) : 6378145.00000
1/flattening (1/f) : 298.2500000000

 

Ellipsoid

name : WGS72
semi-major axis (a) : 6378135.00000
1/flattening (1/f) : 298.2600000000

 

Ellipsoid

name : WGS84
semi-major axis (a) : 6378137.00000
1/flattening (1/f) : 298.2572235630
 

 


| HOME | UP |

COGO (Coordinate Geometry)

We are going to explore some of the COGO functions in class "Pt2D".

Start at point P1, having a coordinate of x = 100, y = 100, point P2 is calculated as follows.

->P1 = Pt2D(100,100)
->P2 = P1.traverse(deg(45.2230), 50.284)

P3 is offset from P1 to the right, we can try function "chainoff", setting point by chainage-offset.

->P3 = P1.chainoff(deg(45.2230),0,6)

P4, P5 and P6 are determined by function "traverse".

->P4 = P3.traverse(deg(45.2230), 30.556)
->P5 = P4.traverse(P4.azi(P3)+deg(225.0230), 38.453)
->P6 = P5.traverse(P5.azi(P4)-90, 45.786)

Please note the sign of angle, positive angle means an angle measured to the right (clockwise), while negative angle means an angle measured to the left (counter clockwise).

P7 is determined by distance intersection from points P6 and P3.

->P7 = P3.distintdist(24.009, P6, 47.586, 0)

Again points P8, P9 and P10 are calculated by function "traverse".

->P8 = P7.traverse(P4.azi(P5), 28.000)
->P9 = P8.traverse(P8.azi(P7) + 90, 12.000)
->P10 = P9.traverse(P8.azi(P7), 28.000)

Please note that class IdPt2D can also be used to perform COGO functions, since one of its member data is a Pt2D object.  Points can be stored in either "VecPt2D" or "VecIdPt2D", depending on what type of coordinate objects being used.

Details on other COGO functions can be found in class "Pt2D".


| HOME |