Skip to content

Commit

Permalink
Format explode_linestring_to_elements
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed Jul 28, 2024
1 parent 29e8199 commit 606a031
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions gemgis/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2639,24 +2639,26 @@ def explode_linestring(
def explode_linestring_to_elements(
linestring: shapely.geometry.linestring.LineString,
) -> List[shapely.geometry.linestring.LineString]:
"""Separating a LineString into its single elements and returning a list of LineStrings representing these elements,
also works for LineStrings with Z components
"""Separate a LineString into its single elements and returning a list of LineStrings representing these elements,
also works for LineStrings with Z components.
Parameters
__________
linestring : linestring: shapely.geometry.linestring.LineString
linestring : shapely.geometry.linestring.LineString
Shapely LineString containing more than two vertices,
e.g. ``linestring = LineString([(0, 0), (10, 10), (20, 20)])``
e.g. ``linestring = LineString([(0, 0), (10, 10), (20, 20)])``.
Returns
_______
splitted_linestrings : List[shapely.geometry.linestring.LineString]
List containing the separate elements of the original LineString stored as LineStrings
List containing the separate elements of the original LineString stored as LineStrings.
.. versionadded:: 1.0.x
.. versionchanged:: 1.2
Example
_______
Expand Down Expand Up @@ -2684,10 +2686,9 @@ def explode_linestring_to_elements(
See Also
________
explode_linestring : Exploding a LineString into its single vertices
explode_linestring : Explode a LineString into its single vertices
"""

# Checking that the LineString is a Shapely LineString
if not isinstance(linestring, shapely.geometry.linestring.LineString):
raise TypeError("Input geometry must be a Shapely LineString")
Expand Down

0 comments on commit 606a031

Please sign in to comment.