Module epsglide
This package aims to perform simple requests to EPSG GeoRepository API
and provides associated geodesic
computation and map projection.
distance
def distance(obj: dataset.Ellipsoid, start: Geodetic,
stop: Geodetic) -> Vincenty_dist
Calculate the distance between two points on the ellipsoid surface.
Arguments:
obj
dataset.Ellipsoid - The ellipsoid object representing the shape of the Earth.start
Geodetic - The starting point.stop
Geodetic - The destination point.
Returns:
Vincenty_dist
- The distance between the two points.
destination
def destination(obj: dataset.Ellipsoid, start: Geodetic,
dist: Vincenty_dist) -> Vincenty_dest
Calculate the destination point given start point, initial bearing, and distance.
Arguments:
obj
dataset.Ellipsoid - The ellipsoid object representing the shape of the Earth.start
Geodetic - The starting point.dist
Vincenty_dist - The distance to travel.
Returns:
Vincenty_dest
- The destination point.
to_crs
def to_crs(obj: dataset.GeodeticCoordRefSystem,
crs: dataset.GeodeticCoordRefSystem, lla: Geodetic) -> Geodetic
Convert coordinates from one geodetic coordinate reference system to another.
Arguments:
obj
dataset.GeodeticCoordRefSystem - The source coordinate reference system.crs
dataset.GeodeticCoordRefSystem - The target coordinate reference system.lla
Geodetic - The coordinates to convert.
Returns:
Geodetic
- The converted coordinates.
to_wgs84
def to_wgs84(obj: dataset.GeodeticCoordRefSystem, lla: Geodetic) -> Geodetic
Convert coordinates from a geodetic coordinate reference system to WGS84.
Arguments:
obj
dataset.GeodeticCoordRefSystem - The source coordinate reference system.lla
Geodetic - The coordinates to convert.
Returns:
Geodetic
- The converted coordinates in WGS84.
ProjectedCoordRefSystem Objects
class ProjectedCoordRefSystem(dataset.EpsgElement)
Coordinate reference system object allowing projection of geodetic coordinates to flat map (geographic coordinates).
>>> import epsglide
>>> osgb36 = epsglide.ProjectedCoordRefSystem(27700)
>>> london = epsglide.Geodetic(-0.127005, 51.518602, 0.) # use degrees
>>> osgb36(london)
<metre:1.000[X=529939.106 Y=181680.962] alt=0.000>
>>> osgb36.Projection
{'Code': 19916, 'Name': 'British National Grid', 'href': 'https://apps.epsg.org/api/v1/Conversion/19916'}
Attributes:
GeodeticCoordRefSystem
dataset.GeodeticCoordRefSystem - geodetic reference system.Conversion
dataset.Conversion - projection method and parameters.CoordOperationMethod
dataset.CoordOperationMethod - projection description.CoordSystem
dataset.CoordSystem - 2D coordinate system and units.parameters
list - list ofdataset.CoordOperationParameter
.
ProjectedCoordRefSystem.__call__
def __call__(
element: typing.Union[Geodetic, Geographic]
) -> typing.Union[Geodetic, Geographic]
ProjectedCoordRefSystem.transform
def transform(element: typing.Union[Geodetic, Geographic],
dest_crs) -> Geographic