gemgis.vector.extract_xyz_from_cross_sections
gemgis.vector.extract_xyz_from_cross_sections#
- gemgis.vector.extract_xyz_from_cross_sections(profile_gdf: geopandas.geodataframe.GeoDataFrame, interfaces_gdf: geopandas.geodataframe.GeoDataFrame, profile_name_column: str = 'name') geopandas.geodataframe.GeoDataFrame #
Extracting X, Y, and Z coordinates from cross sections and digitized interfaces
- Parameters
profile_gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the traces (LineStrings) of cross sections on a map and a profile name
interfaces_gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the LineStrings of digitized interfaces, associated formation and the profile name
profile_name_column (str) – Name of the profile column, default is
profile_name_column='name'
- Returns
gdf – GeoDataFrame containing the X, Y, and Z information of all extracted digitized interfaces 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 ad Profile names >>> profile_gdf = gpd.GeoDataFrame(geometry=[linestring, linestring]) >>> profile_gdf['name'] = ['Profile1', 'Profile2'] >>> profile_gdf geometry name 0 LINESTRING (0.0 0.0, 20.0 -20.0) Profile1 1 LINESTRING (0.0 0.0, 20.0 -20.0) Profile2
>>> # Creating second LineString >>> interfaces = LineString([(2, -2), (5, -5)]) >>> interfaces.wkt 'LINESTRING (2 -2, 5 -5)'
>>> # Creating GeoDataFrame from LineString and ad Profile names >>> gdf = gpd.GeoDataFrame(geometry=[interfaces, interfaces]) >>> gdf['name'] = ['Profile1', 'Profile2'] >>> gdf geometry name 0 LINESTRING (2.0 -2.0, 5.0 -5.0) Profile1 1 LINESTRING (2.0 -2.0, 5.0 -5.0) Profile2
>>> # Extracting X, Y, and Z coordinates from cross sections >>> gdf_points = gg.vector.extract_xyz_from_cross_sections(profile_gdf=profile_gdf, interfaces_gdf=gdf) >>> gdf_points name geometry X Y Z 0 Profile1 POINT (1.41421 -1.41421) 1.41 -1.41 -2.00 1 Profile1 POINT (3.53553 -3.53553) 3.54 -3.54 -5.00 2 Profile2 POINT (1.41421 -1.41421) 1.41 -1.41 -2.00 3 Profile2 POINT (3.53553 -3.53553) 3.54 -3.54 -5.00
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
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