tracktable.lib._cartesian2d module¶
Module contents¶
- class tracktable.lib._cartesian2d.BasePointCartesian2D
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
- zero()
Zeroize the point
- DOMAIN = 'cartesian2d'
- property domain
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- static zero()
- class tracktable.lib._cartesian2d.BasePointReaderCartesian2D
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
- field_delimiter
Designated character for delimiting fields (Default: whitespace)
- Type
- null_value
Value indicating null value
- Type
- coordinates
Long-lat point for the given domain
- Type
<domain>Point
- input
File to read
- Type
- 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 = 'cartesian2d'
- clear_coordinate_assignments()
- property comment_character
- property coordinates
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property field_delimiter
- has_coordinate_column()
- property input
- property null_value
- property x_column
- property y_column
- class tracktable.lib._cartesian2d.BasePointWriterCartesian2D
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
- field_delimiter
Designated character for delimiting fields (Default: whitespace)
- Type
- null_value
Value indicating null value
- Type
- record_delimiter
The record separator (end-of-line string). This string will be written after each point.
- Type
- coordinate_precision
The decimal precision for writing coordinates
- Type
- 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
- write(point start, point end)
Inserts record separators after the header and after each point
- DOMAIN = 'cartesian2d'
- property coordinate_precision
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property field_delimiter
- property null_value
- property output
- property quote_character
- property record_delimiter
- write()
- property write_header
- class tracktable.lib._cartesian2d.BoundingBoxCartesian2D
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
- max_corner
Minimum corner value of the bounding box
- Type
- domain
Domian that the bounding box is in
- Type
- DOMAIN = 'cartesian2d'
- property domain
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property max_corner
- property min_corner
- class tracktable.lib._cartesian2d.TrajectoryCartesian2D
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
- duration
The duration of the trajectory
- Type
- domain
Domian that the point is in
- Type
- trajectory_id
The ID of the trajectory
- Type
- object_id
The ID of the point
- Type
- 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 = 'cartesian2d'
- append()
- clone()
- property domain
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property duration
- extend()
- static from_position_list()
- has_property()
- insert()
- property object_id
- property properties
- property()
- set_property()
- property trajectory_id
- class tracktable.lib._cartesian2d.TrajectoryPointCartesian2D
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
- object_id
The ID of the point
- Type
- timestamp
Timestamp for the point
- Type
- current_length
length of trajectory
- Type
- domain
Domian that the point is in
- Type
- 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 = 'cartesian2d'
- property current_length
- property domain
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- has_property()
- property object_id
- property properties
- property()
- set_property()
- property timestamp
- static zero()
- class tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D
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
- field_delimiter
Designated character for delimiting fields (Default: whitespace)
- Type
- null_value
Value indicating null value
- Type
- coordinates
Long-lat point for the given domain
- Type
<domain>Point
- input
File to read
- Type
- object_id_column
The column that will be used for object IDs
- Type
- timestamp_column
The column that will be used for timestamps
- Type
- timestamp_format
The format of the timestamp
- Type
- 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 = 'cartesian2d'
- clear_coordinate_assignments()
- property comment_character
- property coordinates
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property field_delimiter
- has_coordinate_column()
- property input
- 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
- property x_column
- property y_column
- class tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D
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
- field_delimiter
Designated character for delimiting fields (Default: whitespace)
- Type
- null_value
Value indicating null value
- Type
- record_delimiter
The record separator (end-of-line string). This string will be written after each point.
- Type
- coordinate_precision
The decimal precision for writing coordinates
- Type
- 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
- write(point start, point end)
Inserts record separators after the header and after each point
- DOMAIN = 'cartesian2d'
- property coordinate_precision
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property field_delimiter
- property null_value
- property output
- property quote_character
- property record_delimiter
- write()
- property write_header
- class tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D
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
- field_delimiter
Designated character for delimiting fields (Default: whitespace)
- Type
- null_value
Value indicating null value
- Type
- input
File to read
- Type
- warnings_enabled
Flag to enable warning messages during parsing
- Type
- DOMAIN = 'cartesian2d'
- property comment_character
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property field_delimiter
- property input
- property null_value
- property warnings_enabled
- class tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D
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
- field_delimiter
Designated character for delimiting fields (Default: whitespace)
- Type
- null_value
Value indicating null value
- Type
- record_delimiter
The record separator (end-of-line string). This string will be written after each point.
- Type
- coordinate_precision
The decimal precision for writing coordinates
- Type
- 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
- write(iter trajectory_start, trajectory_ end)
Write many trajectories
- DOMAIN = 'cartesian2d'
- property coordinate_precision
- domain_classes = {'BasePoint': <class 'tracktable.lib._cartesian2d.BasePointCartesian2D'>, 'BasePointReader': <class 'tracktable.lib._cartesian2d.BasePointReaderCartesian2D'>, 'BasePointWriter': <class 'tracktable.lib._cartesian2d.BasePointWriterCartesian2D'>, 'BoundingBox': <class 'tracktable.lib._cartesian2d.BoundingBoxCartesian2D'>, 'Trajectory': <class 'tracktable.lib._cartesian2d.TrajectoryCartesian2D'>, 'TrajectoryPoint': <class 'tracktable.lib._cartesian2d.TrajectoryPointCartesian2D'>, 'TrajectoryPointReader': <class 'tracktable.lib._cartesian2d.TrajectoryPointReaderCartesian2D'>, 'TrajectoryPointWriter': <class 'tracktable.lib._cartesian2d.TrajectoryPointWriterCartesian2D'>, 'TrajectoryReader': <class 'tracktable.lib._cartesian2d.TrajectoryReaderCartesian2D'>, 'TrajectoryWriter': <class 'tracktable.lib._cartesian2d.TrajectoryWriterCartesian2D'>}
- property field_delimiter
- property null_value
- property output
- property quote_character
- property record_delimiter
- write()