|
sgsPy
structurally guided sampling
|
#include <existing.h>
Public Member Functions | |
| Existing (vector::GDALVectorWrapper *p_vect, raster::GDALRasterWrapper *p_rast, double *GT, int64_t width, OGRLayer *p_samples, bool plot, std::vector< double > &xCoords, std::vector< double > &yCoords, bool addAllPoints=true) | |
| bool | containsIndex (int64_t x, int64_t y) |
| OGRPoint | getPoint (int64_t x, int64_t y) |
| bool | containsCoordinates (double xCoord, double yCoord) |
| size_t | count () |
Public Attributes | |
| bool | used |
| boost::unordered::unordered_flat_map< int64_t, OGRPoint > | samples |
| double | IGT [6] |
| int64_t | width |
This struct handles existing sample plot points. It has a constructor which takes a GDALVectorWrapper, geotransform, and width of the raster as parameters.
The points are stored within an unordered map. This map can then be checked to see if it contains particular index values.
|
inline |
Constructor for the Existing struct.
First, check to ensure the GDALRasterWrapper isn't a null pointer.
Calculates the inverse geotransform of the given transform, using GDAL's inv_geotransform function.
Iterates through the features of the input vector. Every feature must be either a Point or a MultiPoint. Every point is converted from their x and y coordinates to a single index value, which is then stored in an unordered map. The existing points are also added to the output layer.
The width of the raster is used to calculate this final index value.
| GDALVectorWrapper | *p_vect |
| double | *GT |
| int64_t | width |
| OGRLayer | *p_samples |
| bool | plot |
| std::vector<double>& | xCoords |
| std::vector<double>& | yCoords |
|
inline |
Checker function which converts x coordinate and y coordinate values to an index usign the inverse geotransform.
If this index is contained in the samples unordered_map, True is returned, otherwise the result will be false.
| double | xCoord |
| double | yCoord |
|
inline |
Checker function which converts x and y indices values to a single index value. If this index is contained in the samples unordered_map, True is returned, otherwise the result will be false.
This function will be used when determining sample plot placement, when iterating through an input raster.
| int64_t | x |
| int64_t | y |
|
inline |
Get the number of existing sample points.
|
inline |
if the map has already been checked, gets the OGRPoint which is associated with a particular value.
| int64_t | x |
| int64_t | y |
| double sgs::existing::Existing::IGT[6] |
| boost::unordered::unordered_flat_map<int64_t, OGRPoint> sgs::existing::Existing::samples |
| bool sgs::existing::Existing::used |
| int64_t sgs::existing::Existing::width |