gemgis.vector.calculate_coordinates_for_linestring_on_cross_sections
gemgis.vector.calculate_coordinates_for_linestring_on_cross_sections#
- gemgis.vector.calculate_coordinates_for_linestring_on_cross_sections(linestring: shapely.geometry.linestring.LineString, interfaces: shapely.geometry.linestring.LineString)#
Calculating the coordinates of vertices for a LineString 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), (20, 20)])
interfaces (shapely.geometry.linestring.LineString) – Shapely LineString containing the interfaces points digitized on a cross section, e.g.
interfaces = LineString([(2, -2), (5, -5)])
- Returns
points – List of Shapely Points with real world coordinates of digitized points on 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)'
>>> # Calculating coordinates for LineString on cross section >>> points = gg.vector.calculate_coordinates_for_linestring_on_cross_sections(linestring=linestring, interfaces=interfaces) >>> points [<shapely.geometry.point.Point at 0x231e8dc4d60>, <shapely.geometry.point.Point at 0x231e5d9b070>]
>>> # 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)'
See also
calculate_coordinates_for_point_on_cross_section
Calculating the coordinates for a Point on a cross section
calculate_coordinates_for_linestrings_on_cross_sections
Calculating the coordinates for LineStrings 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