|
- Method resolution order:
- GeoSequence
- LineString
- GeometryType
- builtins.object
Methods defined here:
- __init__(self, coordinates=None, timestamps=None, link_ids=None, user_field_count=0, user_fields=None)
- DESCRIPTION:
Enables end user to create an object holding the LineString
geometry objects with tracking information such as timestamps.
Allows user to use the same in GeoDataFrame manipulation and
processing using any Geospatial function.
PARAMETERS:
coordinates:
Optional Argument.
Specifies the list of coordinates of a Point. While passing
coordinates, one must always pass coordinates in list of either
two-tuples for 2D or list of three-tuples for 3D.
Argument also accepts list of Points as well instead of tuples.
If coordinates are not passed, an object for empty line is
created.
Types: List of
a. Point geometry objects or
b. two-tuple of int or float or
c. three-tuple of int or float or
d. Mix of any of the above.
timestamps:
Optional Argument.
Specifies the list of timestamp values for each coordinate with
the following format:
yyyy-mm-dd hh:mi:ss.ms
The first timestamp value is associated with the first point, the
second timestamp value is associated with the second point, and
so forth.
Note:
You must specify n timestamp values, where n is the number of
points in the geosequence.
Types: list of strings
link_ids:
Optional Argument.
Specifies the list of values for the ID of the link on the road
network for a point in the geosequence.
This value is reserved for a future release.
The first link ID value is associated with the first point, the
second link ID value is associated with the second point, and
so forth.
Note:
You must specify n link ID values, where n is the number of
points in the geosequence.
Types: list of ints
user_field_count:
Optional Argument.
Specifies the value that represents the number of user field
elements for each point in the geosequence.
A value of 0 indicates that no user field elements appear after
count in the character string.
Default Value: 0
Types: int
user_fields:
Optional Argument.
Specifies the list of user field tuples that represents a value to
associated with a point. For example, certain tracking systems may
associate velocity, direction, and acceleration values with each point.
Note:
1. You must specify count groups of n user field values (where n is
the number of points in the geosequence).
2. The first group provides the first user field values for each point,
the second group provides the second user field values for each point,
and so forth.
3. Each group can be formed using a tuple.
Types: list of tuples of ints or floats
RETURNS:
GeoSequence
RAISES:
TeradataMlException, TypeError, ValueError
EXAMPLES:
>>> from teradataml import Point, GeoSequence
# Example 1: Create a GeoSequence with 2D points and no user fields.
>>> coordinates = [(1, 3), (3, 0), (0, 1)]
>>> timestamps = ["2008-03-17 10:34:03.53", "2008-03-17 10:38:25.21", "2008-03-17 10:41:41.48"]
>>> link_ids = [1001, 1002, 1003]
>>> gs1 = GeoSequence(coordinates=coordinates, timestamps=timestamps, link_ids=link_ids)
>>> gs1.coords
[(1, 3), (3, 0), (0, 1)]
>>> str(gs1)
'GeoSequence((1 3, 3 0, 0 1), (2008-03-17 10:34:03.53, 2008-03-17 10:38:25.21, 2008-03-17 10:41:41.48), (1001, 1002, 1003), (0))'
>>>
# Example 2: Create a GeoSequence with 3D points and 2 user fields.
# Note that coordinates can be provided as tuple of ints/floats
# or Point objects.
>>> p1 = (3, 0, 6)
>>> coordinates = [(1, 3, 6), p1, (6, 0, 1)]
>>> timestamps = ["2008-03-17 10:34:03.53", "2008-03-17 10:38:25.21", "2008-03-17 10:41:41.48"]
>>> link_ids = [1001, 1002, 1003]
>>> user_fields = [(1, 2), (3, 4), (5, 6)]
>>> gs2 = GeoSequence(coordinates=coordinates, timestamps=timestamps, link_ids=link_ids,
... user_field_count=2, user_fields=user_fields)
>>> gs2.coords
[(1, 3, 6), (3, 0, 6), (6, 0, 1)]
>>> str(gs2)
'GeoSequence((1 3 6, 3 0 6, 6 0 1), (2008-03-17 10:34:03.53, 2008-03-17 10:38:25.21, 2008-03-17 10:41:41.48), (1001, 1002, 1003), (2, 1, 2, 3, 4, 5, 6))'
>>>
# Example 3: Create an empty GeoSequence.
>>> gs3 = GeoSequence()
>>> # Print the coordinates.
>>> print(gc3.coords)
EMPTY
>>>
Methods inherited from GeometryType:
- __getattr__(self, item)
- __str__(self)
- Return String Representation for a Geometry object.
Readonly properties inherited from GeometryType:
- coords
- Returns the coordinates of the Geometry object.
- geom_type
- Returns the type of a Geometry.
Data descriptors inherited from GeometryType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|