Skip to content

Commit ec56c42

Browse files
committed
Finished coord tut
1 parent 772793e commit ec56c42

File tree

13 files changed

+276
-12
lines changed

13 files changed

+276
-12
lines changed

docs/_static/favicon.ico

0 Bytes
Binary file not shown.

docs/tutorials/anglestut.rst

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,96 @@ Angle Classes and Converstions
55

66
GeodePy has 5 main angle classes to represent angles in different formats. These will be explored here along with how to convert between these types.
77

8-
Creating Angle Class
8+
The 5 classes are:
9+
10+
* :ref:`Degrees, Minutes and Second (dms) <tut/dms>`
11+
* :ref:`Degrees and Decimal Minutes (ddm) <tut/ddm>`
12+
* :ref:`Decimal Degrees (dec) <tut/dd>`
13+
* :ref:`HP notation (hpa) <tut/hp>`
14+
* :ref:`Gradians (gona) <tut/grad>`
15+
16+
Classes
17+
-------
18+
19+
.. _tut/dms:
20+
21+
Degrees, Minutes and Seconds (dms)
22+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
Angles expressed in degrees, minutes, and seconds.
24+
25+
- **Format:** ``ddd° mm' ss.s"``
26+
- **Conversion:** 1° = 60′, 1′ = 60″
27+
- **Example:** ``123° 34' 56.2"``
28+
29+
To initalise a dms class:
30+
31+
.. code:: python
32+
33+
angle1 = geodepy.angles.DMSAngle(d, m, s)
34+
35+
.. _tut/ddm:
36+
37+
Degrees and Decimal Minutes (ddm)
38+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39+
Angles expressed in degrees and minutes, with minutes shown as a decimal fraction.
40+
41+
- **Format:** ``ddd° mm.mm'``
42+
- **Example:** ``123° 34.933'``
43+
44+
To initalise a ddm class:
45+
46+
.. code:: python
47+
48+
angle1 = geodepy.angles.DDMAngle(d, dm)
49+
50+
.. _tut/dd:
51+
52+
Decimal Degrees (dec)
53+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
Angles expressed entirely in decimal degrees.
55+
56+
- **Format:** ``ddd.ddd°``
57+
- **Example:** ``123.5823°``
58+
59+
To initalise a dec class:
60+
61+
.. code:: python
62+
63+
angle1 = geodepy.angles.DECAngle(d)
64+
65+
.. _tut/hp:
66+
67+
HP Notation (hpa)
68+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69+
Hemispheric Positive notation expresses latitude and longitude as positive values with hemisphere indicators.
70+
71+
- **Format:** ``ddd.mmssss``
72+
- **Example:** ``123.231524°``
73+
74+
To initalise a hpa class:
75+
76+
.. code:: python
77+
78+
angle1 = geodepy.angles.HPAngle(hp)
79+
80+
.. _tut/grad:
81+
82+
Gradians (gona)
83+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84+
A metric-based angle unit where a full circle equals 400 gradians.
85+
86+
- **Format** ``ggg.ggg``
87+
- **Conversion:** 1 grad = 0.9°
88+
- **Example:** ``137.5``
89+
90+
To initalise a gona class:
91+
92+
.. code:: python
93+
94+
angle1 = geodepy.angles.GONAngle(gon)
95+
96+
97+
Using Angle Classes
998
--------------------
1099

11100
First import GeodePy
@@ -21,9 +110,21 @@ In this example a DMS angle will be created. This object can be initalised by in
21110
angle1 = angles.DMSAngle(30, 5, 42)
22111
print(angle1)
23112
24-
>> 30 5 42
113+
>>30 5 42
25114
26-
The methods within the class can be used to convert the angle into different types. This is seen below:
115+
Using this class we can get individual variables for degree minute and seconds componets seperately.
116+
117+
.. code:: python
118+
119+
print(angle1.degree)
120+
print(angle1.minute)
121+
print(angle1.second)
122+
123+
>>30
124+
>>5
125+
>>42
126+
127+
The methods within the class can also be used to convert the angle into different types. This is seen below:
27128

28129
.. code:: python
29130
@@ -95,5 +196,5 @@ The following operators can be preformed on angle objects:
95196
| Round | round() |
96197
+----------------------+------------------+
97198

98-
199+
.. caution:: Basic arthimitc should not be completed on HPA class. These should be converted on decimal degree first.
99200

docs/tutorials/convert.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/tutorials/coordtut.rst

Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,143 @@
11
.. _tutorials/coord:
22

33
Coordinate Classes and Conversions
4-
=============================================
4+
=============================================
5+
6+
GeodePy has 3 coordinate classes that can be used to store coordinates and convert between coordinate types.
7+
8+
The three different classes are:
9+
10+
- :ref:`CoordCart - Cartesian Corrdinates <tut/cart>`
11+
- :ref:`CoordGeo - Geographic Coordinates <tut/geo>`
12+
- :ref:`CoordTM - Transverse Mercator Coordinates <tut/tm>`
13+
14+
Classes
15+
--------
16+
17+
.. _tut/cart:
18+
19+
Cartesian Coordinates
20+
^^^^^^^^^^^^^^^^^^^^^^
21+
Cartesian coordinates represent points in three dimensions (X, Y, Z), typically in an Earth-Centered, Earth-Fixed (ECEF) system.
22+
In this class an n value can also be added representing seperation between ellipsoid and geiod.
23+
24+
- **Description:** Defines a point by its distance along three perpendicular axes.
25+
- **Format:** ``(X, Y, Z)`` in meters.
26+
- **Example:** ``( -4052051.0, 4212831.0, -2545100.0 )``
27+
28+
To initalise a cartesian coordinate class:
29+
30+
.. code:: python
31+
32+
coord1 = geodepy.coord.CoordCart(x, y, z, n=None)
33+
34+
.. _tut/geo:
35+
36+
Geographic Coordinates
37+
^^^^^^^^^^^^^^^^^^^^^^
38+
Geographic coordinates express positions on the Earth's surface using latitude, longitude, and optionally height.
39+
40+
- **Description:** Latitude and longitude define angular position relative to the equator and prime meridian.
41+
- **Format:** ``(latitude, longitude, height)``
42+
- **Example:** ``(-33.8650°, 151.2094°, 58)``
43+
44+
To initalise a geographic coordinate class:
45+
46+
.. code:: python
47+
48+
coord1 = geodepy.coord.CoordGeo(lat, long, ell_ht=None)
49+
50+
.. _tut/tm:
51+
52+
Transverse Mercator Coordinates
53+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
A projected coordinate system that maps the curved Earth onto a flat plane using the Transverse Mercator projection.
55+
56+
- **Description:** Represents positions as Easting and Northing values in meters.
57+
- **Format:** ``(Zone, Easting, Northing, Height)``
58+
- **Example:** ``(55, 334567.89, 6254321.12, 58.2)``
59+
60+
To initalise a transverse mercator coordinate class:
61+
62+
.. code:: python
63+
64+
coord1 = geodepy.coord.CoordTM(zone, east, north, ell_ht=None)
65+
66+
Converting Between Classes
67+
--------------------------
68+
69+
First import GeodePy
70+
71+
.. code:: python
72+
73+
import geodepy.coord
74+
import geodepy.geodesy
75+
76+
We can now create a coordinate obect. For this example we will use a transverse mercator coordinate.
77+
78+
.. code:: python
79+
80+
coord1 = geodepy.coord.CoordTM(55, 696053.337, 6086610.13)
81+
print(coord1)
82+
83+
>>CoordTM: Zone: 55 East: 696053.337 North: 6086610.13 Ell_Ht: None Orth_Ht: None Hemisphere: South
84+
85+
This object can now be transformed into the other classes using the inbuilt methods.
86+
87+
.. code:: python
88+
89+
print(coord1.cart())
90+
print(coord1.geo())
91+
92+
>>CoordCart: X: -4471828.926838844 Y: 2670252.9985762094 Z: -3669113.8962611817 NVal: None
93+
>>CoordGeo: Lat: -35.3445551951 Lon: 149.15740394128 Ell_Ht: None Orth_Ht: None
94+
95+
Individual variables from a coordinate class can be used within different functions.
96+
97+
.. code:: python
98+
99+
coord1Geo = coord1.geo()
100+
print(geodepy.geodesy.rho(coord1Geo.lat)) # to calculate radius of curvature of ellipsoid
101+
102+
>>6356788.983764104
103+
104+
Using Convert Functions
105+
-----------------------
106+
107+
Instead of using classes, function can also be used to convert between coordinate types. The two main conversions function are:
108+
109+
- geo2grid - Converts from geographic (lat, long, h) to grid (E, N, u)
110+
- xyz2llh - Converts from cartesian (x, y, z) to geographic (lat, long, h)
111+
112+
Both of these functions can be reversed to convert the other way.
113+
114+
To convert using function first geodepy needs to be imported
115+
116+
.. code:: python
117+
118+
import geodepy.geodesy
119+
import geodepy.convert
120+
121+
Now either of the functions can be used
122+
123+
.. code:: python
124+
125+
coordGeo = geodepy.convert.grid2geo(55, 696053.337, 6086610.13)
126+
print(coordGeo)
127+
128+
>>(-35.34455523, 149.15740394, 1.0000737, 1.2484390010290551)
129+
130+
coordllh = geodepy.convert.xyz2llh(-4471828.926838844, 2670252.9985762094, -3669113.8962611817)
131+
print(coordllh)
132+
133+
>>(-35.34455523, 149.15740394, 0)
134+
135+
These function can be used together to convert between grid and cartesian.
136+
137+
.. code:: python
138+
139+
coordGeo = geodepy.convert.grid2geo(55, 696053.337, 6086610.13)
140+
coordCart = geodepy.convert.llh2xyz(coordGeo[0],coordGeo[1])
141+
print(coordCart)
142+
143+
>>(-4471828.924896575, 2670252.9973158445, -3669113.8995236363)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. _tutorials/edm:
2+
3+
EDM Corrections
4+
================

docs/tutorials/errortut.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. _tutorials/errors:
2+
3+
Errors
4+
=======

docs/tutorials/index.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Tutorials
88

99
anglestut
1010
coordtut
11-
vincenty
12-
convert
13-
transform
11+
edmcorrectiontut
12+
errortut
13+
sinextut
14+
transformtut
15+
timedeptranstut
16+
verticaldatumtut
17+
vincentytut

docs/tutorials/sinextut.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. _tutorials/sinex:
2+
3+
Sinex Files
4+
============

docs/tutorials/timedeptranstut.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. _tutorials/timetrans:
2+
3+
Time Dependant Transformations
4+
==============================

docs/tutorials/transform.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)