sgsPy
structurally guided sampling
Loading...
Searching...
No Matches
sgs::access::Access

#include <access.h>

Public Member Functions

 Access (vector::GDALVectorWrapper *p_vector, raster::GDALRasterWrapper *p_raster, std::string layerName, double buffInner, double buffOuter, bool largeRaster, std::string tempFolder, int xBlockSize, int yBlockSize)
 ~Access ()

Public Attributes

bool used = false
double area = -1
GDALDataset * p_dataset = nullptr
helper::RasterBandMetaData band

Detailed Description

This Struct controls the creation and storage of access networks for use in sampling functions.

Constructor & Destructor Documentation

◆ Access()

sgs::access::Access::Access ( vector::GDALVectorWrapper * p_vector,
raster::GDALRasterWrapper * p_raster,
std::string layerName,
double buffInner,
double buffOuter,
bool largeRaster,
std::string tempFolder,
int xBlockSize,
int yBlockSize )
inline

This constructor is responsible for setting the used, area, p_dataset, and band members of this struct. In the case where an access vector is given, the dataset which contain a raster dataset with a rasterized version of the access, where a pixel is '1' if it falls within accessible area.

First, if p_vector is not given, then the 'used' member remains false.

If p_vector is given, it is checked to ensure it has the same spatial reference system as the p_raster. Polygons are created such that The polygons contain the accessible area. This is done by buffering the linestrings in the access vector using buff_outer, and removing the buff_inner buffer.

A vector is created usign the output polygons from this calculation. Then, GDALRasterize() is called specifying: -at (all touched – sets all pixels touched by polygon) -burn 1 (setting the burn value to 1) -l access (specifying the layer name in the polygon dataset as 'access') -te {xmin} {ymin} {xmax} {ymax} (setting the extent to the raster extent) -ts {width} {height} (setting the dimensions to the raster dimensions) -ot Int8 (setting the output type to int8_t)

The resulting raster dataset created by the GDALRasterize() function is then checked by sampling functions to ensure their samples fall within accessible areas. The 'band' parameter's metadata is set according to the output raster dataset.

Parameters
GDALVectorWrapper*p_vector
GDALRasterWrapper*p_raster
std::stringlayerName
doublebuffInner
doublebuffOuter
boollargeRaster
std::stringtempFolder
intxBlockSize
intyBlockSize

◆ ~Access()

sgs::access::Access::~Access ( )
inline

Member Data Documentation

◆ area

double sgs::access::Access::area = -1

◆ band

helper::RasterBandMetaData sgs::access::Access::band

◆ p_dataset

GDALDataset* sgs::access::Access::p_dataset = nullptr

◆ used

bool sgs::access::Access::used = false

The documentation for this struct was generated from the following file: