 |
SAGA API
v9.9
|
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")
157 NearestNeighbour = 0x001,
170 Interpolations = NearestNeighbour|Bilinear|Bicubic_1|Bicubic_2,
171 Means = Mean_Nodes|Mean_Cells,
173 Aggregations = Means|Extremes|Majority,
174 All = Interpolations|Aggregations,
179 #define GRID_RESAMPLING_NearestNeighbour CSG_Grid_Resampling::NearestNeighbour
180 #define GRID_RESAMPLING_Bilinear CSG_Grid_Resampling::Bilinear
181 #define GRID_RESAMPLING_BicubicSpline CSG_Grid_Resampling::Bicubic_1
182 #define GRID_RESAMPLING_BSpline CSG_Grid_Resampling::Bicubic_2
183 #define GRID_RESAMPLING_Mean_Nodes CSG_Grid_Resampling::Mean_Nodes
184 #define GRID_RESAMPLING_Mean_Cells CSG_Grid_Resampling::Mean_Cells
185 #define GRID_RESAMPLING_Minimum CSG_Grid_Resampling::Minimum
186 #define GRID_RESAMPLING_Maximum CSG_Grid_Resampling::Maximum
187 #define GRID_RESAMPLING_Majority CSG_Grid_Resampling::Majority
188 #define GRID_RESAMPLING_Undefined CSG_Grid_Resampling::Undefined
189 #define TSG_Grid_Resampling CSG_Grid_Resampling
228 bool Create (
double Cellsize,
const CSG_Rect &Extent,
int Precision = -1);
230 CSG_Grid_System (
double Cellsize,
double xMin,
double yMin,
double xMax,
double yMax,
int Precision = -1);
231 bool Create (
double Cellsize,
double xMin,
double yMin,
double xMax,
double yMax,
int Precision = -1);
233 CSG_Grid_System (
double Cellsize,
double xMin,
double yMin,
int NX,
int NY,
int Precision = -1);
234 bool Create (
double Cellsize,
double xMin,
double yMin,
int NX,
int NY,
int Precision = -1);
237 bool Create (
const CSG_String &System,
int Precision = -1);
245 bool Assign (
double Cellsize,
const CSG_Rect &Extent);
246 bool Assign (
double Cellsize,
double xMin,
double yMin,
double xMax,
double yMax);
247 bool Assign (
double Cellsize,
double xMin,
double yMin,
int NX,
int NY);
250 bool is_Valid (
void)
const;
252 const SG_Char * Get_Name (
bool bShort =
true);
253 const SG_Char * asString (
void);
258 int Get_NX (
void)
const {
return( m_NX ); }
259 int Get_NY (
void)
const {
return( m_NY ); }
262 const CSG_Rect &
Get_Extent (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells : m_Extent ); }
264 double Get_XMin (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_XMin () : m_Extent.Get_XMin () ); }
265 double Get_XMax (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_XMax () : m_Extent.Get_XMax () ); }
266 double Get_XRange (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_XRange() : m_Extent.Get_XRange() ); }
268 double Get_YMin (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_YMin () : m_Extent.Get_YMin () ); }
269 double Get_YMax (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_YMax () : m_Extent.Get_YMax () ); }
270 double Get_YRange (
bool bCells =
false)
const {
return( bCells ? m_Extent_Cells.Get_YRange() : m_Extent.Get_YRange() ); }
282 bool is_Equal (
double Cellsize,
const TSG_Rect &Extent)
const;
287 double Fit_xto_Grid_System (
double x)
const {
return( Get_XMin() + m_Cellsize * Get_xWorld_to_Grid(x) ); }
290 double Fit_yto_Grid_System (
double y)
const {
return( Get_YMin() + m_Cellsize * Get_yWorld_to_Grid(y) ); }
295 ptWorld.
x = Fit_xto_Grid_System(ptWorld.
x);
296 ptWorld.
y = Fit_yto_Grid_System(ptWorld.
y);
310 pt.
x = Get_xGrid_to_World(xGrid);
311 pt.
y = Get_yGrid_to_World(yGrid);
318 int Get_xWorld_to_Grid (
double xWorld)
const {
return( (
int)floor(0.5 + (xWorld - Get_XMin()) / m_Cellsize) ); }
319 int Get_yWorld_to_Grid (
double yWorld)
const {
return( (
int)floor(0.5 + (yWorld - Get_YMin()) / m_Cellsize) ); }
323 return( is_InGrid(xGrid = Get_xWorld_to_Grid(xWorld), yGrid = Get_yWorld_to_Grid(yWorld)) );
328 return( is_InGrid(xGrid = Get_xWorld_to_Grid(ptWorld.
x), yGrid = Get_yWorld_to_Grid(ptWorld.
y)) );
335 return( is_InGrid(xPos = Get_xTo(Direction, x), yPos = Get_yTo(Direction, y)) );
340 static int ix[8] = { 0, 1, 1, 1, 0,-1,-1,-1 };
349 return( x + ix[Direction] );
354 static int iy[8] = { 1, 1, 0,-1,-1,-1, 0, 1 };
363 return( y + iy[Direction] );
366 static int Get_xFrom (
int Direction,
int x = 0) {
return( Get_xTo(Direction + 4, x) ); }
367 static int Get_yFrom (
int Direction,
int y = 0) {
return( Get_yTo(Direction + 4, y) ); }
369 int Get_xToSave (
int Direction,
int x)
const {
return( (x = Get_xTo (Direction, x)) < 0 ? 0 : (x >= m_NX ? m_NX - 1 : x) ); }
370 int Get_yToSave (
int Direction,
int y)
const {
return( (y = Get_yTo (Direction, y)) < 0 ? 0 : (y >= m_NY ? m_NY - 1 : y) ); }
371 int Get_xFromSave (
int Direction,
int x)
const {
return( (x = Get_xFrom(Direction, x)) < 0 ? 0 : (x >= m_NX ? m_NX - 1 : x) ); }
372 int Get_yFromSave (
int Direction,
int y)
const {
return( (y = Get_yFrom(Direction, y)) < 0 ? 0 : (y >= m_NY ? m_NY - 1 : y) ); }
374 bool is_InGrid (
int x,
int y)
const {
return( x >= 0 && x < m_NX && y >= 0 && y < m_NY ); }
375 bool is_InGrid (
int x,
int y,
int Rand)
const {
return( x >= Rand && x < m_NX - Rand && y >= Rand && y < m_NY - Rand ); }
377 double Get_Length (
int Direction)
const {
return( Direction % 2 ? m_Diagonal : m_Cellsize ); }
378 static double Get_UnitLength (
int Direction) {
return( Direction % 2 ? sqrt(2.) : 1. ); }
380 static int Set_Precision (
int Decimals);
381 static int Get_Precision (
void);
387 return( (
sLong)y * m_NX + x );
413 double m_Cellsize, m_Cellarea, m_Diagonal;
419 static int m_Precision;
455 bool Save (
const CSG_String &File ,
bool bBinary =
true);
456 bool Save (
const CSG_File &Stream,
bool bBinary =
true);
458 static bool Save (
const CSG_String &File ,
const CSG_Grid &Grid,
bool bBinary =
true);
459 static bool Save (
const CSG_File &Stream,
const CSG_Grid &Grid,
bool bBinary =
true);
462 bool Save_AUX_XML (
CSG_File &Stream);
482 void _On_Construction (
void);
524 CSG_Grid (
TSG_Data_Type Type,
int NX,
int NY,
double Cellsize = 1.,
double xMin = 0.,
double yMin = 0.,
bool bCached =
false);
525 bool Create (
TSG_Data_Type Type,
int NX,
int NY,
double Cellsize = 1.,
double xMin = 0.,
double yMin = 0.,
bool bCached =
false);
536 virtual bool Save (
const wchar_t *File,
int Format = 0) {
return(
Save(
CSG_String(File), Format) ); }
563 int Get_NX (
void)
const {
return( m_System.Get_NX() ); }
564 int Get_NY (
void)
const {
return( m_System.Get_NY() ); }
567 double Get_Cellsize (
void)
const {
return( m_System.Get_Cellsize() ); }
568 double Get_Cellarea (
void)
const {
return( m_System.Get_Cellarea() ); }
572 double Get_XMin (
bool bCells =
false)
const {
return( m_System.Get_XMin (bCells) ); }
573 double Get_XMax (
bool bCells =
false)
const {
return( m_System.Get_XMax (bCells) ); }
574 double Get_XRange (
bool bCells =
false)
const {
return( m_System.Get_XRange(bCells) ); }
576 double Get_YMin (
bool bCells =
false)
const {
return( m_System.Get_YMin (bCells) ); }
577 double Get_YMax (
bool bCells =
false)
const {
return( m_System.Get_YMax (bCells) ); }
578 double Get_YRange (
bool bCells =
false)
const {
return( m_System.Get_YRange(bCells) ); }
584 void Set_Scaling (
double Scale = 1.,
double Offset = 0.);
585 double Get_Scaling (
void)
const;
586 double Get_Offset (
void)
const;
587 bool is_Scaled (
void)
const {
return( m_zScale != 1. || m_zOffset != 0. ); }
589 double Get_Mean (
void);
590 double Get_Min (
void);
591 double Get_Max (
void);
592 double Get_Range (
void);
593 double Get_StdDev (
void);
594 double Get_Variance (
void);
595 double Get_Quantile (
double Quantile,
bool bFromHistogram =
true);
596 double Get_Percentile (
double Percentile,
bool bFromHistogram =
true);
604 sLong Get_Data_Count (
void);
605 sLong Get_NoData_Count (
void);
615 TSG_Intersection is_Intersecting (
double xMin,
double yMin,
double xMax,
double yMax)
const;
617 bool is_Compatible (
CSG_Grid *pGrid)
const;
619 bool is_Compatible (
int NX,
int NY,
double Cellsize,
double xMin,
double yMin)
const;
621 bool is_InGrid (
int x,
int y,
bool bCheckNoData =
true)
const {
return( m_System.is_InGrid(x, y) && (!bCheckNoData || !is_NoData(x, y)) ); }
622 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))) ); }
632 bool Set_Cache (
bool bOn);
633 bool is_Cached (
void)
const {
return( m_Cache_Stream != NULL ); }
639 bool Assign_NoData (
void);
641 virtual bool Assign (
double Value = 0.);
649 bool Normalise (
void);
650 bool DeNormalise (
double Minimum,
double Maximum);
652 bool Standardise (
void);
653 bool DeStandardise (
double Mean,
double StdDev);
655 int Get_Gradient_NeighborDir (
int x,
int y,
bool bDown =
true,
bool bNoEdges =
true)
const;
656 bool Get_Gradient (
int x,
int y ,
double &Slope,
double &Aspect)
const;
657 bool Get_Gradient (
double x,
double y,
double &Slope,
double &Aspect,
CSG_Grid_Resampling Interpolation)
const;
687 return( _Get_Index() );
692 if( Position >= 0 && Position < Get_NCells() && _Get_Index() )
694 Position = m_Index[bDown ? Get_NCells() - Position - 1 : Position];
696 if( !bCheckNoData || !is_NoData(Position) )
707 return( (i = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 );
710 bool Get_Sorted (
sLong Position,
int &x,
int &y,
bool bDown =
true,
bool bCheckNoData =
true)
712 if( (Position = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 )
714 x = (int)(Position % Get_NX());
715 y = (int)(Position / Get_NX());
738 virtual CSG_Grid & operator = (
double Value);
743 virtual CSG_Grid & operator += (
double Value);
745 virtual CSG_Grid & Add (
double Value);
748 virtual CSG_Grid operator - (
double Value)
const;
750 virtual CSG_Grid & operator -= (
double Value);
752 virtual CSG_Grid & Subtract (
double Value);
757 virtual CSG_Grid & operator *= (
double Value);
759 virtual CSG_Grid & Multiply (
double Value);
762 virtual CSG_Grid operator / (
double Value)
const;
764 virtual CSG_Grid & operator /= (
double Value);
766 virtual CSG_Grid & Divide (
double Value);
768 virtual double operator () (
int x,
int y)
const {
return( asDouble(x, y) ); }
774 double Get_Value (
double x,
double y,
CSG_Grid_Resampling Resampling = CSG_Grid_Resampling::Bicubic_2 ,
bool bByteWise =
false)
const;
776 bool Get_Value (
double x,
double y,
double &Value,
CSG_Grid_Resampling Resampling = CSG_Grid_Resampling::Bicubic_2,
bool bNoData =
false,
bool bByteWise =
false)
const;
777 bool Get_Value (
const TSG_Point &p,
double &Value,
CSG_Grid_Resampling Resampling = CSG_Grid_Resampling::Bicubic_2,
bool bNoData =
false,
bool bByteWise =
false)
const;
785 virtual int asInt (
int x,
int y,
bool bScaled =
true)
const {
return(
SG_ROUND_TO_INT (asDouble(x, y, bScaled)) ); }
789 virtual float asFloat (
int x,
int y,
bool bScaled =
true)
const {
return( (
float) (asDouble(x, y, bScaled)) ); }
790 virtual float asFloat (
sLong i,
bool bScaled =
true)
const {
return( (
float) (asDouble( i, bScaled)) ); }
795 return( asDouble((
int)(i % Get_NX()), (
int)(i / Get_NX()), bScaled) );
798 virtual double asDouble(
int x,
int y,
bool bScaled =
true)
const
804 Value = _Cache_Get_Value(x, y);
806 else switch( m_Type )
815 case SG_DATATYPE_Int : Value = (double)((
int **)m_Values)[y][x];
break;
818 case SG_DATATYPE_Bit : Value = (double)(((BYTE **)m_Values)[y][x / 8] & m_Bitmask[x % 8]) == 0 ? 0. : 1.;
break;
824 if( bScaled && is_Scaled() )
826 Value = m_zOffset + m_zScale * Value;
836 virtual void Add_Value(
int x,
int y,
double Value) { Set_Value(x, y, asDouble(x, y) + Value ); }
837 virtual void Add_Value(
sLong i,
double Value) { Set_Value( i, asDouble( i) + Value ); }
839 virtual void Mul_Value(
int x,
int y,
double Value) { Set_Value(x, y, asDouble(x, y) * Value ); }
840 virtual void Mul_Value(
sLong i,
double Value) { Set_Value( i, asDouble( i) * Value ); }
845 Set_Value((
int)(i % Get_NX()), (
int)(i / Get_NX()), Value, bScaled);
848 virtual void Set_Value(
int x,
int y,
double Value,
bool bScaled =
true)
850 if( bScaled && is_Scaled() )
852 Value = (Value - m_zOffset) / m_zScale;
857 _Cache_Set_Value(x, y, Value);
859 else switch( m_Type )
872 ? ((BYTE **)m_Values)[y][x / 8] | m_Bitmask[x % 8]
873 : ((BYTE **)m_Values)[y][x / 8] & (~m_Bitmask[x % 8]);
885 bool Set_Row (
int y,
const CSG_Vector &Values);
901 bool m_Cache_bTemp, m_Cache_bSwap, m_Cache_bFlip;
903 size_t m_nBytes_Value, m_nBytes_Line;
905 sLong *m_Index, m_Cache_Offset;
907 double m_zOffset, m_zScale;
909 FILE *m_Cache_Stream;
923 static BYTE m_Bitmask[8];
927 void _On_Construction (
void);
929 bool _Set_Index (
void);
930 bool _Get_Index (
void)
937 return( m_Index || _Set_Index() );
944 bool _Memory_Create (
bool bCached);
945 void _Memory_Destroy (
void);
947 bool _Array_Create (
void);
948 void _Array_Destroy (
void);
950 bool _Cache_Check (
void);
952 bool _Cache_Create (
void);
953 bool _Cache_Destroy (
bool bMemory_Restore);
954 void _Cache_Set_Value (
int x,
int y,
double Value);
955 double _Cache_Get_Value (
int x,
int y)
const;
961 void _Swap_Bytes (
char *Bytes,
int nBytes)
const;
963 bool _Load_External (
const CSG_String &File,
bool bCached,
bool bLoadData);
964 bool _Load_PGSQL (
const CSG_String &File,
bool bCached,
bool bLoadData);
966 bool _Load_Native (
const CSG_String &File,
bool bCached,
bool bLoadData);
969 bool _Load_Compressed (
const CSG_String &File,
bool bCached,
bool bLoadData);
970 bool _Save_Compressed (
const CSG_String &File);
974 bool _Load_ASCII (
CSG_File &Stream,
bool bCached,
bool bFlip =
false);
975 bool _Save_ASCII (
CSG_File &Stream,
bool bFlip =
false);
977 bool _Load_Surfer (
const CSG_String &File,
bool bCached,
bool bLoadData);
985 bool _Assign_MeanValue (
CSG_Grid *pSource,
bool bAreaProportional ,
bool bProgress);
986 bool _Assign_ExtremeValue (
CSG_Grid *pSource,
bool bMaximum ,
bool bProgress);
987 bool _Assign_Majority (
CSG_Grid *pSource ,
bool bProgress);
993 bool _Get_ValAtPos_NearestNeighbour (
double &Value,
int x,
int y,
double dx,
double dy )
const;
994 bool _Get_ValAtPos_BiLinear (
double &Value,
int x,
int y,
double dx,
double dy,
bool bByteWise)
const;
995 bool _Get_ValAtPos_BiCubic_1 (
double &Value,
int x,
int y,
double dx,
double dy,
bool bByteWise)
const;
996 bool _Get_ValAtPos_BiCubic_2 (
double &Value,
int x,
int y,
double dx,
double dy,
bool bByteWise)
const;
998 double _Get_ValAtPos_BiCubic_1 (
double dx,
double dy,
double z_xy[4][4])
const;
999 double _Get_ValAtPos_BiCubic_2 (
double dx,
double dy,
double z_xy[4][4])
const;
1001 bool _Get_ValAtPos_Fill4x4Submatrix (
int x,
int y,
double z_xy[4][4] )
const;
1002 bool _Get_ValAtPos_Fill4x4Submatrix (
int x,
int y,
double z_xy[4][4][4])
const;
1014 #define SG_GRID_PTR_SAFE_SET_NODATA(g, x, y) { if( g && g->is_InGrid(x, y, false) ) { g->Set_NoData(x, y ); } }
1015 #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); } }
1093 virtual bool Pop (
int &x,
int &y)
1118 #define SG_GRIDCELLADDR_PARM_SQUARE 0x01
1119 #define SG_GRIDCELLADDR_PARM_CIRCLE 0x02
1120 #define SG_GRIDCELLADDR_PARM_ANNULUS 0x04
1121 #define SG_GRIDCELLADDR_PARM_SECTOR 0x08
1122 #define SG_GRIDCELLADDR_PARM_SIZEDBL 0x10
1123 #define SG_GRIDCELLADDR_PARM_MAPUNIT 0x20
1124 #define SG_GRIDCELLADDR_PARM_WEIGHTING 0x40
1125 #define SG_GRIDCELLADDR_PARM_DEFAULT (SG_GRIDCELLADDR_PARM_SQUARE|SG_GRIDCELLADDR_PARM_CIRCLE)
1133 bool Destroy (
void);
1135 static bool Enable_Parameters (
class CSG_Parameters &Parameters);
1137 bool Set_Parameters (
class CSG_Parameters &Parameters,
int Type = 0);
1151 bool Set_Radius (
double Radius,
bool bSquare =
false);
1152 bool Set_Square (
double Radius);
1153 bool Set_Circle (
double Radius);
1154 bool Set_Annulus (
double Radius_Inner,
double Radius_Outer);
1155 bool Set_Sector (
double Radius,
double Direction,
double Tolerance);
1157 double Get_Radius (
bool bOuter =
true)
const {
return( bOuter ? m_Radius : m_Radius_0 ); }
1163 int Get_Count (
void)
const {
return( (
int)m_Kernel.Get_Count() ); }
1164 int Get_X (
int Index,
int Offset = 0)
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asInt (0) + Offset : Offset ); }
1165 int Get_Y (
int Index,
int Offset = 0)
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asInt (1) + Offset : Offset ); }
1166 double Get_Distance (
int Index )
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asDouble(2) : -1. ); }
1167 double Get_Weight (
int Index )
const {
return( Index >= 0 && Index < m_Kernel.Get_Count() ? m_Kernel[Index].asDouble(3) : 0. ); }
1168 bool Get_Values (
int Index,
int &x,
int &y,
double &Distance,
double &Weight,
bool bOffset =
false)
const
1170 if( Index >= 0 && Index < m_Kernel.Get_Count() )
1174 x = bOffset ? x + Cell.
asInt(0) : Cell.
asInt(0);
1175 y = bOffset ? y + Cell.
asInt(1) : Cell.
asInt(1);
1190 double m_Radius, m_Radius_0, m_Direction, m_Tolerance;
1197 bool _Set_Kernel (
int Type,
double Radius,
double Radius_Inner,
double Direction,
double Tolerance);
1209 #endif // #ifndef HEADER_INCLUDED__SAGA_API__grid_H
sLong Get_IndexFromRowCol(int x, int y) const
TSG_Data_Type Get_Type(void) const
virtual bool Assign(CSG_Data_Object *pObject, bool bProgress=false)
double Get_xGrid_to_World(int xGrid) const
double asDouble(int Field) const
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)
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
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
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)
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]
bool Set_Index(bool bOn=true)
double Get_Cellarea(void) const
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
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)
virtual sLong asLong(int x, int y, bool bScaled=true) const
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
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)