Position and coordinate computations#

Implementations for computations on coordinates.

This module holds all the implementations and wrappers to handle coordinate computations in this package.

A few of the most useful classes are lifted to the main package namespace. They should be accessed from there when used externally, but from here when used internally.

uwacan.Position(*args[, latitude, longitude])

Class for single positions.

uwacan.Track(data[, calculate_course, ...])

A class representing a GPS track, which is a sequence of coordinates over time.

uwacan.sensor(sensor, /[, sensitivity, ...])

Collect sensor information.

Other coordinate wrappers#

Coordinates([coordinates, latitude, longitude])

Container for latitude and longitude.

Positions([coordinates, latitude, longitude])

Container for arrays of coordinates.

Line([coordinates, latitude, longitude])

A simple line of coordinates.

BoundingBox(west, south, east, north)

Representation of a bounding box.

Sensor(data[, attrs])

Container for sensor information.

SensorPosition(*args[, latitude, longitude])

Container for sensor information, including position.

SensorArray(data[, attrs])

Container for sensor information.

SensorArrayPosition(data)

Container for sensor information, with a single position for all.

SensorArrayPositions(data)

Container for sensor information, including positions.

Unit conversions#

nm_to_m(nm)

Convert nautical miles to meters.

m_to_nm(m)

Convert meters to nautical miles.

mps_to_knots(mps)

Convert meters per second to knots.

knots_to_kmph(knots)

Convert knots to kilometers per hour.

kmph_to_knots(kmph)

Convert kilometers per hour to knots.

wrap_angle(degrees)

Wrap an angle to (-180, 180].

wgs84_to_utm(latitude, longitude[, utm_zone])

Convert WGS84 latitude and longitude to UTM coordinates.

utm_to_wgs84(easting, northing, utm_zone[, ...])

Convert UTM coordinates to WGS84 coordinates.

wgs84_to_local_transverse_mercator(latitude, ...)

Convert WGS84 coordinates into a local transverse mercator projection.

local_transverse_mercator_to_wgs84(easting, ...)

Convert local transverse mercator coordinates into WGS84.

wgs84_to_sweref99(latitude, longitude)

Convert WGS84 coordinates to Sweref99.

sweref99_to_wgs84(easting, northing)

Convert Sweref99 coordinates to WGS84.

Geodesic computations#

distance_to(lat_1, lon_1, lat_2, lon_2)

Calculate the distance between two coordinates.

bearing_to(lat_1, lon_1, lat_2, lon_2)

Calculate the heading from one coordinate to another.

shift_position(lat, lon, distance, bearing)

Shifts a position given by latitude and longitude by a certain distance and bearing.

average_angle(angle[, resolution])

Calculate the average angle and optionally round it to a specified resolution.

angle_between(lat, lon, lat_1, lon_1, lat_2, ...)

Calculate the angle between two coordinates, as seen from a center vertex.