gemgis.vector.extract_orientations_from_cross_sections#

gemgis.vector.extract_orientations_from_cross_sections(profile_gdf: geopandas.geodataframe.GeoDataFrame, orientations_gdf: geopandas.geodataframe.GeoDataFrame, profile_name_column: str = 'name') geopandas.geodataframe.GeoDataFrame#

Calculating orientations digitized from cross sections

Parameters
  • profile_gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the different profile traces as LineStrings

  • orientations_gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the orientation LineStrings for different profiles and formations

  • profile_name_column (str) – Name of the profile column, e.g. profile_name_column='name', default is 'name'

Returns

gdf – GeoDataFrame containing the orientation and location data for orientations digitized on cross sections

Return type

gpd.geodataframe.GeoDataFrame

New in version 1.0.x.

Example

>>> # Loading Libraries and creating LineString
>>> import gemgis as gg
>>> from shapely.geometry import Point, LineString
>>> import geopandas as gpd
>>> linestring = LineString([(0, 0), (20, -20)])
>>> linestring.wkt
'LINESTRING (0 0, 20 -20)'
>>> # Creating GeoDataFrame from LineString and adding profile names
>>> profile_gdf = gpd.GeoDataFrame(geometry=[linestring, linestring])
>>> profile_gdf['name'] = ['Profile2', 'Profile1']
>>> profile_gdf
    geometry                            name
0   LINESTRING (0.0 0.0, 20.0 -20.0)    Profile2
1   LINESTRING (0.0 0.0, 20.0 -20.0)    Profile1
>>> # Creating second LineString
>>> orientation_linestring = LineString([(2, -2), (5, -5)])
>>> orientation_linestring.wkt
'LINESTRING (2 -2, 5 -5)'
>>> # Creating GeoDataFrame from LineString and adding profile names
>>> orientations_gdf = gpd.GeoDataFrame(geometry=[orientation_linestring, orientation_linestring])
>>> orientations_gdf
    geometry                        name
0   LINESTRING (2.0 -2.0, 5.0 -5.0) Profile2
1   LINESTRING (2.0 -2.0, 5.0 -5.0) Profile1
>>> # Extract orientations from cross sections
>>> orientations = gg.vector.extract_orientations_from_cross_sections(profile_gdf=profile_gdf, orientations_gdf=orientations_gdf)
>>> orientations
    X       Y       Z       dip     azimuth     polarity    geometry                    name
0   2.47    -2.47   -3.50   45.00   135.00      1.00        POINT (2.47487 -2.47487)    Profile2
1   2.47    -2.47   -3.50   45.00   135.00      1.00        POINT (2.47487 -2.47487)    Profile1