GEOS
3.9.1dev
|
A simple elevation model used to populate missing Z values in overlay results. More...
#include <ElevationModel.h>
Classes | |
class | ElevationCell |
Public Member Functions | |
ElevationModel (const geom::Envelope &extent, int numCellX, int numCellY) | |
void | add (const geom::Geometry &geom) |
double | getZ (double x, double y) |
void | populateZ (geom::Geometry &geom) |
Computes Z values for any missing Z values in a geometry, using the computed model. More... | |
Static Public Member Functions | |
static std::unique_ptr< ElevationModel > | create (const geom::Geometry &geom1, const geom::Geometry &geom2) |
static std::unique_ptr< ElevationModel > | create (const geom::Geometry &geom1) |
Protected Member Functions | |
void | add (double x, double y, double z) |
Private Member Functions | |
void | init () |
ElevationCell & | getCell (double x, double y) |
int | getCellOffset (int ix, int iy) |
Private Attributes | |
geom::Envelope | extent |
int | numCellX |
int | numCellY |
double | cellSizeX |
double | cellSizeY |
std::vector< ElevationCell > | cells |
bool | isInitialized = false |
bool | hasZValue = false |
double | averageZ = DoubleNotANumber |
Static Private Attributes | |
static const int | DEFAULT_CELL_NUM |
A simple elevation model used to populate missing Z values in overlay results.
The model divides the extent of the input geometry(s) into an NxM grid. The default grid size is 3x3. If the input has no extent in the X or Y dimension, that dimension is given grid size 1. The elevation of each grid cell is computed as the average of the Z values of the input vertices in that cell (if any). If a cell has no input vertices within it, it is assigned the average elevation over all cells.
If no input vertices have Z values, the model does not assign a Z value.
The elevation of an arbitrary location is determined as the Z value of the nearest grid cell.
An elevation model can be used to populate missing Z values in an overlay result geometry.
Definition at line 65 of file ElevationModel.h.
geos::operation::overlayng::ElevationModel::ElevationModel | ( | const geom::Envelope & | extent, |
int | numCellX, | ||
int | numCellY | ||
) |
|
protected |
void geos::operation::overlayng::ElevationModel::add | ( | const geom::Geometry & | geom | ) |
|
static |
|
static |
|
private |
|
inlineprivate |
Definition at line 118 of file ElevationModel.h.
double geos::operation::overlayng::ElevationModel::getZ | ( | double | x, |
double | y | ||
) |
Gets the model Z value at a given location. If the location lies outside the model grid extent, this returns the Z value of the nearest grid cell. If the model has no elevation computed (i.e. due to empty input), the value is returned as a double NaN.
x | the x ordinate of the location |
y | the y ordinate of the location |
|
private |
void geos::operation::overlayng::ElevationModel::populateZ | ( | geom::Geometry & | geom | ) |
Computes Z values for any missing Z values in a geometry, using the computed model.
If the model has no Z value, or the geometry coordinate dimension does not include Z, no action is taken.
geom | the geometry to elevate |
|
private |
Definition at line 112 of file ElevationModel.h.
|
private |
Definition at line 109 of file ElevationModel.h.
|
private |
Definition at line 107 of file ElevationModel.h.
|
private |
Definition at line 108 of file ElevationModel.h.
|
staticprivate |
Definition at line 103 of file ElevationModel.h.
|
private |
Definition at line 104 of file ElevationModel.h.
|
private |
Definition at line 111 of file ElevationModel.h.
|
private |
Definition at line 110 of file ElevationModel.h.
|
private |
Definition at line 105 of file ElevationModel.h.
|
private |
Definition at line 106 of file ElevationModel.h.