gstlearn  1.0.0
CCC
Polygons.cpp File Reference
#include "geoslib_old_f.h"
#include "Db/Db.hpp"
#include "Basic/AStringable.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/ASerializable.hpp"
#include "Basic/CSVformat.hpp"
#include "Basic/AException.hpp"
#include "Polygon/Polygons.hpp"

Functions

int dbPolygonDistance (Db *db, Polygons *polygon, double dmax, int scale, int polin, const NamingConvention &namconv)
 
void db_polygon (Db *db, Polygons *polygon, bool flag_sel, bool flag_period, bool flag_nested, const NamingConvention &namconv)
 
int db_selhull (Db *db1, Db *db2, double dilate, bool verbose, const NamingConvention &namconv)
 

Function Documentation

◆ db_polygon()

void db_polygon ( Db db,
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()

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()

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