gemgis.vector.calculate_coordinates_for_linestrings_on_cross_sections#

gemgis.vector.calculate_coordinates_for_linestrings_on_cross_sections(linestring: shapely.geometry.linestring.LineString, linestring_interfaces_list: List[shapely.geometry.linestring.LineString]) List[shapely.geometry.point.Point]#

Calculating the coordinates of vertices for LineStrings on a straight cross section provided as Shapely LineString

Parameters
  • linestring (shapely.geometry.linestring.LineString) – Shapely LineString containing the trace of a cross section on a map, e.g. linestring = LineString([(0, 0), (10, 10), (20, 20)])

  • linestring_interfaces_list (List[shapely.geometry.linestring.LineString]) – List containing Shapely LineStrings representing interfaces on cross sections

Returns

points – List containing Shapely Points with real world coordinates of the digitized interfaces on the cross section

Return type

List[shapely.geometry.point.Point]

New in version 1.0.x.

Example

>>> # Loading Libraries and creating LineString
>>> import gemgis as gg
>>> from shapely.geometry import Point, LineString
>>> linestring = LineString([(0, 0), (20, -20)])
>>> linestring.wkt
'LINESTRING (0 0, 20 -20)'
>>> # Creating second LineString
>>> interfaces = LineString([(2, -2), (5, -5)])
>>> interfaces.wkt
'LINESTRING (2 -2, 5 -5)'
>>> # Creating list of LineStrings
>>> linestring_interfaces_list = [interfaces, interfaces]
>>> # Calculating coordinates for LineStrings on cross section
>>> points = gg.vector.calculate_coordinates_for_linestrings_on_cross_sections(linestring=linestring, linestring_interfaces_list=linestring_interfaces_list)
>>> points
[<shapely.geometry.point.Point at 0x231e8019730>,
 <shapely.geometry.point.Point at 0x231e801e400>,
 <shapely.geometry.point.Point at 0x231e80192e0>,
 <shapely.geometry.point.Point at 0x231e80191f0>]
>>> # Inspecting the first element of the list
>>> points[0].wkt
'POINT (1.414213562373095 -1.414213562373095)'
>>> # Inspecting the second element of the list
>>> points[1].wkt
'POINT (3.535533905932737 -3.535533905932737)'
>>> # Inspecting the third element of the list
>>> points[2].wkt
'POINT (1.414213562373095 -1.414213562373095)'
>>> # Inspecting the fourth element of the list
>>> points[3].wkt
'POINT (3.535533905932737 -3.535533905932737)'

See also

calculate_coordinates_for_point_on_cross_section

Calculating the coordinates for a Point on a cross section

calculate_coordinates_for_linestring_on_cross_sections

Calculating the coordinates for one LineString on cross sections

extract_interfaces_coordinates_from_cross_section

Extracting the coordinates of interfaces from cross sections

extract_xyz_from_cross_sections

Extracting the X, Y, and Z coordinates of interfaces from cross sections