1.5.0
CCC
 
Polygons.hpp File Reference
#include "gstlearn_export.hpp"
#include "Polygon/PolyElem.hpp"
#include "Basic/VectorNumT.hpp"
#include "Basic/AStringable.hpp"
#include "Basic/ASerializable.hpp"
#include "Basic/CSVformat.hpp"

Classes

class  Polygons
 

Functions

GSTLEARN_EXPORT void db_polygon (Db *db, const Polygons *polygon, bool flag_sel=false, bool flag_period=false, bool flag_nested=false, const NamingConvention &namconv=NamingConvention("Polygon", true, true, true, ELoc::fromKey("SEL")))
 
GSTLEARN_EXPORT int dbPolygonDistance (Db *db, Polygons *polygon, double dmax, int scale, int polin, const NamingConvention &namconv=NamingConvention("Distance"))
 
GSTLEARN_EXPORT int db_selhull (Db *db1, Db *db2, double dilate=0., bool verbose=false, const NamingConvention &namconv=NamingConvention("Hull", true, true, true, ELoc::fromKey("SEL")))
 

Function Documentation

◆ db_polygon()

GSTLEARN_EXPORT void db_polygon ( Db db,
const Polygons polygon,
bool  flag_sel,
bool  flag_period,
bool  flag_nested,
const NamingConvention namconv 
)

Create a selection if the samples of a Db are inside Polygons

Parameters
[in]dbDb structure
[in]polygonPolygons structure
[in]flag_seltrue if previous selection must be taken into account
[in]flag_periodtrue if first coordinate is longitude (in degree) and must be cycled for the check
[in]flag_nestedOption for nested polyelems (see details)
[in]namconvNaming Convention
Remarks
If flag_nested=true, a sample is masked off if the number of
polyelems to which it belongs is odd
If flag_nested=false, a sample is masked off as soon as it
belongs to one polyelem
The Naming Convention locator Type is overwritten to ELoc::SEL

◆ db_selhull()

GSTLEARN_EXPORT int db_selhull ( Db db1,
Db db2,
double  dilate,
bool  verbose,
const NamingConvention namconv 
)

Select samples from a file according to the 2-D convex hull computed over the active samples of a second file

Returns
Error returned code
Parameters
[in]db1descriptor of the Db serving for convex hull calculation
[in]db2descriptor of the Db where the mask must be stored
[in]dilateRadius of the dilation
[in]verboseVerbose flag
[in]namconvNaming convention
Remarks
The Naming Convention locator Type is overwritten to ELoc::SEL

◆ dbPolygonDistance()

GSTLEARN_EXPORT int dbPolygonDistance ( Db db,
Polygons polygon,
double  dmax,
int  scale,
int  polin,
const NamingConvention namconv 
)

Determine the distance to a polyline

Returns
Error returned code
Parameters
[in]dbDb structure
[in]polygonPolygons structure
[in]dmaxMaximum distance
[in]scaleScaling option 0 : no scaling >0 : scaling between 0 and 1 <0 : scaling between 1 and 0
[in]polinOption for checking against the polygon 0 : no check >0 : if sample is outside polygon, return TEST <0 : if sample is inside polygon, return TEST
[in]namconvNaming convention
Remarks
When patching values with respect to the polygon, when abs(polin):
1 : put NA
2 : put minimum distance
3 : put maximum distance