gemgis.raster.sample_orientations
gemgis.raster.sample_orientations#
- gemgis.raster.sample_orientations(raster: Union[numpy.ndarray, rasterio.io.DatasetReader], extent: List[Union[int, float]] = None, point_x: Union[float, int, list, numpy.ndarray] = None, point_y: Union[float, int, list, numpy.ndarray] = None, random_samples: int = None, formation: str = None, seed: int = None, sample_outside_extent: bool = False, crs: Union[str, pyproj.crs.crs.CRS, rasterio.crs.CRS] = None) geopandas.geodataframe.GeoDataFrame #
Sampling orientations from a raster
- Parameters
raster (Union[np.ndarray, rasterio.io.DatasetReader) – Raster or arrays from which points are being sampled
extent (List[Union[int, float]]) – List containing the extent of the raster (minx, maxx, miny, maxy), e.g.
extent=[0, 972, 0, 1069]
point_x (Union[float, int, list, np.ndarray]) – Object containing the x coordinates of a point or points at which the array value is obtained, e.g.
point_x=100
, default isNone
point_y (Union[float, int, list, np.ndarray]) – Object containing the y coordinates of a point or points at which the array value is obtained, e.g.
point_y=100
, default isNone
random_samples (int) – Number of random samples to be drawn, e.g.
random_samples=10
, default isNone
formation (str) – Name of the formation the raster belongs to, e.g.
formation='Layer1'
, default isNone
seed (int) – Integer to set a seed for the drawing of random values, e.g.
seed=1
, default isNone
sample_outside_extent (bool) – Allow sampling outside the extent of the rasterio object. Options include:
True
orFalse
, default isFalse
crs (Union[str, pyproj.crs.crs.CRS, rasterio.crs.CRS]) – Coordinate reference system to be passed to the GeoDataFrame upon creation, e.g.
crs='EPSG:4647
- Returns
gdf – GeoDataFrame containing the sampled interfaces
- Return type
gpd.geodataframe.GeoDataFrame
New in version 1.0.x.
Example
>>> # Loading Libraries and File >>> import gemgis as gg >>> import rasterio >>> raster = rasterio.open(fp='raster.tif')
>>> # Sampling orientations from an array or rasterio object >>> gdf = gg.raster.sample_orientations(raster=raster, point_x=500, point_y=500) >>> gdf X Y Z geometry dip azimuth polarity 0 500.00 500.00 561.65 POINT (500.000 500.000) 19.26 145.55 1
See also
sample_from_array
Sample values from NumPy array
sample_from_rasterio
Sample values from rasterio object
sample_randomly
Sample randomly from rasterio object or NumPy array
sample_interfaces
Sample interfaces from raster