gemgis.vector.create_linestring_gdf
gemgis.vector.create_linestring_gdf#
- gemgis.vector.create_linestring_gdf(gdf: geopandas.geodataframe.GeoDataFrame) geopandas.geodataframe.GeoDataFrame #
Creating LineStrings from Points
- Parameters
gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the points of intersections between topographic contours and layer boundaries
- Returns
gdf_linestring – GeoDataFrame containing LineStrings
- Return type
gpd.geodataframe.GeoDataFrame
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['id'] = 1 >>> gdf geometry formation Z id 0 POINT (0.0 0.0) Layer1 100 1 1 POINT (10.0 10.0) Layer1 100 1
>>> # Creating LineString GeoDataFrame >>> linestring_gdf = gg.vector.create_linestring_gdf(gdf=gdf) >>> linestring_gdf index formation Z id geometry 0 0 Layer1 100 1 LINESTRING (0.00000 0.00000, 10.00000 10.00000)
See also
calculate_azimuth
Calculating the azimuth for orientations on a map
create_linestring_from_points
Create LineString 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