|
SAGA API
v9.6
|
Go to the documentation of this file.
51 #ifndef HEADER_INCLUDED__SAGA_API__grid_H
52 #define HEADER_INCLUDED__SAGA_API__grid_H
128 SG_T(
"DATAFILE_NAME"),
129 SG_T(
"DATAFILE_OFFSET"),
131 SG_T(
"BYTEORDER_BIG"),
132 SG_T(
"POSITION_XMIN"),
133 SG_T(
"POSITION_YMIN"),
139 SG_T(
"NODATA_VALUE"),
144 #define GRID_FILE_KEY_TRUE SG_T("TRUE")
145 #define GRID_FILE_KEY_FALSE SG_T("FALSE")
208 bool Create (
double Cellsize,
const CSG_Rect &Extent,
int Precision = -1);
210 CSG_Grid_System (
double Cellsize,
double xMin,
double yMin,
double xMax,
double yMax,
int Precision = -1);
211 bool Create (
double Cellsize,
double xMin,
double yMin,
double xMax,
double yMax,
int Precision = -1);
213 CSG_Grid_System (
double Cellsize,
double xMin,
double yMin,
int NX,
int NY,
int Precision = -1);
214 bool Create (
double Cellsize,
double xMin,
double yMin,
int NX,
int NY,
int Precision = -1);
222 bool Assign (
double Cellsize,
const CSG_Rect &Extent);
223 bool Assign (
double Cellsize,
double xMin,
double yMin,
double xMax,
double yMax);
224 bool Assign (
double Cellsize,
double xMin,
double yMin,
int NX,
int NY);
227 bool is_Valid (
void)
const;
229 const SG_Char * Get_Name (
bool bShort =
true);
234 int Get_NX (
void)
const {
return( m_NX ); }
235 int Get_NY (
void)
const {
return( m_NY ); }
238 const CSG_Rect &
Get_Extent (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells : m_Extent ); }
240 double Get_XMin (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_XMin () : m_Extent.Get_XMin () ); }
241 double Get_XMax (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_XMax () : m_Extent.Get_XMax () ); }
242 double Get_XRange (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_XRange() : m_Extent.Get_XRange() ); }
244 double Get_YMin (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_YMin () : m_Extent.Get_YMin () ); }
245 double Get_YMax (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_YMax () : m_Extent.Get_YMax () ); }
246 double Get_YRange (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_YRange() : m_Extent.Get_YRange() ); }
256 bool is_Equal (
double Cellsize,
const TSG_Rect &Extent)
const;
261 double Fit_xto_Grid_System (
double x)
const {
return( Get_XMin() + m_Cellsize * Get_xWorld_to_Grid(x) ); }
264 double Fit_yto_Grid_System (
double y)
const {
return( Get_YMin() + m_Cellsize * Get_yWorld_to_Grid(y) ); }
269 ptWorld.
x = Fit_xto_Grid_System(ptWorld.
x);
270 ptWorld.
y = Fit_yto_Grid_System(ptWorld.
y);
284 pt.
x = Get_xGrid_to_World(xGrid);
285 pt.
y = Get_yGrid_to_World(yGrid);
292 int Get_xWorld_to_Grid (
double xWorld)
const {
return( (
int)floor(0.5 + (xWorld - Get_XMin()) / m_Cellsize) ); }
293 int Get_yWorld_to_Grid (
double yWorld)
const {
return( (
int)floor(0.5 + (yWorld - Get_YMin()) / m_Cellsize) ); }
297 return( is_InGrid(xGrid = Get_xWorld_to_Grid(xWorld), yGrid = Get_yWorld_to_Grid(yWorld)) );
302 return( is_InGrid(xGrid = Get_xWorld_to_Grid(ptWorld.
x), yGrid = Get_yWorld_to_Grid(ptWorld.
y)) );
309 return( is_InGrid(xPos = Get_xTo(Direction, x), yPos = Get_yTo(Direction, y)) );
314 static int ix[8] = { 0, 1, 1, 1, 0,-1,-1,-1 };
323 return( x + ix[Direction] );
328 static int iy[8] = { 1, 1, 0,-1,-1,-1, 0, 1 };
337 return( y + iy[Direction] );
340 static int Get_xFrom (
int Direction,
int x = 0) {
return( Get_xTo(Direction + 4, x) ); }
341 static int Get_yFrom (
int Direction,
int y = 0) {
return( Get_yTo(Direction + 4, y) ); }
343 int Get_xToSave (
int Direction,
int x)
const {
return( (x = Get_xTo (Direction, x)) < 0 ? 0 : (x >= m_NX ? m_NX - 1 : x) ); }
344 int Get_yToSave (
int Direction,
int y)
const {
return( (y = Get_yTo (Direction, y)) < 0 ? 0 : (y >= m_NY ? m_NY - 1 : y) ); }
345 int Get_xFromSave (
int Direction,
int x)
const {
return( (x = Get_xFrom(Direction, x)) < 0 ? 0 : (x >= m_NX ? m_NX - 1 : x) ); }
346 int Get_yFromSave (
int Direction,
int y)
const {
return( (y = Get_yFrom(Direction, y)) < 0 ? 0 : (y >= m_NY ? m_NY - 1 : y) ); }
348 bool is_InGrid (
int x,
int y)
const {
return( x >= 0 && x < m_NX && y >= 0 && y < m_NY ); }
349 bool is_InGrid (
int x,
int y,
int Rand)
const {
return( x >= Rand && x < m_NX - Rand && y >= Rand && y < m_NY - Rand ); }
351 double Get_Length (
int Direction)
const {
return( Direction % 2 ? m_Diagonal : m_Cellsize ); }
352 static double Get_UnitLength (
int Direction) {
return( Direction % 2 ? sqrt(2.0) : 1.0 ); }
354 static int Set_Precision (
int Decimals);
355 static int Get_Precision (
void);
361 return( (
sLong)y * m_NX + x );
387 double m_Cellsize, m_Cellarea, m_Diagonal;
393 static int m_Precision;
429 bool Save (
const CSG_String &File ,
bool bBinary =
true);
430 bool Save (
const CSG_File &Stream,
bool bBinary =
true);
432 static bool Save (
const CSG_String &File ,
const CSG_Grid &Grid,
bool bBinary =
true);
433 static bool Save (
const CSG_File &Stream,
const CSG_Grid &Grid,
bool bBinary =
true);
436 bool Save_AUX_XML (
CSG_File &Stream);
456 void _On_Construction (
void);
498 CSG_Grid (
TSG_Data_Type Type,
int NX,
int NY,
double Cellsize = 1.0,
double xMin = 0.0,
double yMin = 0.0,
bool bCached =
false);
499 bool Create (
TSG_Data_Type Type,
int NX,
int NY,
double Cellsize = 1.0,
double xMin = 0.0,
double yMin = 0.0,
bool bCached =
false);
510 virtual bool Save (
const wchar_t *File,
int Format = 0) {
return(
Save(
CSG_String(File), Format) ); }
537 int Get_NX (
void)
const {
return( m_System.Get_NX() ); }
538 int Get_NY (
void)
const {
return( m_System.Get_NY() ); }
541 double Get_Cellsize (
void)
const {
return( m_System.Get_Cellsize() ); }
542 double Get_Cellarea (
void)
const {
return( m_System.Get_Cellarea() ); }
546 double Get_XMin (
bool bCells =
false)
const {
return( m_System.Get_XMin (bCells) ); }
547 double Get_XMax (
bool bCells =
false)
const {
return( m_System.Get_XMax (bCells) ); }
548 double Get_XRange (
bool bCells =
false)
const {
return( m_System.Get_XRange(bCells) ); }
550 double Get_YMin (
bool bCells =
false)
const {
return( m_System.Get_YMin (bCells) ); }
551 double Get_YMax (
bool bCells =
false)
const {
return( m_System.Get_YMax (bCells) ); }
552 double Get_YRange (
bool bCells =
false)
const {
return( m_System.Get_YRange(bCells) ); }
558 void Set_Scaling (
double Scale = 1.0,
double Offset = 0.0);
559 double Get_Scaling (
void)
const;
560 double Get_Offset (
void)
const;
561 bool is_Scaled (
void)
const {
return( m_zScale != 1.0 || m_zOffset != 0.0 ); }
563 double Get_Mean (
void);
564 double Get_Min (
void);
565 double Get_Max (
void);
566 double Get_Range (
void);
567 double Get_StdDev (
void);
568 double Get_Variance (
void);
569 double Get_Quantile (
double Quantile,
bool bFromHistogram =
true);
570 double Get_Percentile (
double Percentile,
bool bFromHistogram =
true);
578 sLong Get_Data_Count (
void);
579 sLong Get_NoData_Count (
void);
589 TSG_Intersection is_Intersecting (
double xMin,
double yMin,
double xMax,
double yMax)
const;
591 bool is_Compatible (
CSG_Grid *pGrid)
const;
593 bool is_Compatible (
int NX,
int NY,
double Cellsize,
double xMin,
double yMin)
const;
595 bool is_InGrid (
int x,
int y,
bool bCheckNoData =
true)
const {
return( m_System.is_InGrid(x, y) && (!bCheckNoData || !is_NoData(x, y)) ); }
596 bool is_InGrid_byPos (
double x,
double y,
bool bCheckNoData =
true)
const {
return(
Get_Extent(
true).Contains(x, y) && (!bCheckNoData || !is_NoData(m_System.Get_xWorld_to_Grid(x), m_System.Get_yWorld_to_Grid(y))) ); }
606 bool Set_Cache (
bool bOn);
607 bool is_Cached (
void)
const {
return( m_Cache_Stream != NULL ); }
613 void Assign_NoData (
void);
615 virtual bool Assign (
double Value = 0.0);
623 bool Normalise (
void);
624 bool DeNormalise (
double Minimum,
double Maximum);
626 bool Standardise (
void);
627 bool DeStandardise (
double Mean,
double StdDev);
629 int Get_Gradient_NeighborDir (
int x,
int y,
bool bDown =
true,
bool bNoEdges =
true)
const;
630 bool Get_Gradient (
int x,
int y ,
double &Slope,
double &Aspect)
const;
631 bool Get_Gradient (
double x,
double y,
double &Slope,
double &Aspect,
TSG_Grid_Resampling Interpolation)
const;
661 return( _Get_Index() );
666 if( Position >= 0 && Position < Get_NCells() && _Get_Index() )
668 Position = m_Index[bDown ? Get_NCells() - Position - 1 : Position];
670 if( !bCheckNoData || !is_NoData(Position) )
681 return( (i = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 );
684 bool Get_Sorted (
sLong Position,
int &x,
int &y,
bool bDown =
true,
bool bCheckNoData =
true)
686 if( (Position = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 )
688 x = (int)(Position % Get_NX());
689 y = (int)(Position / Get_NX());
712 virtual CSG_Grid & operator = (
double Value);
717 virtual CSG_Grid & operator += (
double Value);
719 virtual CSG_Grid & Add (
double Value);
722 virtual CSG_Grid operator - (
double Value)
const;
724 virtual CSG_Grid & operator -= (
double Value);
726 virtual CSG_Grid & Subtract (
double Value);
731 virtual CSG_Grid & operator *= (
double Value);
733 virtual CSG_Grid & Multiply (
double Value);
736 virtual CSG_Grid operator / (
double Value)
const;
738 virtual CSG_Grid & operator /= (
double Value);
740 virtual CSG_Grid & Divide (
double Value);
742 virtual double operator () (
int x,
int y)
const {
return( asDouble(x, y) ); }
759 virtual int asInt (
int x,
int y,
bool bScaled =
true)
const {
return(
SG_ROUND_TO_INT (asDouble(x, y, bScaled)) ); }
763 virtual float asFloat (
int x,
int y,
bool bScaled =
true)
const {
return( (
float) (asDouble(x, y, bScaled)) ); }
764 virtual float asFloat (
sLong i,
bool bScaled =
true)
const {
return( (
float) (asDouble( i, bScaled)) ); }
769 return( asDouble((
int)(i % Get_NX()), (
int)(i / Get_NX()), bScaled) );
772 virtual double asDouble(
int x,
int y,
bool bScaled =
true)
const
778 Value = _Cache_Get_Value(x, y);
780 else switch( m_Type )
789 case SG_DATATYPE_Int : Value = (double)((
int **)m_Values)[y][x];
break;
792 case SG_DATATYPE_Bit : Value = (double)(((BYTE **)m_Values)[y][x / 8] & m_Bitmask[x % 8]) == 0 ? 0.0 : 1.0;
break;
798 if( bScaled && is_Scaled() )
800 Value = m_zOffset + m_zScale * Value;
810 virtual void Add_Value(
int x,
int y,
double Value) { Set_Value(x, y, asDouble(x, y) + Value ); }
811 virtual void Add_Value(
sLong i,
double Value) { Set_Value( i, asDouble( i) + Value ); }
813 virtual void Mul_Value(
int x,
int y,
double Value) { Set_Value(x, y, asDouble(x, y) * Value ); }
814 virtual void Mul_Value(
sLong i,
double Value) { Set_Value( i, asDouble( i) * Value ); }
819 Set_Value((
int)(i % Get_NX()), (
int)(i / Get_NX()), Value, bScaled);
822 virtual void Set_Value(
int x,
int y,
double Value,
bool bScaled =
true)
824 if( bScaled && is_Scaled() )
826 Value = (Value - m_zOffset) / m_zScale;
831 _Cache_Set_Value(x, y, Value);
833 else switch( m_Type )
846 ? ((BYTE **)m_Values)[y][x / 8] | m_Bitmask[x % 8]
847 : ((BYTE **)m_Values)[y][x / 8] & (~m_Bitmask[x % 8]);
859 bool Set_Row (
int y,
const CSG_Vector &Values);
875 bool m_Cache_bTemp, m_Cache_bSwap, m_Cache_bFlip;
877 size_t m_nBytes_Value, m_nBytes_Line;
879 sLong *m_Index, m_Cache_Offset;
881 double m_zOffset, m_zScale;
883 FILE *m_Cache_Stream;
897 static BYTE m_Bitmask[8];
901 void _On_Construction (
void);
903 bool _Set_Index (
void);
904 bool _Get_Index (
void)
911 return( m_Index || _Set_Index() );
918 bool _Memory_Create (
bool bCached);
919 void _Memory_Destroy (
void);
921 bool _Array_Create (
void);
922 void _Array_Destroy (
void);
924 bool _Cache_Check (
void);
926 bool _Cache_Create (
void);
927 bool _Cache_Destroy (
bool bMemory_Restore);
928 void _Cache_Set_Value (
int x,
int y,
double Value);
929 double _Cache_Get_Value (
int x,
int y)
const;
935 void _Swap_Bytes (
char *Bytes,
int nBytes)
const;
937 bool _Load_External (
const CSG_String &File,
bool bCached,
bool bLoadData);
938 bool _Load_PGSQL (
const CSG_String &File,
bool bCached,
bool bLoadData);
940 bool _Load_Native (
const CSG_String &File,
bool bCached,
bool bLoadData);
943 bool _Load_Compressed (
const CSG_String &File,
bool bCached,
bool bLoadData);
944 bool _Save_Compressed (
const CSG_String &File);
948 bool _Load_ASCII (
CSG_File &Stream,
bool bCached,
bool bFlip =
false);
949 bool _Save_ASCII (
CSG_File &Stream,
bool bFlip =
false);
951 bool _Load_Surfer (
const CSG_String &File,
bool bCached,
bool bLoadData);
959 bool _Assign_MeanValue (
CSG_Grid *pSource,
bool bAreaProportional);
960 bool _Assign_ExtremeValue (
CSG_Grid *pSource,
bool bMaximum);
961 bool _Assign_Majority (
CSG_Grid *pSource);
967 bool _Get_ValAtPos_NearestNeighbour (
double &Value,
int x,
int y,
double dx,
double dy )
const;
968 bool _Get_ValAtPos_BiLinear (
double &Value,
int x,
int y,
double dx,
double dy,
bool bByteWise)
const;
969 bool _Get_ValAtPos_BiCubicSpline (
double &Value,
int x,
int y,
double dx,
double dy,
bool bByteWise)
const;
970 bool _Get_ValAtPos_BSpline (
double &Value,
int x,
int y,
double dx,
double dy,
bool bByteWise)
const;
972 double _Get_ValAtPos_BiCubicSpline (
double dx,
double dy,
double z_xy[4][4])
const;
973 double _Get_ValAtPos_BSpline (
double dx,
double dy,
double z_xy[4][4])
const;
975 bool _Get_ValAtPos_Fill4x4Submatrix (
int x,
int y,
double z_xy[4][4] )
const;
976 bool _Get_ValAtPos_Fill4x4Submatrix (
int x,
int y,
double z_xy[4][4][4])
const;
988 #define SG_GRID_PTR_SAFE_SET_NODATA(g, x, y) { if( g && g->is_InGrid(x, y, false) ) { g->Set_NoData(x, y ); } }
989 #define SG_GRID_PTR_SAFE_SET_VALUE(g, x, y, z) { if( g && g->is_InGrid(x, y, false) ) { g->Set_Value (x, y, z); } }
1067 virtual bool Pop (
int &x,
int &y)
1092 #define SG_GRIDCELLADDR_PARM_SQUARE 0x01
1093 #define SG_GRIDCELLADDR_PARM_CIRCLE 0x02
1094 #define SG_GRIDCELLADDR_PARM_ANNULUS 0x04
1095 #define SG_GRIDCELLADDR_PARM_SECTOR 0x08
1096 #define SG_GRIDCELLADDR_PARM_SIZEDBL 0x10
1097 #define SG_GRIDCELLADDR_PARM_MAPUNIT 0x20
1098 #define SG_GRIDCELLADDR_PARM_WEIGHTING 0x40
1099 #define SG_GRIDCELLADDR_PARM_DEFAULT (SG_GRIDCELLADDR_PARM_SQUARE|SG_GRIDCELLADDR_PARM_CIRCLE)
1107 bool Destroy (
void);
1109 static bool Enable_Parameters (
class CSG_Parameters &Parameters);
1111 bool Set_Parameters (
class CSG_Parameters &Parameters,
int Type = 0);
1125 bool Set_Radius (
double Radius,
bool bSquare =
false);
1126 bool Set_Square (
double Radius);
1127 bool Set_Circle (
double Radius);
1128 bool Set_Annulus (
double Radius_Inner,
double Radius_Outer);
1129 bool Set_Sector (
double Radius,
double Direction,
double Tolerance);
1131 double Get_Radius (
bool bOuter =
true)
const {
return( bOuter ? m_Radius : m_Radius_0 ); }
1137 int Get_Count (
void)
const {
return( (
int)m_Kernel.Get_Count() ); }
1138 int Get_X (
int Index,
int Offset = 0)
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asInt (0) + Offset : Offset ); }
1139 int Get_Y (
int Index,
int Offset = 0)
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asInt (1) + Offset : Offset ); }
1140 double Get_Distance (
int Index )
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asDouble(2) : -1. ); }
1141 double Get_Weight (
int Index )
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asDouble(3) : 0. ); }
1142 bool Get_Values (
int Index,
int &x,
int &y,
double &Distance,
double &Weight,
bool bOffset =
false)
const
1144 if( Index >= 0 && Index < m_Kernel.Get_Count() )
1148 x = bOffset ? x + Cell.
asInt(0) : Cell.
asInt(0);
1149 y = bOffset ? y + Cell.
asInt(1) : Cell.
asInt(1);
1164 double m_Radius, m_Radius_0, m_Direction, m_Tolerance;
1171 bool _Set_Kernel (
int Type,
double Radius,
double Radius_Inner,
double Direction,
double Tolerance);
1183 #endif // #ifndef HEADER_INCLUDED__SAGA_API__grid_H
sLong Get_IndexFromRowCol(int x, int y) const
TSG_Data_Type Get_Type(void) const
double Get_xGrid_to_World(int xGrid) const
double asDouble(int Field) const
virtual bool Assign(CSG_Data_Object *pObject)
virtual void Add_Value(int x, int y, double Value)
bool is_InGrid(int x, int y, bool bCheckNoData=true) const
static int Get_xTo(int Direction, int x=0)
#define SG_FREE_SAFE(PTR)
@ GRID_RESAMPLING_NearestNeighbour
double Get_Cellsize(void) const
@ GRID_FILE_KEY_DESCRIPTION
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Mode(int Mode)
virtual bool On_Reload(void)=0
virtual TSG_Data_Object_Type Get_ObjectType(void) const
virtual bool On_Delete(void)=0
double Get_Radius_Inner(void) const
double Get_Tolerance(void) const
bool Update(bool bForce=false)
bool is_InGrid_byPos(double x, double y, bool bCheckNoData=true) const
bool is_Scaled(void) const
@ GRID_RESAMPLING_BicubicSpline
virtual double asDouble(int x, int y, bool bScaled=true) const
virtual char asChar(sLong i, bool bScaled=true) const
double Get_XMin(bool bCells=false) const
SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid(void)
int Get_nLineBytes(void) const
double Get_NoData_Value(bool bUpper=false) const
@ GRID_FILE_FORMAT_Compressed
void * Get_Record_Pop(void)
@ GRID_FILE_FORMAT_Undefined
@ GRID_FILE_KEY_BYTEORDER_BIG
@ GRID_FILE_KEY_DATAFORMAT
int Get_nValueBytes(void) const
@ GRID_FILE_FORMAT_GeoTIFF
int Get_yWorld_to_Grid(double yWorld) const
bool is_NoData_Value(double Value) const
@ GRID_FILE_KEY_POSITION_YMIN
@ GRID_RESAMPLING_Undefined
bool is_InGrid_byPos(const TSG_Point &p, bool bCheckNoData=true) const
virtual bool Save(const CSG_String &File, int Format=0)=0
@ GRID_OPERATION_Multiplication
double Get_yGrid_to_World(int yGrid) const
static int Get_yTo(int Direction, int y=0)
@ GRID_RESAMPLING_Maximum
virtual bool is_NoData(sLong i) const
virtual void Mul_Value(int x, int y, double Value)
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Directory(const SG_Char *Directory)
@ GRID_FILE_KEY_NODATA_VALUE
@ GRID_OPERATION_Subtraction
double Get_Weight(int Index) const
bool is_Sector(void) const
void * Get_Record(size_t i) const
void Set_Update_Flag(bool bOn=true)
const CSG_Grid_System & Get_System(void) const
double Get_XRange(bool bCells=false) const
int Get_Count(void) const
@ GRID_OPERATION_Addition
double Get_Cellarea(void) const
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold_MB(double nMegabytes)
virtual void Add_Value(sLong i, double Value)
#define SG_GRIDCELLADDR_PARM_DEFAULT
SAGA_API_DLL_EXPORT TSG_Grid_File_Format SG_Grid_Get_File_Format_Default(void)
double Get_YMin(bool bCells=false) const
double Get_Cellsize(void) const
const SG_Char gSG_Grid_File_Key_Names[GRID_FILE_KEY_Count][32]
@ GRID_RESAMPLING_Bilinear
bool Set_Index(bool bOn=true)
double Get_Cellarea(void) const
@ GRID_RESAMPLING_Mean_Cells
bool Get_World_to_Grid(int &xGrid, int &yGrid, TSG_Point ptWorld) const
int Get_yToSave(int Direction, int y) const
@ GRID_FILE_KEY_DATAFILE_NAME
double Get_YMax(bool bCells=false) const
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold(int nBytes)
CSG_Distance_Weighting & Get_Weighting(void)
SAGA_API_DLL_EXPORT CSG_String SG_Grid_Get_File_Extension_Default(void)
sLong Get_Memory_Size(void) const
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
virtual const CSG_Rect & Get_Extent(void)=0
SAGA_API_DLL_EXPORT bool SG_Grid_Set_File_Format_Default(int Format)
bool Get_Sorted(sLong Position, int &x, int &y, bool bDown=true, bool bCheckNoData=true)
virtual bool On_Update(void)
const CSG_String & Get_Unit(void) const
@ GRID_FILE_KEY_TOPTOBOTTOM
virtual void Mul_Value(sLong i, double Value)
double Get_XMin(bool bCells=false) const
virtual bool Save(const wchar_t *File, int Format=0)
TSG_Point Get_Grid_to_World(int xGrid, int yGrid) const
@ GRID_FILE_FORMAT_Binary_old
static double Get_UnitLength(int Direction)
double Get_Radius_Outer(void) const
CSG_Projection m_Projection
void * Get_Record_Push(void)
#define SAGA_API_DLL_EXPORT
bool is_InGrid(int x, int y) const
@ GRID_RESAMPLING_BSpline
double Fit_yto_Grid_System(double y) const
Aligns the world coordinate y to the columns of the grid system and returns it.
virtual void Set_Modified(bool bOn=true)
bool Get_Sorted(sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true)
virtual short asShort(int x, int y, bool bScaled=true) const
sLong Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true)
double Get_Length(int Direction) const
@ SG_DATAOBJECT_TYPE_Grid
double Get_XMax(bool bCells=false) const
static int Get_yFrom(int Direction, int y=0)
SAGA_API_DLL_EXPORT double SG_Grid_Cache_Get_Threshold_MB(void)
virtual void Set_NoData(sLong i)
SAGA_API_DLL_EXPORT const SG_Char * SG_Grid_Cache_Get_Directory(void)
double Get_Direction(void) const
SAGA_API_DLL_EXPORT int SG_Grid_Cache_Get_Mode(void)
const TSG_Point_Int & operator[](size_t i) const
int Get_xFromSave(int Direction, int x) const
virtual void Set_NoData(int x, int y)
bool Get_Update_Flag(void)
double Get_YRange(bool bCells=false) const
int Get_Y(int Index, int Offset=0) const
int asInt(int Field) const
virtual void Set_Value(int x, int y, double Value, bool bScaled=true)
virtual bool Save(const char *File, int Format=0)
const CSG_Rect & Get_Extent(bool bCells=false) const
@ GRID_OPERATION_Division
bool Get_Values(int Index, int &x, int &y, double &Distance, double &Weight, bool bOffset=false) const
SAGA_API_DLL_EXPORT sLong SG_Grid_Cache_Get_Threshold(void)
@ GRID_RESAMPLING_Majority
virtual sLong asLong(int x, int y, bool bScaled=true) const
@ GRID_RESAMPLING_Mean_Nodes
virtual double asDouble(sLong i, bool bScaled=true) const
int Get_X(int Index, int Offset=0) const
virtual float asFloat(int x, int y, bool bScaled=true) const
TSG_Point Fit_to_Grid_System(TSG_Point ptWorld) const
Aligns the world coordinate ptWorld to the rows and columns of the grid system and returns it.
bool is_Square(void) const
double Get_Memory_Size_MB(void) const
int Get_xWorld_to_Grid(double xWorld) const
static int Get_xFrom(int Direction, int x=0)
@ GRID_FILE_KEY_CELLCOUNT_X
const CSG_Rect & Get_Extent(bool bCells=false) const
bool is_Cached(void) const
bool Get_World_to_Grid(int &xGrid, int &yGrid, double xWorld, double yWorld) const
virtual bool Pop(int &x, int &y)
double Get_YRange(bool bCells=false) const
@ GRID_RESAMPLING_Minimum
double Get_XRange(bool bCells=false) const
double Get_Distance(int Index) const
virtual float asFloat(sLong i, bool bScaled=true) const
virtual sLong asLong(sLong i, bool bScaled=true) const
bool is_Annulus(void) const
virtual BYTE asByte(sLong i, bool bScaled=true) const
virtual BYTE asByte(int x, int y, bool bScaled=true) const
virtual bool Push(int x, int y)
bool Get_RowColFromIndex(int &x, int &y, sLong i) const
virtual char asChar(int x, int y, bool bScaled=true) const
double Get_Radius(bool bOuter=true) const
bool is_Circle(void) const
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
@ GRID_FILE_KEY_CELLCOUNT_Y
virtual short asShort(sLong i, bool bScaled=true) const
@ GRID_FILE_FORMAT_Binary
int Get_yFromSave(int Direction, int y) const
virtual bool is_NoData(int x, int y) const
@ GRID_FILE_KEY_POSITION_XMIN
bool Get_Neighbor_Pos(int Direction, int x, int y, int &xPos, int &yPos) const
virtual const CSG_Rect & Get_Extent(void)
double Fit_xto_Grid_System(double x) const
Aligns the world coordinate x to the rows of the grid system and returns it.
@ GRID_FILE_KEY_DATAFILE_OFFSET
double Get_YMin(bool bCells=false) const
int Get_xToSave(int Direction, int x) const
virtual bool Destroy(void)
virtual int asInt(int x, int y, bool bScaled=true) const
virtual bool is_Valid(void) const =0
double Get_XMax(bool bCells=false) const
sLong Get_NCells(void) const
virtual int asInt(sLong i, bool bScaled=true) const
sLong Get_NCells(void) const
bool is_InGrid(int x, int y, int Rand) const
double Get_YMax(bool bCells=false) const
virtual void Set_Modified(bool bModified=true)
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)