gemgis.visualization.create_lines_from_points#

gemgis.visualization.create_lines_from_points(df: pandas.core.frame.DataFrame) pyvista.core.pointset.PolyData#

Creating a line set from a Pandas DataFrame

Parameters

df (pd.DataFrame) – Pandas DataFrame containing the data for one borehole

Returns

poly – Creating borehole traces from points

Return type

pv.core.pointset.PolyData

New in version 1.0.x.

Example

>>> # Loading Libraries and File
>>> import gemgis as gg
>>> import pandas as pd
>>> df = pd.read_csv('file.csv')
>>> df
    Unnamed: 0  Index   Name                            X           Y           Z       Altitude    Depth   formation       geometry
0   2091        GD1017  ForschungsbohrungMünsterland1   32386176.36 5763283.15  27.00   107.00      5956.00 OberCampanium   POINT (32386176.36 5763283.15)
1   2092        GD1017  ForschungsbohrungMünsterland1   32386176.36 5763283.15  -193.00 107.00      5956.00 UnterCampanium  POINT (32386176.36 5763283.15)
>>> # Adding row to DataFrames
>>> grouped = df.groupby(['Index'])
>>> df_groups = [grouped.get_group(x) for x in grouped.groups]
>>> list_df = gg.visualization.add_row_to_boreholes(df_groups)
>>> list_df[0]
    Unnamed: 0  Index   Name                            X           Y           Z       Altitude    Depth   formation       geometry
0   NaN         GD1017  ForschungsbohrungMünsterland1   32386176.36 5763283.15  27.00   107.00      5956.00                 NaN
0   2091        GD1017  ForschungsbohrungMünsterland1   32386176.36 5763283.15  27.00   107.00      5956.00 OberCampanium   POINT (32386176.36 5763283.15)
1   2092        GD1017  ForschungsbohrungMünsterland1   32386176.36 5763283.15  -193.00 107.00      5956.00 UnterCampanium  POINT (32386176.36 5763283.15)
>>> # Creating Lines from points
>>> line = gg.visualization.create_lines_from_points(df=list_df[0])
>>> line
PolyData    Information
N Cells     39
N Points    20
X Bounds    3.239e+07, 3.239e+07
Y Bounds    5.763e+06, 5.763e+06
Z Bounds    -5.849e+03, 1.070e+02
N Arrays    0

See also

add_row_to_boreholes

Adding a row to each borehole for later processing

create_borehole_tube

Creating borehole tube

create_borehole_tubes

Creating tubes from lines

create_borehole_labels

Creating labels for boreholes

create_boreholes_3d

Creating PyVista objects for plotting