Welcome to OCTAVE Mapping Package’s documentation!¶
This package implements simple mapping functions.
Mapping Functions:
Azimuth¶
Calculates the great circle azimuth from a point 1 to a point 2.
The latitude and longitude of these two points can either be given independently
or as columns of the matrices point 1 and point 2 in the form [latitude longitude]
.
Forms¶
-
az = azimuth(lat1, lon1, lat2, lon2)
-
az = azimuth(lat1, lon1, lat2, lon2, units)
-
az = azimuth(pt1, pt2)
-
az = azimuth(pt1, pt2, units)
Note
The units for the input coordinates and output angles can be degrees (the default) or radians.
Reckon¶
Compute the coordinates of the end-point of a displacement on a sphere. lat e lon are the coordinates of the starting point, range is the covered distance of the displacements along a great circle and azimuth is the direction of the displacement relative to the North.
This function can also be used to define a spherical coordinate system with rotated poles.
Forms¶
-
[lato, lono] = reckon(lat, lon, range, azimuth)
-
[lato, lono] = reckon(lat, lon, range, azimuth, units)
Note
The units of all input and output parameters can be either degrees (default) or radians.
Distance¶
Calculates the distance (in degrees) between point 1 and point 2.
Forms¶
-
dist = distance(pt1, pt2)
Note
pt1
and pt2
are two-column matrices of the form [latitude longitude]
.
Departure¶
Calculates the distance in degrees between longitudes lon1
and lon2
at
latitude defined by lat
.
Forms¶
-
dist = departure(lon1, lon2, lat)
Vincenty¶
Calculates the distance (in kilometers) between point 1 and point 2 using the formula devised by Thaddeus Vincenty, with an accurate ellipsoidal model of the earth. The default ellipsoidal model is WGS-84, which is the most globally accurate model.
Forms¶
-
dist = vincenty(pt1, pt2)
-
dist = vincenty(pt1, pt2, ellipsoid)
-
[dist, az] = vincenty(pt1, pt2)
-
[dist, az] = vincenty(pt1, pt2, ellipsoid)
Note
pt1
and pt2
are two-column matrices of the form [latitude longitude]
.
The units for the input coordinates angles must be degrees.
ellipsoid
defines the reference ellipsoid to use.
Sample values for ellipsoid
are the following:
- WGS_84 (default) - referenceEllipsoid(7030)
- GRS_80 - referenceEllipsoid(7019)
- Airy - referenceEllipsoid(7001)
- Intl - referenceEllipsoid(7022)
- Clarke - referenceEllipsoid(7012)
- GRS - referenceEllipsoid(7003)
The sample values are the following:
Model | Major (km) | Minor (km) | 1 / f |
---|---|---|---|
WGS 1984 | 6378.137 | 6356.7523142 | 298.257223563 |
GRS 1980 | 6378.137 | 6356.7523141 | 298.257222101 |
G.B. Airy 1830 | 6377.563396 | 6356.256909 | 299.3249646 |
Internacional 1924 | 6378.388 | 6356.911946 | 297.0 |
Clarke 1880 | 6378.249145 | 6356.51486955 | 293.465 |
Australian Nat. | 6378.1600 | 6356.774719 | 298.25 |
Examples¶
Usages:
>> vincenty([37, -76], [37, -9])
ans = 5830.081
>> vincenty([37, -76], [67, -76], referenceEllipsoid(7019))
ans = 3337.843
See also
Vincenty (Direct Form)¶
Compute the coordinates of the end-point of a displacement on a geodesic.
The parameters lat
and lon
are the coordinates of the starting point,
The parameter range
is the covered distance of the displacements along a
specified geodesic and azi
is the direction of the displacement relative
to the North.
Forms¶
-
[lato, lono] = vincentyDirect(lat, lon, range, azi)
-
[lato, lono, azo] = vincentyDirect(lat, lon, range, azi)
-
[lato, lono] = vincentyDirect(lat, lon, range, azi, dim)
-
[lato, lono, azo] = vincentyDirect(lat, lon, range, azi, dim)
-
[lato, lono] = vincentyDirect(lat, lon, range, azi}, dim, ellipsoid)
-
[lato, lono, azo] = vincentyDirect(lat, lon, range, azi, dim, ellipsoid)
Note
The units of all input and output parameters must be ‘radians’ and/or ‘kilometers’.
dim
defines the range dimension to use.
ellipsoid
defines the reference ellipsoid to use.
The possible values for dim
are ‘angle’ (default) or ‘length’.
Sample values for ellipsoid
are the following:
- WGS_84 (default) - referenceEllipsoid(7030)
- GRS_80 - referenceEllipsoid(7019)
- Airy - referenceEllipsoid(7001)
- Intl - referenceEllipsoid(7022)
- Clarke - referenceEllipsoid(7012)
- GRS - referenceEllipsoid(7003)
The sample values are the following:
Model | Major (km) | Minor (km) | 1 / f |
---|---|---|---|
WGS 1984 | 6378.137 | 6356.7523142 | 298.257223563 |
GRS 1980 | 6378.137 | 6356.7523141 | 298.257222101 |
G.B. Airy 1830 | 6377.563396 | 6356.256909 | 299.3249646 |
Internacional 1924 | 6378.388 | 6356.911946 | 297.0 |
Clarke 1880 | 6378.249145 | 6356.51486955 | 293.465 |
Australian Nat. | 6378.1600 | 6356.774719 | 298.25 |
Examples¶
Usages:
>> [lat, lon] = vincentyDirect(0, 0, pi, pi / 2)
lat = 0
lon = 3.1311
>> [lat, lon, az] = vincentyDirect(0, 0, pi, pi / 2)
lat = 0
lon = 3.1311
az = 1.5708
See also
Great-Circle to Small-Circle¶
Converts a great circle to small circle notation.
Forms¶
-
[lato, lono, range] = gc2sc(lat, lon, azi)
-
[lato, lono] = gc2sc(lat, lon, azi, units)
-
mat = gc2sc(lat, lon, azi)
-
mat = gc2sc(lat, lon, azi, units)
Degree to Kilometer¶
Convert a distance along a great circle of the Earth from degrees to kilometer. Great-circle distance uses a spherical model of the earth, using the average great-circle radius of 6372.795 kilometers, resulting in an error of up to about 0.5%.
Kilometer to Degree¶
Convert a distance along a great circle of the Earth from kilometer to degrees. A radius Great-circle distance uses a spherical model of the earth, using the average great-circle radius of 6372.795 kilometers, resulting in an error of up to about 0.5%.
Degree to Radians¶
Converts angles input in degrees to the equivalent in radians.
Radians to Degree¶
Converts angles input in radians to the equivalent in degrees.
Geocode¶
Geolocation service from Google Maps API. Define a geocode method for resolving a location from a string.
Geocoding is the process of converting addresses (like “1600 Amphitheatre Parkway, Mountain View, CA”) into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map.
Reverse geocoding is the process of converting geographic coordinates into a human-readable address.
Reverse¶
Geolocation service from Google Maps API. Define a geocode method for resolving a address from a location.
The term geocoding generally refers to translating a human-readable address into a location on a map. The process of doing the converse, translating a location on the map into a human-readable address, is known as reverse geocoding.
nPI to PI¶
This brings the angin
into the \([-pi pi]\) interval.
ZERO to 2PI¶
This brings the angin
into the \([0 2*pi[\) interval.
Reference Ellipsoid¶
This function returns a reference ellipsoid object corresponding to the
specified code
(numerical EPSG). The values of the SemimajorAxis
and SemiminorAxis
properties are in kilometers. The reference
ellipsoid has five properties: Code
, Name
, SemimajorAxis
, SemiminorAxis
and Flattening
.
The form code can receive a valid EPSG code. 46 codes are currently implemented between 7001 and 7053 (except for 7017, 7023, 7026 and 7037-7040).
The valid values for name form are as follows: sphere, unitsphere, earth, moon, mercury, venus, mars, jupiter, saturn, uranus, neptune and pluto.