MultiLineString | Geospatial Types | Teradata Package for Python - MultiLineString - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This function enables end user to create an object holding the multiple LineString geometry objects. It allows user to use the same in GeoDataFrame manipulation and processing using any Geospatial function.

Optional argument:

lines: Specifies the list of LineString objects. If no lines are passed, an object for empty MultiLineString is created.

Example 1: Create a MultiLineString in 2D, using x and y coordinates

>>> from teradataml import LineString, MultiLineString
>>> l1 = LineString([(1, 3), (3, 0), (0, 1)])
>>> l2 = LineString([(1.35, 3.6456), (3.6756, 0.23), (0.345, 1.756)])
>>> go1 = MultiLineString([l1, l2])
>>> # Print the coordinates.
>>> print(go1.coords)
[[(1, 3), (3, 0), (0, 1)], [(1.35, 3.6456), (3.6756, 0.23), (0.345, 1.756)]]
>>> # Print the geometry type.
>>> print(go1.geom_type)
MultiLineString

Example 2: Create an empty MultiLineString

>>> from teradataml import LineString, MultiLineString
>>> mls = MultiLineString()
>>> # Print the coordinates.
>>> print(mls.coords)
EMPTY