aws.osml.photogrammetry.coordinates module

class aws.osml.photogrammetry.coordinates.WorldCoordinate(coordinate: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Bases: object

A world coordinate is a vector representing a position in 3D space. Note that this type is a simple value with 3 components that does not distinguish between geodetic or other cartesian coordinate systems (e.g. geocentric Earth-Centered Earth-Fixed or coordinates based on a local tangent plane).

property x: float
property y: float
property z: float
class aws.osml.photogrammetry.coordinates.GeodeticWorldCoordinate(coordinate: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Bases: WorldCoordinate

A GeodeticWorldCoordinate is an WorldCoordinate where the x,y,z components can be interpreted as longitude, latitude, and elevation. It is important to note that longitude, and latitude are in radians while elevation is meters above the ellipsoid.

This class uses a custom format specification for a geodetic coordinate uses % directives similar to datetime. These custom directives can be combined as needed with literal values to produce a wide range of output formats. For example, ‘%ld%lm%ls%lH%od%om%os%oH’ will produce a ddmmssXdddmmssY formatted coordinate. The first half, ddmmssX, represents degrees, minutes, and seconds of latitude with X representing North or South (N for North, S for South). The second half, dddmmssY, represents degrees, minutes, and seconds of longitude with Y representing East or West (E for East, W for West), respectively.

Directive

Meaning

Notes

%L

latitude in decimal radians

1

%l

latitude in decimal degrees

1

%ld

latitute degrees

2

%lm

latitude minutes

%ls

latitude seconds

%lh

latitude hemisphere (n or s)

%lH

latitude hemisphere uppercase (N or S)

%O

longitude in decimal radians

1

%o

longitude in decimal degrees

1

%od

longitude degrees

2

%om

longitude minutes

%os

longitude seconds

%oh

longitude hemisphere (e or w)

%oH

longitude hemisphere uppercase (E or W)

%E

elevation in meters

%%

used to represent a literal % in the output

Notes:

  1. Formatting in decimal degrees or radians will be signed values

  2. Formatting for the degrees, minutes, seconds will always be unsigned assuming hemisphere will be included

  3. Any unknown directives will be ignored

property longitude: float
property latitude: float
property elevation: float
to_dms_string() str[source]

Outputs this coordinate in a format ddmmssXdddmmssY. The first half, ddmmssX, represents degrees, minutes, and seconds of latitude with X representing North or South (N for North, S for South). The second half, dddmmssY, represents degrees, minutes, and seconds of longitude with Y representing East or West (E for East, W for West), respectively.

Returns:

the formatted coordinate string

aws.osml.photogrammetry.coordinates.geocentric_to_geodetic(ecef_world_coordinate: WorldCoordinate) GeodeticWorldCoordinate[source]

Converts a ECEF world coordinate (x, y, z) in meters into a (longitude, latitude, elevation) geodetic coordinate with units of radians, radians, meters.

Parameters:

ecef_world_coordinate – the geocentric coordinate

Returns:

the geodetic coordinate

aws.osml.photogrammetry.coordinates.geodetic_to_geocentric(geodetic_coordinate: GeodeticWorldCoordinate) WorldCoordinate[source]

Converts a geodetic world coordinate (longitude, latitude, elevation) with units of radians, radians, meters into a ECEF / geocentric world coordinate (x, y, z) in meters.

Parameters:

geodetic_coordinate – the geodetic coordinate

Returns:

the geocentric coordinate

class aws.osml.photogrammetry.coordinates.ImageCoordinate(coordinate: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None)[source]

Bases: object

This image coordinate system convention is defined as follows. The upper left corner of the upper left pixel of the original full image has continuous image coordinates (pixel position) (r, c) = (0.0,0.0) , and the center of the upper left pixel has continuous image coordinates (r, c) = (0.5,0.5) . The first row of the original full image has discrete image row coordinate R = 0 , and corresponds to a range of continuous image row coordinates of r = [0,1) . The first column of the original full image has discrete image column coordinate C = 0 , and corresponds to a range of continuous image column coordinates of c = [0,1) . Thus, for example, continuous image coordinates (r, c) = (5.6,8.3) correspond to the sixth row and ninth column of the original full image, and discrete image coordinates (R,C) = (5,8).

property c: float
property r: float
property x: float
property y: float