gemgis.vector.create_linestring_from_points#

gemgis.vector.create_linestring_from_points(gdf: geopandas.geodataframe.GeoDataFrame, formation: str, altitude: Union[int, float]) shapely.geometry.linestring.LineString#

Creating a LineString object from a GeoDataFrame containing surface points at a given altitude and for a given formation

Parameters
  • gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the points of intersections between topographic contours and layer boundaries

  • formation (str) – Name of the formation, e.g. formation='Layer1'

  • altitude (Union[int, float]) – Value of the altitude of the points, e.g. altitude=100

Returns

linestring – LineString containing a LineString object

Return type

shapely.geometry.linestring.LineString

New in version 1.0.x.

Example

>>> # Loading Libraries and creating points
>>> import gemgis as gg
>>> from shapely.geometry import Point
>>> import geopandas as gpd
>>> point1 = Point(0,0)
>>> point2 = Point (10,10)
>>> # Creating GeoDataFrame from points and adding additional information
>>> gdf = gpd.GeoDataFrame(geometry=[point1, point2])
>>> gdf['formation'] = 'Layer1'
>>> gdf['Z'] = 100
>>> gdf
    geometry            formation   Z
0   POINT (0.0 0.0)     Layer1      100
1   POINT (10.0 10.0)   Layer1      100
>>> # Creating LineString from Points
>>> linestring = gg.vector.create_linestring_from_points(gdf=gdf, formation='Layer1', altitude=100)
>>> linestring.wkt
'LINESTRING (0 0, 10 10)'

See also

calculate_azimuth

Calculating the azimuth for orientations on a map

create_linestring_gdf

Create GeoDataFrame with LineStrings from points

extract_orientations_from_map

Extracting orientations from a map

calculate_distance_linestrings

Calculating the distance between LineStrings

calculate_orientations_from_strike_lines

Calculating the orientations from strike lines