tracktable.lib._terrestrial module

Module contents

class tracktable.lib._terrestrial.BasePointReaderTerrestrial

Bases: Boost.Python.instance

Class for reading base points from a file.

This reader wraps the following pipeline:
  • Read lines from a text file

  • Skip any lines that begin with a designated comment character

  • Tokenize each line using specified delimiters

  • Create a point (user-specified type) from each tokenized line

  • Return the resulting points via an iteratable

comment_character

Designated character for commented lines (Default: ‘#’)

Type

str

field_delimiter

Designated character for delimiting fields (Default: whitespace)

Type

str

null_value

Value indicating null value

Type

str

coordinates

Long-lat point for the given domain

Type

<domain>Point

input

File to read

Type

str

Cartesian2D specific attributes:
  • x_column (int): The column that will be the X coordinate

  • y_column (int): The column that will be the Y coordinate

Cartesian3D specific attributes:
  • x_column (int): The column that will be the X coordinate

  • y_column (int): The column that will be the Y coordinate

  • z_column (int): The column that will be the Z coordinate

Terrestrial specific attributes:
  • longitude_column (int): The column that will be the longitude coordinate

  • latitude_column (int): The column that will be the latitude coordinate

has_coordinate_column(int coordinate)

Returns bool indicating if the coordinate has a corrdinate column

clear_coordinate_assignments()

Clears all of the corrdinate assignments

DOMAIN = 'terrestrial'
clear_coordinate_assignments()
property comment_character
property coordinates
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property field_delimiter
has_coordinate_column()
property input
property latitude_column
property longitude_column
property null_value
class tracktable.lib._terrestrial.BasePointTerrestrial

Bases: Boost.Python.instance

2D and 3D Cartiesian base points are N-dimensional points in Cartesian space Terrestrial base points are 2-dimensional points on a sphere. Object can be serialized for a given type/property map.

Accesors and operators are wrapped under:
  • __init__: Create new point

  • __getitem__: Access the point values

  • __setitem__: Set the point values

  • __len__: Get point dimension

  • __add__: Add

  • __iadd__: Add in place

  • __sub__: Subtract

  • __isub__: Subtract in place

  • __mul__: Multiply

  • __imul__: Multiply in place

  • __div__: Divide

  • __idiv__: Divide in place

  • __mul__: Multiply scalar

  • __rmul__: Multiply scalar

  • __imul__: Multiply scalar in place

  • __div__: Divide scalar

  • __rdiv__: Divide scalar in place

  • __idiv__: Divide scalar in place

To string operations are wrapped under the standard to-string methods:
  • __str__

  • __repr__

point

A tuple representing the long-lat points of the given domain

Type

<domain>Point

domain

Domian that the point is in

Type

str

zero()

Zeroize the point

DOMAIN = 'terrestrial'
property domain
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
static zero()
class tracktable.lib._terrestrial.BasePointWriterTerrestrial

Bases: Boost.Python.instance

Write points of any type as delimited text This class writes a sequence of points to a file in delimited text format. You can control the destination, the delimiter, the record separator (usually newline) and whether or not a header line is written.

write_header

Flag to write a header. The header string describes the contents of a point: coordinate system, properties (if any), number of coordinates. By default it will be written at the beginning of a sequence of points. output (object): Python object to write to

Type

bool

field_delimiter

Designated character for delimiting fields (Default: whitespace)

Type

str

null_value

Value indicating null value

Type

str

record_delimiter

The record separator (end-of-line string). This string will be written after each point.

Type

str

coordinate_precision

The decimal precision for writing coordinates

Type

float

quote_character

The quote character. This character may be used to enclose a field containing lots of characters that would otherwise need to be escaped.

Type

str

write(point start, point end)

Inserts record separators after the header and after each point

DOMAIN = 'terrestrial'
property coordinate_precision
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property field_delimiter
property null_value
property output
property quote_character
property record_delimiter
write()
property write_header
class tracktable.lib._terrestrial.BoundingBoxTerrestrial

Bases: Boost.Python.instance

Axis-aligned bounding box This class is a thin wrapper around boost::geometry::model::box that holds two points representing opposite corners.

Constructors:
  • __init__ - Create new base point box

  • __init__ - Create new trajectory point box

  • __init__ - Create new box from min and max corner objects

To string operations are wrapped under the standard to-string methods:
  • __str__

  • __repr__

min_corner

Minimum corner value of the bounding box

Type

object

max_corner

Minimum corner value of the bounding box

Type

object

domain

Domian that the bounding box is in

Type

str

DOMAIN = 'terrestrial'
property domain
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property max_corner
property min_corner
class tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial

Bases: Boost.Python.instance

Class for reading trajectory points from a file.

This reader wraps the following pipeline:
  • Read lines from a text file

  • Skip any lines that begin with a designated comment character

  • Tokenize each line using specified delimiters

  • Create a point (user-specified type) from each tokenized line

  • Return the resulting points via a iteratable

comment_character

Designated character for commented lines (Default: ‘#’)

Type

str

field_delimiter

Designated character for delimiting fields (Default: whitespace)

Type

str

null_value

Value indicating null value

Type

str

coordinates

Long-lat point for the given domain

Type

<domain>Point

input

File to read

Type

str

object_id_column

The column that will be used for object IDs

Type

str

timestamp_column

The column that will be used for timestamps

Type

str

timestamp_format

The format of the timestamp

Type

str

Cartesian2D specific attributes:
  • x_column (int): The column that will be the X coordinate

  • y_column (int): The column that will be the Y coordinate

Cartesian3D specific attributes:
  • x_column (int): The column that will be the X coordinate

  • y_column (int): The column that will be the Y coordinate

  • z_column (int): The column that will be the Z coordinate

Terrestrial specific attributes:
  • longitude_column (int): The column that will be the longitude coordinate

  • latitude_column (int): The column that will be the latitude coordinate

has_coordinate_column(int coordinate)

Returns bool indicating if the coordinate has a corrdinate column

clear_coordinate_assignments()

Clears all of the corrdinate assignments

set_real_field_column(string field, int column)

Set the field column value of the point

real_field_column(str field)

Retrieve the column assignment for a real-valued field

set_string_field_column(str field, int column)

Set the string column value of the point

string_field_column(str field)

Retrieve the column assignment for a string field

set_time_field_column(str field, int column)

Set the time column value of the point

time_field_column(str field)

Retrieve the column assignment for a time field

DOMAIN = 'terrestrial'
clear_coordinate_assignments()
property comment_character
property coordinates
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property field_delimiter
has_coordinate_column()
property input
property latitude_column
property longitude_column
property null_value
property object_id_column
real_field_column()
set_real_field_column()
set_string_field_column()
set_time_field_column()
string_field_column()
time_field_column()
property timestamp_column
property timestamp_format
class tracktable.lib._terrestrial.TrajectoryPointTerrestrial

Bases: Boost.Python.instance

This class will add trajectory properties (a timestamp, an object ID and storage for named properties) to any point class.

Accesors and operators are wrapped under:
  • __init__: Create new point

  • __getitem__: Access the point values

  • __setitem__: Set the point values

  • __len__: Get point dimension

  • __add__: Add

  • __iadd__: Add in place

  • __sub__: Subtract

  • __isub__: Subtract in place

  • __mul__: Multiply

  • __imul__: Multiply in place

  • __div__: Divide

  • __idiv__: Divide in place

  • __mul__: Multiply scalar

  • __rmul__: Multiply scalar

  • __imul__: Multiply scalar in place

  • __div__: Divide scalar

  • __rdiv__: Divide scalar in place

  • __idiv__: Divide scalar in place

To string operations are wrapped under the standard to-string methods:
  • __str__

  • __repr__

point

A tuple representing the long-lat points of the given domain

Type

<domain>Point

properties

Property values of the point

Type

dict

object_id

The ID of the point

Type

str

timestamp

Timestamp for the point

Type

str

current_length

length of trajectory

Type

int

domain

Domian that the point is in

Type

str

set_property(str name, property value)

Set the give property value

has_property(str name)

Check whether a property is present

property(str name)

Retrieve a named property

DOMAIN = 'terrestrial'
ECEF()
ECEF_from_feet()
ECEF_from_meters()
property current_length
property domain
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
has_property()
property object_id
property properties
property()
set_property()
property timestamp
static zero()
class tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial

Bases: Boost.Python.instance

Write trajectories points of any type as delimited text

This class writes a sequence of trajectory points to a file in delimited text format. You can control the destination, the delimiter, the record separator (usually newline) and whether or not a header line is written.

write_header

Flag to write a header. The header string describes the contents of a point: coordinate system, properties (if any), number of coordinates. By default it will be written at the beginning of a sequence of points. output (object): Python object to write to

Type

bool

field_delimiter

Designated character for delimiting fields (Default: whitespace)

Type

str

null_value

Value indicating null value

Type

str

record_delimiter

The record separator (end-of-line string). This string will be written after each point.

Type

str

coordinate_precision

The decimal precision for writing coordinates

Type

float

quote_character

The quote character. This character may be used to enclose a field containing lots of characters that would otherwise need to be escaped.

Type

str

write(point start, point end)

Inserts record separators after the header and after each point

DOMAIN = 'terrestrial'
property coordinate_precision
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property field_delimiter
property null_value
property output
property quote_character
property record_delimiter
write()
property write_header
class tracktable.lib._terrestrial.TrajectoryReaderTerrestrial

Bases: Boost.Python.instance

Class for reading trajectories from files.

This reader wraps the following pipeline:
  • Read lines from a text file

  • Skip any lines that begin with a designated comment character (‘#’ by default)

  • Tokenize each line using specified delimiters (whitespace by default)

  • Create a trajectory (user-specified type) from each tokenized line

  • Return the resulting points

comment_character

Designated character for commented lines (Default: ‘#’)

Type

str

field_delimiter

Designated character for delimiting fields (Default: whitespace)

Type

str

null_value

Value indicating null value

Type

str

input

File to read

Type

str

warnings_enabled

Flag to enable warning messages during parsing

Type

bool

DOMAIN = 'terrestrial'
property comment_character
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property field_delimiter
property input
property null_value
property warnings_enabled
class tracktable.lib._terrestrial.TrajectoryTerrestrial

Bases: Boost.Python.instance

This class is the heart of most of what Tracktable does. It implements an ordered sequence of TrajectoryPoint objects, each of which has an ID, coordinates and a timestamp. Those compose a trajectory. Object can be serialized for given type/property map.

properties

Property values of the trajectory

Type

dict

duration

The duration of the trajectory

Type

float

domain

Domian that the point is in

Type

str

trajectory_id

The ID of the trajectory

Type

str

object_id

The ID of the point

Type

str

set_property(str name, property value)

Set the give property value

has_property(str name)

Check whether a property is present

property(str name)

Retrieve a named property

from_position_list(list points)

Create a list of trajectories from a list of iterables

insert(int indea, point value)

Insert a single element into the trajectory at an arbitrary index

clone()

Make this trajectory a clone of another

DOMAIN = 'terrestrial'
append()
clone()
property domain
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property duration
extend()
static from_position_list()
has_property()
insert()
property object_id
property properties
property()
set_property()
property trajectory_id
class tracktable.lib._terrestrial.TrajectoryWriterTerrestrial

Bases: Boost.Python.instance

Write trajectories of any type as delimited text

This class writes subclasses of tracktable::Trajectory (including the domain classes) to a stream as delimited text. It will write one trajectory per line. The resulting file will contain enough header information to reconstruct the trajectory exactly as long as the user asks for the correct class.

write_header

Flag to write a header. The header string describes the contents of a point: coordinate system, properties (if any), number of coordinates. By default it will be written at the beginning of a sequence of points. output (object): Python object to write to

Type

bool

field_delimiter

Designated character for delimiting fields (Default: whitespace)

Type

str

null_value

Value indicating null value

Type

str

record_delimiter

The record separator (end-of-line string). This string will be written after each point.

Type

str

coordinate_precision

The decimal precision for writing coordinates

Type

float

quote_character

The quote character. This character may be used to enclose a field containing lots of characters that would otherwise need to be escaped.

Type

str

write(iter trajectory_start, trajectory_ end)

Write many trajectories

DOMAIN = 'terrestrial'
property coordinate_precision
domain_classes = {'BasePoint': <class 'tracktable.lib._terrestrial.BasePointTerrestrial'>, 'BasePointReader': <class 'tracktable.lib._terrestrial.BasePointReaderTerrestrial'>, 'BasePointWriter': <class 'tracktable.lib._terrestrial.BasePointWriterTerrestrial'>, 'BoundingBox': <class 'tracktable.lib._terrestrial.BoundingBoxTerrestrial'>, 'Trajectory': <class 'tracktable.lib._terrestrial.TrajectoryTerrestrial'>, 'TrajectoryPoint': <class 'tracktable.lib._terrestrial.TrajectoryPointTerrestrial'>, 'TrajectoryPointReader': <class 'tracktable.lib._terrestrial.TrajectoryPointReaderTerrestrial'>, 'TrajectoryPointWriter': <class 'tracktable.lib._terrestrial.TrajectoryPointWriterTerrestrial'>, 'TrajectoryReader': <class 'tracktable.lib._terrestrial.TrajectoryReaderTerrestrial'>, 'TrajectoryWriter': <class 'tracktable.lib._terrestrial.TrajectoryWriterTerrestrial'>}
property field_delimiter
property null_value
property output
property quote_character
property record_delimiter
write()