GeostFrame .gst accessor#

GeoST extends Pandas and Geopandas with the .gst accessor, which provides all GeoST-specific methods to generic Pandas DataFrame and Geopandas GeoDataFrame objects. The .gst accessor becomes available by importing geost like so:

import geost

Once imported, the .gst accessor can be used on any Pandas DataFrame or Geopandas GeoDataFrame. For example:

import pandas as pd

# create a DataFrame with x and y coordinates for three points identified by 'nr'
df = pd.DataFrame({"nr": ["a", "b", "c"], "y": [1.2, 2.3, 3.4], "x": [0.8, 1.9, 2.0]})
df.gst.has_xy_columns
# Output:
# True

Constructor#

GeostFrame(dataframe)

Analysis#

GeostFrame.get_cumulative_thickness(column, ...)

Get the cumulative thickness of layers where a column contains a specified search value or values, or falls within a specified range.

GeostFrame.get_layer_base(column, values[, ...])

GeostFrame.get_layer_top(column, values[, ...])

Find the top depth in individual survey ids where a column in a Pandas DataFrame contains specified search value or values, or falls within a specified range.

Coordinate Reference System#

GeostFrame.to_crs(crs)

Change the coordinate reference system (CRS) to a given target CRS.

GeostFrame.to_vertical_datum(vertical_datum)

Change the vertical datum of the object's surface levels.

GeostFrame.transform_coordinates(...[, ...])

Transform the coordinates of GeoDataFrame or DataFrame to a given coordinate reference system (CRS).

Generic#

GeostFrame.calculate_thickness()

Calculate the thickness of layers in the data.

GeostFrame.standardize_column_names()

Standardize column names to a consistent format used in GeoST.

GeostFrame.to_collection([crs, ...])

Create a geost.base.Collection from the current GeoDataFrame or DataFrame.

GeostFrame.to_header([include_columns, ...])

Create a header GeoDataFrame from the DataFrame to be used as a header table for the creation of a Collection object.

GeostFrame.validate([return_result])

Validate the DataFrame by checking for the presence of crucial information, data types and consistency of the data.

Export#

GeostFrame.to_kingdom(outfile[, tdstart, vw, vs])

Write data to 2 csv files: 1) interval data and 2) time-depth chart.

GeostFrame.to_pyvista_cylinders(...[, ...])

Create a Pyvista MultiBlock object of cylinder-shaped geometries to represent boreholes.

GeostFrame.to_pyvista_grid(displayed_variables)

Create a PyVista UnstructuredGrid object of the data in this instance.

GeostFrame.to_qgis3d(outfile[, crs])

Write data to geopackage file that can be directly loaded in the Qgis2threejs plugin.

Selection#

GeostFrame.select_by_condition(condition[, ...])

Do a condition-based selection on the DataFrame or GeoDataFrame: return the rows in the data where the 'condition' evaluates to True, see examples below.

GeostFrame.select_by_elevation([top_min, ...])

Select data based on the elevation of the top and/or end of the survey.

GeostFrame.select_by_length([min_length, ...])

Select data based on the length of the survey, which is determined by the difference between the surface and the end of the survey.

GeostFrame.select_by_values(column, values)

Select data based on the presence of values in a given column.

GeostFrame.slice_by_values(column, values[, ...])

Slice rows from data based on matching condition.

GeostFrame.slice_depth_interval([...])

Slice data based on given upper and lower boundaries.

Spatial#

GeostFrame.select_with_lines(lines, max_distance)

Select all data that lie within a maximum distance from given line geometries.

GeostFrame.select_with_points(points, ...[, ...])

Select all data that lie within a maximum distance from given point geometries.

GeostFrame.select_within_bbox(xmin, ymin, ...)

Select data within a specified bounding box (xmin, ymin, xmax, ymax).

GeostFrame.select_within_polygons(polygons)

Select all data that lie within given polygon geometries.

GeostFrame.spatial_join(geometries, label_id)

Join information from another GeoDataFrame by a spatial relationship (e.g. overlap) between the geometries in the original GeoDataFrame with the geometries in the other GeoDataFrame.

Attributes#

GeostFrame.first_row_survey

Get a boolean mask indicating the locations of new survey IDs in the data.

GeostFrame.has_depth_columns

Returns True if the object contains information about depth, such as 'top' and 'bottom' or 'depth' columns, False otherwise.

GeostFrame.has_geometry

Returns True if the object is a GeoDataFrame with a valid geometry column, False otherwise.

GeostFrame.has_xy_columns

Returns True if the object contains x and y columns, False otherwise.

GeostFrame.last_row_survey

Get a boolean mask indicating the locations of the last row in each survey.

GeostFrame.is_layered

Returns True if the object contains layered data, i.e. both 'top' and 'bottom' columns, False otherwise.