SAGA API  v9.9
grid.h
Go to the documentation of this file.
1 
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // grid.h //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49 
50 //---------------------------------------------------------
51 #ifndef HEADER_INCLUDED__SAGA_API__grid_H
52 #define HEADER_INCLUDED__SAGA_API__grid_H
53 
54 
56 // //
57 // //
58 // //
60 
61 //---------------------------------------------------------
70 // //
72 // //
73 // //
75 
76 //---------------------------------------------------------
77 #include "table.h"
78 #include "grid_pyramid.h"
79 
80 
82 // //
83 // Grid File //
84 // //
86 
87 //---------------------------------------------------------
88 typedef enum
89 {
96 }
98 
99 //---------------------------------------------------------
100 typedef enum
101 {
119 }
121 
122 //---------------------------------------------------------
124 {
125  SG_T("NAME"),
126  SG_T("DESCRIPTION"),
127  SG_T("UNIT"),
128  SG_T("DATAFILE_NAME"),
129  SG_T("DATAFILE_OFFSET"),
130  SG_T("DATAFORMAT"),
131  SG_T("BYTEORDER_BIG"),
132  SG_T("POSITION_XMIN"),
133  SG_T("POSITION_YMIN"),
134  SG_T("CELLCOUNT_X"),
135  SG_T("CELLCOUNT_Y"),
136  SG_T("CELLSIZE"),
137  SG_T("Z_FACTOR"),
138  SG_T("Z_OFFSET"),
139  SG_T("NODATA_VALUE"),
140  SG_T("TOPTOBOTTOM")
141 };
142 
143 //---------------------------------------------------------
144 #define GRID_FILE_KEY_TRUE SG_T("TRUE")
145 #define GRID_FILE_KEY_FALSE SG_T("FALSE")
146 
147 
149 // //
150 // //
151 // //
153 
154 //---------------------------------------------------------
156 {
157  NearestNeighbour = 0x001,
158  Bilinear = 0x002,
159  Bicubic_1 = 0x004,
160  Bicubic_2 = 0x008,
161 
162  Mean_Nodes = 0x010,
163  Mean_Cells = 0x020,
164 
165  Minimum = 0x040,
166  Maximum = 0x080,
167  Majority = 0x100,
168 
169  //-----------------------------------------------------
170  Interpolations = NearestNeighbour|Bilinear|Bicubic_1|Bicubic_2,
171  Means = Mean_Nodes|Mean_Cells,
172  Extremes = Maximum|Minimum,
173  Aggregations = Means|Extremes|Majority,
174  All = Interpolations|Aggregations,
175  Undefined = 0x000
176 };
177 
178 // deprecated, for backward compatibility only >>
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
190 // << deprecated, for backward compatibility only
191 
192 //---------------------------------------------------------
193 typedef enum
194 {
199 }
201 
202 
204 // //
205 // CSG_Grid_System //
206 // //
208 
209 //---------------------------------------------------------
218 //---------------------------------------------------------
220 {
221 public:
222  CSG_Grid_System(void);
223 
224  CSG_Grid_System (const CSG_Grid_System &System, int Precision = -1);
225  bool Create (const CSG_Grid_System &System, int Precision = -1);
226 
227  CSG_Grid_System (double Cellsize, const CSG_Rect &Extent, int Precision = -1);
228  bool Create (double Cellsize, const CSG_Rect &Extent, int Precision = -1);
229 
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);
232 
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);
235 
236  CSG_Grid_System (const CSG_String &System, int Precision = -1);
237  bool Create (const CSG_String &System, int Precision = -1);
238 
239  ~CSG_Grid_System(void);
240 
241  bool Destroy (void);
242 
243  //-----------------------------------------------------
244  bool Assign (const CSG_Grid_System &System);
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);
248 
249  //-----------------------------------------------------
250  bool is_Valid (void) const;
251 
252  const SG_Char * Get_Name (bool bShort = true);
253  const SG_Char * asString (void);
254 
255  double Get_Cellsize (void) const { return( m_Cellsize ); }
256  double Get_Cellarea (void) const { return( m_Cellarea ); }
257 
258  int Get_NX (void) const { return( m_NX ); }
259  int Get_NY (void) const { return( m_NY ); }
260  sLong Get_NCells (void) const { return( m_NCells ); }
261 
262  const CSG_Rect & Get_Extent (bool bCells = false) const { return( bCells ? m_Extent_Cells : m_Extent ); }
263 
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() ); }
267 
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() ); }
271 
272 
273  //-----------------------------------------------------
274  CSG_Grid_System & operator = (const CSG_Grid_System &System);
275 
276  bool operator == (const CSG_Grid_System *pSystem) const;
277  bool operator != (const CSG_Grid_System *pSystem) const;
278  bool operator == (const CSG_Grid_System &System) const;
279  bool operator != (const CSG_Grid_System &System) const;
280 
281  bool is_Equal (const CSG_Grid_System &System) const;
282  bool is_Equal (double Cellsize, const TSG_Rect &Extent) const;
283 
284 
285  //-----------------------------------------------------
287  double Fit_xto_Grid_System (double x) const { return( Get_XMin() + m_Cellsize * Get_xWorld_to_Grid(x) ); }
288 
290  double Fit_yto_Grid_System (double y) const { return( Get_YMin() + m_Cellsize * Get_yWorld_to_Grid(y) ); }
291 
294  {
295  ptWorld.x = Fit_xto_Grid_System(ptWorld.x);
296  ptWorld.y = Fit_yto_Grid_System(ptWorld.y);
297 
298  return( ptWorld );
299  }
300 
301 
302  //-----------------------------------------------------
303  double Get_xGrid_to_World (int xGrid) const { return( Get_XMin() + xGrid * m_Cellsize ); }
304  double Get_yGrid_to_World (int yGrid) const { return( Get_YMin() + yGrid * m_Cellsize ); }
305 
306  TSG_Point Get_Grid_to_World (int xGrid, int yGrid) const
307  {
308  TSG_Point pt;
309 
310  pt.x = Get_xGrid_to_World(xGrid);
311  pt.y = Get_yGrid_to_World(yGrid);
312 
313  return( pt );
314  }
315 
316 
317  //-----------------------------------------------------
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) ); }
320 
321  bool Get_World_to_Grid (int &xGrid, int &yGrid, double xWorld, double yWorld) const
322  {
323  return( is_InGrid(xGrid = Get_xWorld_to_Grid(xWorld), yGrid = Get_yWorld_to_Grid(yWorld)) );
324  }
325 
326  bool Get_World_to_Grid (int &xGrid, int &yGrid, TSG_Point ptWorld) const
327  {
328  return( is_InGrid(xGrid = Get_xWorld_to_Grid(ptWorld.x), yGrid = Get_yWorld_to_Grid(ptWorld.y)) );
329  }
330 
331 
332  //-----------------------------------------------------
333  bool Get_Neighbor_Pos (int Direction, int x, int y, int &xPos, int &yPos) const
334  {
335  return( is_InGrid(xPos = Get_xTo(Direction, x), yPos = Get_yTo(Direction, y)) );
336  }
337 
338  static int Get_xTo (int Direction, int x = 0)
339  {
340  static int ix[8] = { 0, 1, 1, 1, 0,-1,-1,-1 };
341 
342  Direction %= 8;
343 
344  if( Direction < 0 )
345  {
346  Direction += 8;
347  }
348 
349  return( x + ix[Direction] );
350  }
351 
352  static int Get_yTo (int Direction, int y = 0)
353  {
354  static int iy[8] = { 1, 1, 0,-1,-1,-1, 0, 1 };
355 
356  Direction %= 8;
357 
358  if( Direction < 0 )
359  {
360  Direction += 8;
361  }
362 
363  return( y + iy[Direction] );
364  }
365 
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) ); }
368 
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) ); }
373 
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 ); }
376 
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. ); }
379 
380  static int Set_Precision (int Decimals);
381  static int Get_Precision (void);
382 
383  sLong Get_IndexFromRowCol (int x, int y) const
384  {
385  if( m_NX > 0 )
386  {
387  return( (sLong)y * m_NX + x );
388  }
389 
390  return( -1 );
391  }
392 
393  bool Get_RowColFromIndex (int &x, int &y, sLong i) const
394  {
395  if( m_NX > 0 )
396  {
397  x = (int)(i % m_NX);
398  y = (int)(i / m_NX);
399 
400  return( true );
401  }
402 
403  return( false );
404  }
405 
406 
407 private:
408 
409  int m_NX, m_NY;
410 
411  sLong m_NCells;
412 
413  double m_Cellsize, m_Cellarea, m_Diagonal;
414 
415  CSG_Rect m_Extent, m_Extent_Cells;
416 
417  CSG_String m_Name;
418 
419  static int m_Precision;
420 
421 };
422 
423 
425 // //
426 // CSG_Grid //
427 // //
429 
430 //---------------------------------------------------------
434 //---------------------------------------------------------
436 {
437 //---------------------------------------------------------
438 public:
439 
440  //-----------------------------------------------------
441  CSG_Grid_File_Info(void);
442 
444  bool Create (const CSG_Grid_File_Info &Info);
445 
446  CSG_Grid_File_Info (const CSG_String &File);
447  bool Create (const CSG_String &File);
448 
449  CSG_Grid_File_Info (CSG_File &Stream);
450  bool Create (CSG_File &Stream);
451 
452  CSG_Grid_File_Info (const CSG_Grid &Grid);
453  bool Create (const CSG_Grid &Grid);
454 
455  bool Save (const CSG_String &File , bool bBinary = true);
456  bool Save (const CSG_File &Stream, bool bBinary = true);
457 
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);
460 
461  bool Save_AUX_XML (const CSG_String &File);
462  bool Save_AUX_XML (CSG_File &Stream);
463 
464  //-----------------------------------------------------
465  bool m_bFlip, m_bSwapBytes;
466 
468 
469  double m_zScale, m_zOffset, m_NoData[2];
470 
472 
473  CSG_String m_Name, m_Description, m_Unit, m_Data_File;
474 
476 
478 
479 
480 private:
481 
482  void _On_Construction (void);
483 
484  int _Get_Key (CSG_File &Stream, CSG_String &Line);
485 
486 };
487 
488 
490 // //
491 // CSG_Grid //
492 // //
494 
495 //---------------------------------------------------------
499 //---------------------------------------------------------
501 {
502 //---------------------------------------------------------
503 public:
504 
505  //-----------------------------------------------------
506  CSG_Grid(void);
507 
508  CSG_Grid (const CSG_Grid &Grid);
509  bool Create (const CSG_Grid &Grid);
510 
511  CSG_Grid (const CSG_String &File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
512  bool Create (const CSG_String &File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
513  CSG_Grid (const char *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
514  bool Create (const char *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
515  CSG_Grid (const wchar_t *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
516  bool Create (const wchar_t *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
517 
518  CSG_Grid (CSG_Grid *pGrid , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
519  bool Create (CSG_Grid *pGrid , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
520 
521  CSG_Grid (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
522  bool Create (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
523 
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);
526 
527 
528  //-----------------------------------------------------
529  virtual ~CSG_Grid(void);
530 
531  virtual bool Destroy (void);
532 
533 
534  //-----------------------------------------------------
535  virtual bool Save (const char *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
536  virtual bool Save (const wchar_t *File, int Format = 0) { return( Save(CSG_String(File), Format) ); }
537  virtual bool Save (const CSG_String &File, int Format = 0);
538 
539  //-----------------------------------------------------
542  virtual TSG_Data_Object_Type Get_ObjectType (void) const { return( SG_DATAOBJECT_TYPE_Grid ); }
543 
544  //-----------------------------------------------------
545  // Data-Info...
546 
547  TSG_Data_Type Get_Type (void) const { return( m_Type ); }
548 
549  int Get_nValueBytes (void) const { return( (int)m_nBytes_Value ); }
550  int Get_nLineBytes (void) const { return( (int)m_nBytes_Line ); }
551 
552  void Set_Unit (const CSG_String &Unit);
553  const CSG_String & Get_Unit (void) const { return( m_Unit ); }
554 
555 
556  //-----------------------------------------------------
557  // Georeference...
558 
559  const CSG_Grid_System & Get_System (void) const { return( m_System ); }
560 
561  virtual const CSG_Rect & Get_Extent (void) { return( m_System.Get_Extent() ); }
562 
563  int Get_NX (void) const { return( m_System.Get_NX() ); }
564  int Get_NY (void) const { return( m_System.Get_NY() ); }
565  sLong Get_NCells (void) const { return( m_System.Get_NCells() ); }
566 
567  double Get_Cellsize (void) const { return( m_System.Get_Cellsize() ); }
568  double Get_Cellarea (void) const { return( m_System.Get_Cellarea() ); }
569 
570  const CSG_Rect & Get_Extent (bool bCells = false) const { return( m_System.Get_Extent(bCells) ); }
571 
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) ); }
575 
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) ); }
579 
580 
581  //-----------------------------------------------------
582  // Values...
583 
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. ); }
588 
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);
597 
598  const CSG_Simple_Statistics & Get_Statistics (void);
599  bool Get_Statistics (const CSG_Rect &rWorld, CSG_Simple_Statistics &Statistics, bool bHoldValues = false) const;
600 
601  const CSG_Histogram & Get_Histogram (size_t nClasses = 0);
602  bool Get_Histogram (const CSG_Rect &rWorld, CSG_Histogram &Histogram, size_t nClasses = 0) const;
603 
604  sLong Get_Data_Count (void);
605  sLong Get_NoData_Count (void);
606 
607 
608  //-----------------------------------------------------
609  // Checks...
610 
611  virtual bool is_Valid (void) const;
612 
613  TSG_Intersection is_Intersecting (const CSG_Rect &Extent) const;
614  TSG_Intersection is_Intersecting (const TSG_Rect &Extent) const;
615  TSG_Intersection is_Intersecting (double xMin, double yMin, double xMax, double yMax) const;
616 
617  bool is_Compatible (CSG_Grid *pGrid) const;
618  bool is_Compatible (const CSG_Grid_System &System) const;
619  bool is_Compatible (int NX, int NY, double Cellsize, double xMin, double yMin) const;
620 
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))) ); }
623  bool is_InGrid_byPos (const TSG_Point &p, bool bCheckNoData = true) const { return( is_InGrid_byPos(p.x, p.y, bCheckNoData) ); }
624 
625 
626  //-----------------------------------------------------
627  // Memory...
628 
629  sLong Get_Memory_Size (void) const { return( Get_NCells() * Get_nValueBytes() ); }
630  double Get_Memory_Size_MB (void) const { return( (double)Get_Memory_Size() / N_MEGABYTE_BYTES ); }
631 
632  bool Set_Cache (bool bOn);
633  bool is_Cached (void) const { return( m_Cache_Stream != NULL ); }
634 
635 
636  //-----------------------------------------------------
637  // Operations...
638 
639  bool Assign_NoData (void);
640 
641  virtual bool Assign (double Value = 0.);
642  virtual bool Assign (CSG_Data_Object *pObject , bool bProgress = false);
643  virtual bool Assign (CSG_Grid *pGrid, CSG_Grid_Resampling Method, bool bProgress = false);
644 
645  void Flip (void);
646  void Mirror (void);
647  void Invert (void);
648 
649  bool Normalise (void);
650  bool DeNormalise (double Minimum, double Maximum);
651 
652  bool Standardise (void);
653  bool DeStandardise (double Mean, double StdDev);
654 
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;
658  bool Get_Gradient (const TSG_Point &p, double &Slope, double &Aspect, CSG_Grid_Resampling Interpolation) const;
659 
660 
661  //-----------------------------------------------------
662  // Set update flag when modified...
663 
664  virtual void Set_Modified (bool bModified = true)
665  {
667 
668  if( bModified )
669  {
670  Set_Update_Flag();
671  }
672  }
673 
674 
675  //-----------------------------------------------------
676  // Index...
677 
678  bool Set_Index (bool bOn = true)
679  {
680  if( !bOn )
681  {
682  SG_FREE_SAFE(m_Index);
683 
684  return( true );
685  }
686 
687  return( _Get_Index() );
688  }
689 
690  sLong Get_Sorted (sLong Position, bool bDown = true, bool bCheckNoData = true)
691  {
692  if( Position >= 0 && Position < Get_NCells() && _Get_Index() )
693  {
694  Position = m_Index[bDown ? Get_NCells() - Position - 1 : Position];
695 
696  if( !bCheckNoData || !is_NoData(Position) )
697  {
698  return( Position );
699  }
700  }
701 
702  return( -1 );
703  }
704 
705  bool Get_Sorted (sLong Position, sLong &i, bool bDown = true, bool bCheckNoData = true)
706  {
707  return( (i = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 );
708  }
709 
710  bool Get_Sorted (sLong Position, int &x, int &y, bool bDown = true, bool bCheckNoData = true)
711  {
712  if( (Position = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 )
713  {
714  x = (int)(Position % Get_NX());
715  y = (int)(Position / Get_NX());
716 
717  return( true );
718  }
719 
720  return( false );
721  }
722 
723 
724  //-----------------------------------------------------
725  // No Data Value...
726 
727  virtual bool is_NoData (int x, int y) const { return( is_NoData_Value(asDouble(x, y, false)) ); }
728  virtual bool is_NoData (sLong i) const { return( is_NoData_Value(asDouble( i, false)) ); }
729 
730  virtual void Set_NoData (int x, int y) { Set_Value(x, y, Get_NoData_Value(), false); }
731  virtual void Set_NoData (sLong i) { Set_Value( i, Get_NoData_Value(), false); }
732 
733 
734  //-----------------------------------------------------
735  // Operators...
736 
737  virtual CSG_Grid & operator = (const CSG_Grid &Grid);
738  virtual CSG_Grid & operator = (double Value);
739 
740  virtual CSG_Grid operator + (const CSG_Grid &Grid) const;
741  virtual CSG_Grid operator + (double Value) const;
742  virtual CSG_Grid & operator += (const CSG_Grid &Grid);
743  virtual CSG_Grid & operator += (double Value);
744  virtual CSG_Grid & Add (const CSG_Grid &Grid);
745  virtual CSG_Grid & Add (double Value);
746 
747  virtual CSG_Grid operator - (const CSG_Grid &Grid) const;
748  virtual CSG_Grid operator - (double Value) const;
749  virtual CSG_Grid & operator -= (const CSG_Grid &Grid);
750  virtual CSG_Grid & operator -= (double Value);
751  virtual CSG_Grid & Subtract (const CSG_Grid &Grid);
752  virtual CSG_Grid & Subtract (double Value);
753 
754  virtual CSG_Grid operator * (const CSG_Grid &Grid) const;
755  virtual CSG_Grid operator * (double Value) const;
756  virtual CSG_Grid & operator *= (const CSG_Grid &Grid);
757  virtual CSG_Grid & operator *= (double Value);
758  virtual CSG_Grid & Multiply (const CSG_Grid &Grid);
759  virtual CSG_Grid & Multiply (double Value);
760 
761  virtual CSG_Grid operator / (const CSG_Grid &Grid) const;
762  virtual CSG_Grid operator / (double Value) const;
763  virtual CSG_Grid & operator /= (const CSG_Grid &Grid);
764  virtual CSG_Grid & operator /= (double Value);
765  virtual CSG_Grid & Divide (const CSG_Grid &Grid);
766  virtual CSG_Grid & Divide (double Value);
767 
768  virtual double operator () (int x, int y) const { return( asDouble(x, y) ); }
769 
770 
771  //-----------------------------------------------------
772  // Get Value...
773 
774  double Get_Value (double x, double y, CSG_Grid_Resampling Resampling = CSG_Grid_Resampling::Bicubic_2 , bool bByteWise = false) const;
775  double Get_Value (const TSG_Point &p, 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;
778 
779  virtual BYTE asByte (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_BYTE (asDouble(x, y, bScaled)) ); }
780  virtual BYTE asByte ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_BYTE (asDouble( i, bScaled)) ); }
781  virtual char asChar (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_CHAR (asDouble(x, y, bScaled)) ); }
782  virtual char asChar ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_CHAR (asDouble( i, bScaled)) ); }
783  virtual short asShort (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_SHORT(asDouble(x, y, bScaled)) ); }
784  virtual short asShort ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_SHORT(asDouble( i, bScaled)) ); }
785  virtual int asInt (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_INT (asDouble(x, y, bScaled)) ); }
786  virtual int asInt ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_INT (asDouble( i, bScaled)) ); }
787  virtual sLong asLong (int x, int y, bool bScaled = true) const { return( SG_ROUND_TO_SLONG(asDouble(x, y, bScaled)) ); }
788  virtual sLong asLong ( sLong i, bool bScaled = true) const { return( SG_ROUND_TO_SLONG(asDouble( i, 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)) ); }
791 
792  //-----------------------------------------------------
793  virtual double asDouble( sLong i, bool bScaled = true) const
794  {
795  return( asDouble((int)(i % Get_NX()), (int)(i / Get_NX()), bScaled) );
796  }
797 
798  virtual double asDouble(int x, int y, bool bScaled = true) const
799  {
800  double Value;
801 
802  if( is_Cached() )
803  {
804  Value = _Cache_Get_Value(x, y);
805  }
806  else switch( m_Type )
807  {
808  case SG_DATATYPE_Float : Value = (double)((float **)m_Values)[y][x]; break;
809  case SG_DATATYPE_Double: Value = (double)((double **)m_Values)[y][x]; break;
810  case SG_DATATYPE_Byte : Value = (double)((BYTE **)m_Values)[y][x]; break;
811  case SG_DATATYPE_Char : Value = (double)((char **)m_Values)[y][x]; break;
812  case SG_DATATYPE_Word : Value = (double)((WORD **)m_Values)[y][x]; break;
813  case SG_DATATYPE_Short : Value = (double)((short **)m_Values)[y][x]; break;
814  case SG_DATATYPE_DWord : Value = (double)((DWORD **)m_Values)[y][x]; break;
815  case SG_DATATYPE_Int : Value = (double)((int **)m_Values)[y][x]; break;
816  case SG_DATATYPE_Long : Value = (double)((sLong **)m_Values)[y][x]; break;
817  case SG_DATATYPE_ULong : Value = (double)((uLong **)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;
819 
820  default:
821  return( 0. );
822  }
823 
824  if( bScaled && is_Scaled() )
825  {
826  Value = m_zOffset + m_zScale * Value;
827  }
828 
829  return( Value );
830  }
831 
832 
833  //-----------------------------------------------------
834  // Set Value...
835 
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 ); }
838 
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 ); }
841 
842  //-----------------------------------------------------
843  virtual void Set_Value(sLong i, double Value, bool bScaled = true)
844  {
845  Set_Value((int)(i % Get_NX()), (int)(i / Get_NX()), Value, bScaled);
846  }
847 
848  virtual void Set_Value(int x, int y, double Value, bool bScaled = true)
849  {
850  if( bScaled && is_Scaled() )
851  {
852  Value = (Value - m_zOffset) / m_zScale;
853  }
854 
855  if( is_Cached() )
856  {
857  _Cache_Set_Value(x, y, Value);
858  }
859  else switch( m_Type )
860  {
861  case SG_DATATYPE_Float : ((float **)m_Values)[y][x] = (float )(Value); break;
862  case SG_DATATYPE_Double: ((double **)m_Values)[y][x] = (double )(Value); break;
863  case SG_DATATYPE_Byte : ((BYTE **)m_Values)[y][x] = SG_ROUND_TO_BYTE (Value); break;
864  case SG_DATATYPE_Char : ((char **)m_Values)[y][x] = SG_ROUND_TO_CHAR (Value); break;
865  case SG_DATATYPE_Word : ((WORD **)m_Values)[y][x] = SG_ROUND_TO_WORD (Value); break;
866  case SG_DATATYPE_Short : ((short **)m_Values)[y][x] = SG_ROUND_TO_SHORT(Value); break;
867  case SG_DATATYPE_DWord : ((DWORD **)m_Values)[y][x] = SG_ROUND_TO_DWORD(Value); break;
868  case SG_DATATYPE_Int : ((int **)m_Values)[y][x] = SG_ROUND_TO_INT (Value); break;
869  case SG_DATATYPE_Long : ((sLong **)m_Values)[y][x] = SG_ROUND_TO_SLONG(Value); break;
870  case SG_DATATYPE_ULong : ((uLong **)m_Values)[y][x] = SG_ROUND_TO_ULONG(Value); break;
871  case SG_DATATYPE_Bit : ((BYTE **)m_Values)[y][x / 8] = Value != 0.
872  ? ((BYTE **)m_Values)[y][x / 8] | m_Bitmask[x % 8]
873  : ((BYTE **)m_Values)[y][x / 8] & (~m_Bitmask[x % 8]);
874  break;
875 
876  default:
877  return;
878  }
879 
880  Set_Modified();
881  }
882 
883  //-----------------------------------------------------
884  CSG_Vector Get_Row (int y) const;
885  bool Set_Row (int y, const CSG_Vector &Values);
886 
887 
888 //---------------------------------------------------------
889 protected:
890 
891  virtual bool On_Update (void);
892  virtual bool On_Reload (void);
893  virtual bool On_Delete (void);
894 
895 
896 //---------------------------------------------------------
897 private:
898 
899  void **m_Values;
900 
901  bool m_Cache_bTemp, m_Cache_bSwap, m_Cache_bFlip;
902 
903  size_t m_nBytes_Value, m_nBytes_Line;
904 
905  sLong *m_Index, m_Cache_Offset;
906 
907  double m_zOffset, m_zScale;
908 
909  FILE *m_Cache_Stream;
910 
911  TSG_Data_Type m_Type;
912 
913  CSG_String m_Unit, m_Cache_File;
914 
915  CSG_Simple_Statistics m_Statistics;
916 
917  CSG_Histogram m_Histogram;
918 
919  CSG_Grid_System m_System;
920 
921 
922  //-----------------------------------------------------
923  static BYTE m_Bitmask[8];
924 
925 
926  //-----------------------------------------------------
927  void _On_Construction (void);
928 
929  bool _Set_Index (void);
930  bool _Get_Index (void)
931  {
932  if( Get_Update_Flag() )
933  {
934  Update();
935  }
936 
937  return( m_Index || _Set_Index() );
938  }
939 
940 
941  //-----------------------------------------------------
942  // Memory handling...
943 
944  bool _Memory_Create (bool bCached);
945  void _Memory_Destroy (void);
946 
947  bool _Array_Create (void);
948  void _Array_Destroy (void);
949 
950  bool _Cache_Check (void);
951  bool _Cache_Create (const CSG_String &File, TSG_Data_Type Data_Type, sLong Offset, bool bSwap, bool bFlip);
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;
956 
957 
958  //-----------------------------------------------------
959  // File access...
960 
961  void _Swap_Bytes (char *Bytes, int nBytes) const;
962 
963  bool _Load_External (const CSG_String &File, bool bCached, bool bLoadData);
964  bool _Load_PGSQL (const CSG_String &File, bool bCached, bool bLoadData);
965 
966  bool _Load_Native (const CSG_String &File, bool bCached, bool bLoadData);
967  bool _Save_Native (const CSG_String &File, TSG_Grid_File_Format Format);
968 
969  bool _Load_Compressed (const CSG_String &File, bool bCached, bool bLoadData);
970  bool _Save_Compressed (const CSG_String &File);
971 
972  bool _Load_Binary (CSG_File &Stream, TSG_Data_Type File_Type, bool bFlip, bool bSwapBytes);
973  bool _Save_Binary (CSG_File &Stream, TSG_Data_Type File_Type, bool bFlip, bool bSwapBytes);
974  bool _Load_ASCII (CSG_File &Stream, bool bCached, bool bFlip = false);
975  bool _Save_ASCII (CSG_File &Stream, bool bFlip = false);
976 
977  bool _Load_Surfer (const CSG_String &File, bool bCached, bool bLoadData);
978 
979 
980  //-----------------------------------------------------
981  CSG_Grid & _Operation_Arithmetic (const CSG_Grid &Grid, TSG_Grid_Operation Operation);
982  CSG_Grid & _Operation_Arithmetic (double Value , TSG_Grid_Operation Operation);
983 
984  bool _Assign_Interpolated (CSG_Grid *pSource, CSG_Grid_Resampling Interpolation, bool bProgress);
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);
988 
989 
990  //-----------------------------------------------------
991  // Interpolation subroutines...
992 
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;
997 
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;
1000 
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;
1003 
1004 };
1005 
1006 
1008 // //
1009 // Functions //
1010 // //
1012 
1013 //---------------------------------------------------------
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); } }
1016 
1017 //---------------------------------------------------------
1020 
1023 
1025 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const char *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
1027 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const wchar_t *File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
1029 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const CSG_String &File , TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false, bool bLoadData = true);
1030 
1033 
1035 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (const CSG_Grid_System &System, TSG_Data_Type Type = SG_DATATYPE_Undefined, bool bCached = false);
1036 
1038 SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid (TSG_Data_Type Type, int NX, int NY, double Cellsize = 0., double xMin = 0., double yMin = 0., bool bCached = false);
1039 
1040 //---------------------------------------------------------
1043 
1046 
1049 
1051 SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold_MB (double nMegabytes);
1054 
1055 //---------------------------------------------------------
1059 
1060 
1062 // //
1063 // //
1064 // //
1066 
1067 //---------------------------------------------------------
1069 {
1070 public:
1072 
1073  //-----------------------------------------------------
1074  const TSG_Point_Int & operator [] (size_t i) const { return( *((TSG_Point_Int *)Get_Record(i)) ); }
1075 
1076  //-----------------------------------------------------
1077  virtual bool Push (int x, int y)
1078  {
1080 
1081  if( pPoint )
1082  {
1083  pPoint->x = x;
1084  pPoint->y = y;
1085 
1086  return( true );
1087  }
1088 
1089  return( false );
1090  }
1091 
1092  //-----------------------------------------------------
1093  virtual bool Pop (int &x, int &y)
1094  {
1096 
1097  if( pPoint )
1098  {
1099  x = pPoint->x;
1100  y = pPoint->y;
1101 
1102  return( true );
1103  }
1104 
1105  return( false );
1106  }
1107 
1108 };
1109 
1110 
1112 // //
1113 // //
1114 // //
1116 
1117 //---------------------------------------------------------
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)
1126 
1127 //---------------------------------------------------------
1129 {
1130 public:
1132 
1133  bool Destroy (void);
1134 
1135  static bool Enable_Parameters (class CSG_Parameters &Parameters);
1136  static bool Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", int Style = SG_GRIDCELLADDR_PARM_DEFAULT);
1137  bool Set_Parameters (class CSG_Parameters &Parameters, int Type = 0);
1138 
1139  bool Set_Square (class CSG_Parameters &Parameters);
1140  bool Set_Circle (class CSG_Parameters &Parameters);
1141  bool Set_Annulus (class CSG_Parameters &Parameters);
1142  bool Set_Sector (class CSG_Parameters &Parameters);
1143 
1144  CSG_Distance_Weighting & Get_Weighting (void) { return( m_Weighting ); }
1145 
1146  bool is_Square (void) const { return( m_Type == 0 ); }
1147  bool is_Circle (void) const { return( m_Type == 1 ); }
1148  bool is_Annulus (void) const { return( m_Type == 2 ); }
1149  bool is_Sector (void) const { return( m_Type == 3 ); }
1150 
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);
1156 
1157  double Get_Radius (bool bOuter = true) const { return( bOuter ? m_Radius : m_Radius_0 ); }
1158  double Get_Radius_Inner (void) const { return( m_Radius_0 ); }
1159  double Get_Radius_Outer (void) const { return( m_Radius ); }
1160  double Get_Direction (void) const { return( m_Direction ); }
1161  double Get_Tolerance (void) const { return( m_Tolerance ); }
1162 
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
1169  {
1170  if( Index >= 0 && Index < m_Kernel.Get_Count() )
1171  {
1172  CSG_Table_Record &Cell = m_Kernel[Index];
1173 
1174  x = bOffset ? x + Cell.asInt(0) : Cell.asInt(0);
1175  y = bOffset ? y + Cell.asInt(1) : Cell.asInt(1);
1176  Distance = Cell.asDouble(2);
1177  Weight = Cell.asDouble(3);
1178 
1179  return( true );
1180  }
1181 
1182  return( false );
1183  }
1184 
1185 
1186 private:
1187 
1188  int m_Type;
1189 
1190  double m_Radius, m_Radius_0, m_Direction, m_Tolerance;
1191 
1192  CSG_Distance_Weighting m_Weighting;
1193 
1194  CSG_Table m_Kernel;
1195 
1196 
1197  bool _Set_Kernel (int Type, double Radius, double Radius_Inner, double Direction, double Tolerance);
1198 
1199 };
1200 
1201 
1203 // //
1204 // //
1205 // //
1207 
1208 //---------------------------------------------------------
1209 #endif // #ifndef HEADER_INCLUDED__SAGA_API__grid_H
CSG_Grid_System::Get_IndexFromRowCol
sLong Get_IndexFromRowCol(int x, int y) const
Definition: grid.h:383
CSG_Grid::Get_Type
TSG_Data_Type Get_Type(void) const
Definition: grid.h:547
CSG_Grid_File_Info::m_Offset
sLong m_Offset
Definition: grid.h:467
CSG_Data_Object::Assign
virtual bool Assign(CSG_Data_Object *pObject, bool bProgress=false)
Definition: dataobject.cpp:797
CSG_Grid_System::Get_xGrid_to_World
double Get_xGrid_to_World(int xGrid) const
Definition: grid.h:303
CSG_Rect
Definition: geo_tools.h:474
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:1004
CSG_Table_Record::asDouble
double asDouble(int Field) const
Definition: table_record.cpp:527
CSG_Grid::Add_Value
virtual void Add_Value(int x, int y, double Value)
Definition: grid.h:836
CSG_Grid::is_InGrid
bool is_InGrid(int x, int y, bool bCheckNoData=true) const
Definition: grid.h:621
CSG_Grid_System::Get_xTo
static int Get_xTo(int Direction, int x=0)
Definition: grid.h:338
SG_DATATYPE_Undefined
@ SG_DATATYPE_Undefined
Definition: api_core.h:1013
SG_FREE_SAFE
#define SG_FREE_SAFE(PTR)
Definition: api_core.h:205
SG_T
#define SG_T(s)
Definition: api_core.h:537
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:255
GRID_FILE_KEY_DESCRIPTION
@ GRID_FILE_KEY_DESCRIPTION
Definition: grid.h:103
SG_Grid_Cache_Set_Mode
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Mode(int Mode)
Definition: grid_memory.cpp:104
SG_DATATYPE_DWord
@ SG_DATATYPE_DWord
Definition: api_core.h:1003
CSG_Data_Object::On_Reload
virtual bool On_Reload(void)=0
CSG_Grid::Get_ObjectType
virtual TSG_Data_Object_Type Get_ObjectType(void) const
Definition: grid.h:542
CSG_Data_Object::On_Delete
virtual bool On_Delete(void)=0
CSG_Grid_Cell_Addressor::Get_Radius_Inner
double Get_Radius_Inner(void) const
Definition: grid.h:1158
CSG_Grid_Cell_Addressor::Get_Tolerance
double Get_Tolerance(void) const
Definition: grid.h:1161
CSG_Data_Object::Update
bool Update(bool bForce=false)
Definition: dataobject.cpp:777
SG_ROUND_TO_INT
#define SG_ROUND_TO_INT(x)
Definition: mat_tools.h:155
CSG_Grid::is_InGrid_byPos
bool is_InGrid_byPos(double x, double y, bool bCheckNoData=true) const
Definition: grid.h:622
GRID_FILE_KEY_Z_FACTOR
@ GRID_FILE_KEY_Z_FACTOR
Definition: grid.h:114
CSG_Grid::is_Scaled
bool is_Scaled(void) const
Definition: grid.h:587
CSG_Grid::asDouble
virtual double asDouble(int x, int y, bool bScaled=true) const
Definition: grid.h:798
CSG_Grid::asChar
virtual char asChar(sLong i, bool bScaled=true) const
Definition: grid.h:782
CSG_Table_Record
Definition: table.h:130
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:264
SG_Create_Grid
SAGA_API_DLL_EXPORT CSG_Grid * SG_Create_Grid(void)
Definition: grid.cpp:72
CSG_Grid::Get_nLineBytes
int Get_nLineBytes(void) const
Definition: grid.h:550
CSG_Data_Object::Get_NoData_Value
double Get_NoData_Value(bool bUpper=false) const
Definition: dataobject.h:253
GRID_FILE_FORMAT_Compressed
@ GRID_FILE_FORMAT_Compressed
Definition: grid.h:94
CSG_Stack::Get_Record_Pop
void * Get_Record_Pop(void)
Definition: api_core.h:965
CSG_Stack
Definition: api_core.h:933
CSG_Grid_File_Info::m_bSwapBytes
bool m_bSwapBytes
Definition: grid.h:465
GRID_FILE_FORMAT_Undefined
@ GRID_FILE_FORMAT_Undefined
Definition: grid.h:90
CSG_Grid_System
Definition: grid.h:220
GRID_FILE_KEY_BYTEORDER_BIG
@ GRID_FILE_KEY_BYTEORDER_BIG
Definition: grid.h:108
CSG_Histogram
Definition: mat_tools.h:1013
GRID_FILE_KEY_DATAFORMAT
@ GRID_FILE_KEY_DATAFORMAT
Definition: grid.h:107
CSG_Grid::Get_nValueBytes
int Get_nValueBytes(void) const
Definition: grid.h:549
GRID_FILE_FORMAT_GeoTIFF
@ GRID_FILE_FORMAT_GeoTIFF
Definition: grid.h:95
CSG_Grid_System::Get_yWorld_to_Grid
int Get_yWorld_to_Grid(double yWorld) const
Definition: grid.h:319
CSG_Data_Object::is_NoData_Value
bool is_NoData_Value(double Value) const
Definition: dataobject.h:255
GRID_FILE_KEY_POSITION_YMIN
@ GRID_FILE_KEY_POSITION_YMIN
Definition: grid.h:110
CSG_Grid::is_InGrid_byPos
bool is_InGrid_byPos(const TSG_Point &p, bool bCheckNoData=true) const
Definition: grid.h:623
SG_DATATYPE_Byte
@ SG_DATATYPE_Byte
Definition: api_core.h:999
CSG_Data_Object::Save
virtual bool Save(const CSG_String &File, int Format=0)=0
GRID_OPERATION_Multiplication
@ GRID_OPERATION_Multiplication
Definition: grid.h:197
CSG_Grid_System::Get_yGrid_to_World
double Get_yGrid_to_World(int yGrid) const
Definition: grid.h:304
CSG_Grid_System::Get_yTo
static int Get_yTo(int Direction, int y=0)
Definition: grid.h:352
CSG_Grid::is_NoData
virtual bool is_NoData(sLong i) const
Definition: grid.h:728
SG_ROUND_TO_SLONG
#define SG_ROUND_TO_SLONG(x)
Definition: mat_tools.h:158
CSG_Grid_File_Info::m_System
CSG_Grid_System m_System
Definition: grid.h:475
CSG_Grid::Mul_Value
virtual void Mul_Value(int x, int y, double Value)
Definition: grid.h:839
SG_Grid_Cache_Set_Directory
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Directory(const SG_Char *Directory)
Definition: grid_memory.cpp:87
GRID_FILE_KEY_CELLSIZE
@ GRID_FILE_KEY_CELLSIZE
Definition: grid.h:113
GRID_FILE_KEY_NODATA_VALUE
@ GRID_FILE_KEY_NODATA_VALUE
Definition: grid.h:116
GRID_OPERATION_Subtraction
@ GRID_OPERATION_Subtraction
Definition: grid.h:196
ESG_CRS_Type::Geographic
@ Geographic
TSG_Grid_File_Format
TSG_Grid_File_Format
Definition: grid.h:89
SSG_Point
Definition: geo_tools.h:128
CSG_Grid_Cell_Addressor::Get_Weight
double Get_Weight(int Index) const
Definition: grid.h:1167
CSG_Grid_Cell_Addressor::is_Sector
bool is_Sector(void) const
Definition: grid.h:1149
CSG_Stack::Get_Record
void * Get_Record(size_t i) const
Definition: api_core.h:955
CSG_Data_Object::Set_Update_Flag
void Set_Update_Flag(bool bOn=true)
Definition: dataobject.h:285
CSG_Grid::Get_System
const CSG_Grid_System & Get_System(void) const
Definition: grid.h:559
CSG_Grid::Get_XRange
double Get_XRange(bool bCells=false) const
Definition: grid.h:574
CSG_File
Definition: api_core.h:1129
CSG_Grid_Cell_Addressor::Get_Count
int Get_Count(void) const
Definition: grid.h:1163
GRID_OPERATION_Addition
@ GRID_OPERATION_Addition
Definition: grid.h:195
SSG_Rect
Definition: geo_tools.h:467
CSG_Grid_System::Get_Cellarea
double Get_Cellarea(void) const
Definition: grid.h:256
SG_Grid_Cache_Set_Threshold_MB
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold_MB(double nMegabytes)
Definition: grid_memory.cpp:133
CSG_Grid::Add_Value
virtual void Add_Value(sLong i, double Value)
Definition: grid.h:837
SG_GRIDCELLADDR_PARM_DEFAULT
#define SG_GRIDCELLADDR_PARM_DEFAULT
Definition: grid.h:1125
SG_Grid_Get_File_Format_Default
SAGA_API_DLL_EXPORT TSG_Grid_File_Format SG_Grid_Get_File_Format_Default(void)
Definition: grid_io.cpp:123
CSG_Grid::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:576
SG_DATATYPE_Long
@ SG_DATATYPE_Long
Definition: api_core.h:1006
CSG_Grid::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:567
CSG_Vector
Definition: mat_tools.h:362
CSG_Data_Object
Definition: dataobject.h:180
GRID_FILE_KEY_NAME
@ GRID_FILE_KEY_NAME
Definition: grid.h:102
gSG_Grid_File_Key_Names
const SG_Char gSG_Grid_File_Key_Names[GRID_FILE_KEY_Count][32]
Definition: grid.h:123
CSG_Grid::Set_Index
bool Set_Index(bool bOn=true)
Definition: grid.h:678
CSG_Grid_Stack::CSG_Grid_Stack
CSG_Grid_Stack(void)
Definition: grid.h:1071
CSG_Grid::Get_Cellarea
double Get_Cellarea(void) const
Definition: grid.h:568
CSG_Grid_System::Get_World_to_Grid
bool Get_World_to_Grid(int &xGrid, int &yGrid, TSG_Point ptWorld) const
Definition: grid.h:326
CSG_Grid_File_Info::m_Unit
CSG_String m_Unit
Definition: grid.h:473
CSG_Grid_System::Get_yToSave
int Get_yToSave(int Direction, int y) const
Definition: grid.h:370
GRID_FILE_KEY_DATAFILE_NAME
@ GRID_FILE_KEY_DATAFILE_NAME
Definition: grid.h:105
CSG_Grid_System::Get_YMax
double Get_YMax(bool bCells=false) const
Definition: grid.h:269
SG_Grid_Cache_Set_Threshold
SAGA_API_DLL_EXPORT void SG_Grid_Cache_Set_Threshold(int nBytes)
Definition: grid_memory.cpp:124
CSG_Grid_Cell_Addressor::Get_Weighting
CSG_Distance_Weighting & Get_Weighting(void)
Definition: grid.h:1144
SG_Grid_Get_File_Extension_Default
SAGA_API_DLL_EXPORT CSG_String SG_Grid_Get_File_Extension_Default(void)
Definition: grid_io.cpp:129
CSG_Grid_Resampling::Minimum
@ Minimum
CSG_Grid::Get_Memory_Size
sLong Get_Memory_Size(void) const
Definition: grid.h:629
CSG_Grid::Set_Value
virtual void Set_Value(sLong i, double Value, bool bScaled=true)
Definition: grid.h:843
CSG_Grid_Cell_Addressor
Definition: grid.h:1129
CSG_Data_Object::Get_Extent
virtual const CSG_Rect & Get_Extent(void)=0
sLong
signed long long sLong
Definition: api_core.h:158
SG_Grid_Set_File_Format_Default
SAGA_API_DLL_EXPORT bool SG_Grid_Set_File_Format_Default(int Format)
Definition: grid_io.cpp:106
SG_ROUND_TO_CHAR
#define SG_ROUND_TO_CHAR(x)
Definition: mat_tools.h:151
SG_ROUND_TO_WORD
#define SG_ROUND_TO_WORD(x)
Definition: mat_tools.h:152
CSG_Grid_File_Info::m_Type
TSG_Data_Type m_Type
Definition: grid.h:471
CSG_Grid::Get_Sorted
bool Get_Sorted(sLong Position, int &x, int &y, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:710
CSG_Data_Object::On_Update
virtual bool On_Update(void)
Definition: dataobject.h:287
CSG_Grid::Get_Unit
const CSG_String & Get_Unit(void) const
Definition: grid.h:553
GRID_FILE_KEY_TOPTOBOTTOM
@ GRID_FILE_KEY_TOPTOBOTTOM
Definition: grid.h:117
CSG_Grid::Mul_Value
virtual void Mul_Value(sLong i, double Value)
Definition: grid.h:840
CSG_Distance_Weighting
Definition: geo_tools.h:713
CSG_Grid::Get_NY
int Get_NY(void) const
Definition: grid.h:564
SG_DATATYPE_Float
@ SG_DATATYPE_Float
Definition: api_core.h:1007
CSG_Grid::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:572
CSG_Grid::Save
virtual bool Save(const wchar_t *File, int Format=0)
Definition: grid.h:536
CSG_Grid_System::Get_Grid_to_World
TSG_Point Get_Grid_to_World(int xGrid, int yGrid) const
Definition: grid.h:306
GRID_FILE_FORMAT_Binary_old
@ GRID_FILE_FORMAT_Binary_old
Definition: grid.h:91
CSG_Grid_System::Get_UnitLength
static double Get_UnitLength(int Direction)
Definition: grid.h:378
CSG_Grid_Cell_Addressor::Get_Radius_Outer
double Get_Radius_Outer(void) const
Definition: grid.h:1159
CSG_Grid_File_Info::m_Projection
CSG_Projection m_Projection
Definition: grid.h:477
CSG_Stack::Get_Record_Push
void * Get_Record_Push(void)
Definition: api_core.h:960
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Grid_System::is_InGrid
bool is_InGrid(int x, int y) const
Definition: grid.h:374
CSG_Grid_System::Fit_yto_Grid_System
double Fit_yto_Grid_System(double y) const
Aligns the world coordinate y to the columns of the grid system and returns it.
Definition: grid.h:290
CSG_Data_Object::Set_Modified
virtual void Set_Modified(bool bOn=true)
Definition: dataobject.h:227
CSG_Grid::Get_Sorted
bool Get_Sorted(sLong Position, sLong &i, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:705
CSG_Grid::asShort
virtual short asShort(int x, int y, bool bScaled=true) const
Definition: grid.h:783
CSG_Grid::Get_Sorted
sLong Get_Sorted(sLong Position, bool bDown=true, bool bCheckNoData=true)
Definition: grid.h:690
SG_ROUND_TO_BYTE
#define SG_ROUND_TO_BYTE(x)
Definition: mat_tools.h:150
TSG_Grid_File_Key
TSG_Grid_File_Key
Definition: grid.h:101
CSG_Grid_File_Info::m_zScale
double m_zScale
Definition: grid.h:469
grid_pyramid.h
SG_DATATYPE_Word
@ SG_DATATYPE_Word
Definition: api_core.h:1001
CSG_Grid_System::Get_Length
double Get_Length(int Direction) const
Definition: grid.h:377
SG_DATAOBJECT_TYPE_Grid
@ SG_DATAOBJECT_TYPE_Grid
Definition: dataobject.h:118
CSG_Grid_Resampling::Maximum
@ Maximum
SG_ROUND_TO_ULONG
#define SG_ROUND_TO_ULONG(x)
Definition: mat_tools.h:157
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:259
CSG_Grid_Resampling
CSG_Grid_Resampling
Definition: grid.h:156
CSG_Grid_System::Get_XMax
double Get_XMax(bool bCells=false) const
Definition: grid.h:265
CSG_Grid_System::Get_yFrom
static int Get_yFrom(int Direction, int y=0)
Definition: grid.h:367
SG_Grid_Cache_Get_Threshold_MB
SAGA_API_DLL_EXPORT double SG_Grid_Cache_Get_Threshold_MB(void)
Definition: grid_memory.cpp:145
CSG_Grid::Set_NoData
virtual void Set_NoData(sLong i)
Definition: grid.h:731
CSG_Projection
Definition: geo_tools.h:827
SG_Grid_Cache_Get_Directory
SAGA_API_DLL_EXPORT const SG_Char * SG_Grid_Cache_Get_Directory(void)
Definition: grid_memory.cpp:81
CSG_Grid_Cell_Addressor::Get_Direction
double Get_Direction(void) const
Definition: grid.h:1160
SG_Grid_Cache_Get_Mode
SAGA_API_DLL_EXPORT int SG_Grid_Cache_Get_Mode(void)
Definition: grid_memory.cpp:110
CSG_Grid_Stack::operator[]
const TSG_Point_Int & operator[](size_t i) const
Definition: grid.h:1074
CSG_Table
Definition: table.h:285
CSG_Grid_System::Get_xFromSave
int Get_xFromSave(int Direction, int x) const
Definition: grid.h:371
CSG_Grid::Set_NoData
virtual void Set_NoData(int x, int y)
Definition: grid.h:730
CSG_Data_Object::Get_Update_Flag
bool Get_Update_Flag(void)
Definition: dataobject.h:286
CSG_Grid::Get_YRange
double Get_YRange(bool bCells=false) const
Definition: grid.h:578
SG_ROUND_TO_DWORD
#define SG_ROUND_TO_DWORD(x)
Definition: mat_tools.h:154
CSG_Grid_Cell_Addressor::Get_Y
int Get_Y(int Index, int Offset=0) const
Definition: grid.h:1165
CSG_Table_Record::asInt
int asInt(int Field) const
Definition: table_record.cpp:494
CSG_Grid::Set_Value
virtual void Set_Value(int x, int y, double Value, bool bScaled=true)
Definition: grid.h:848
CSG_Grid::Save
virtual bool Save(const char *File, int Format=0)
Definition: grid.h:535
CSG_Grid_System::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:262
GRID_OPERATION_Division
@ GRID_OPERATION_Division
Definition: grid.h:198
SG_Char
#define SG_Char
Definition: api_core.h:536
TSG_Data_Object_Type
TSG_Data_Object_Type
Definition: dataobject.h:117
CSG_Grid_Cell_Addressor::Get_Values
bool Get_Values(int Index, int &x, int &y, double &Distance, double &Weight, bool bOffset=false) const
Definition: grid.h:1168
CSG_String
Definition: api_core.h:563
SG_Grid_Cache_Get_Threshold
SAGA_API_DLL_EXPORT sLong SG_Grid_Cache_Get_Threshold(void)
Definition: grid_memory.cpp:139
CSG_Grid::asLong
virtual sLong asLong(int x, int y, bool bScaled=true) const
Definition: grid.h:787
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:793
SSG_Point_Int
Definition: geo_tools.h:421
CSG_Grid_Cell_Addressor::Get_X
int Get_X(int Index, int Offset=0) const
Definition: grid.h:1164
CSG_Grid::Get_NX
int Get_NX(void) const
Definition: grid.h:563
GRID_FILE_KEY_UNITNAME
@ GRID_FILE_KEY_UNITNAME
Definition: grid.h:104
CSG_Grid::asFloat
virtual float asFloat(int x, int y, bool bScaled=true) const
Definition: grid.h:789
CSG_Grid_System::Fit_to_Grid_System
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.
Definition: grid.h:293
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Grid_Cell_Addressor::is_Square
bool is_Square(void) const
Definition: grid.h:1146
CSG_Grid::Get_Memory_Size_MB
double Get_Memory_Size_MB(void) const
Definition: grid.h:630
N_MEGABYTE_BYTES
#define N_MEGABYTE_BYTES
Definition: mat_tools.h:115
SG_DATATYPE_Short
@ SG_DATATYPE_Short
Definition: api_core.h:1002
CSG_Grid_System::Get_xWorld_to_Grid
int Get_xWorld_to_Grid(double xWorld) const
Definition: grid.h:318
CSG_Grid_System::Get_xFrom
static int Get_xFrom(int Direction, int x=0)
Definition: grid.h:366
SG_ROUND_TO_SHORT
#define SG_ROUND_TO_SHORT(x)
Definition: mat_tools.h:153
GRID_FILE_KEY_CELLCOUNT_X
@ GRID_FILE_KEY_CELLCOUNT_X
Definition: grid.h:111
GRID_FILE_KEY_Z_OFFSET
@ GRID_FILE_KEY_Z_OFFSET
Definition: grid.h:115
CSG_Grid::Get_Extent
const CSG_Rect & Get_Extent(bool bCells=false) const
Definition: grid.h:570
SSG_Point_Int::y
int y
Definition: geo_tools.h:422
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid::is_Cached
bool is_Cached(void) const
Definition: grid.h:633
CSG_Grid
Definition: grid.h:501
CSG_Grid_System::Get_World_to_Grid
bool Get_World_to_Grid(int &xGrid, int &yGrid, double xWorld, double yWorld) const
Definition: grid.h:321
CSG_Grid_Stack::Pop
virtual bool Pop(int &x, int &y)
Definition: grid.h:1093
SG_DATATYPE_Bit
@ SG_DATATYPE_Bit
Definition: api_core.h:998
CSG_Grid_System::Get_YRange
double Get_YRange(bool bCells=false) const
Definition: grid.h:270
CSG_Grid_System::Get_XRange
double Get_XRange(bool bCells=false) const
Definition: grid.h:266
CSG_Grid_Cell_Addressor::Get_Distance
double Get_Distance(int Index) const
Definition: grid.h:1166
CSG_Grid::asFloat
virtual float asFloat(sLong i, bool bScaled=true) const
Definition: grid.h:790
CSG_Grid::asLong
virtual sLong asLong(sLong i, bool bScaled=true) const
Definition: grid.h:788
CSG_Grid_Cell_Addressor::is_Annulus
bool is_Annulus(void) const
Definition: grid.h:1148
CSG_Grid::asByte
virtual BYTE asByte(sLong i, bool bScaled=true) const
Definition: grid.h:780
CSG_Grid::asByte
virtual BYTE asByte(int x, int y, bool bScaled=true) const
Definition: grid.h:779
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:258
CSG_Grid_Stack::Push
virtual bool Push(int x, int y)
Definition: grid.h:1077
CSG_Grid_System::Get_RowColFromIndex
bool Get_RowColFromIndex(int &x, int &y, sLong i) const
Definition: grid.h:393
CSG_Grid::asChar
virtual char asChar(int x, int y, bool bScaled=true) const
Definition: grid.h:781
CSG_Grid_Cell_Addressor::Get_Radius
double Get_Radius(bool bOuter=true) const
Definition: grid.h:1157
CSG_Parameters
Definition: parameters.h:1696
CSG_Grid_Cell_Addressor::is_Circle
bool is_Circle(void) const
Definition: grid.h:1147
TSG_Data_Type
TSG_Data_Type
Definition: api_core.h:997
operator*
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
GRID_FILE_KEY_CELLCOUNT_Y
@ GRID_FILE_KEY_CELLCOUNT_Y
Definition: grid.h:112
CSG_Grid::asShort
virtual short asShort(sLong i, bool bScaled=true) const
Definition: grid.h:784
GRID_FILE_FORMAT_Binary
@ GRID_FILE_FORMAT_Binary
Definition: grid.h:92
GRID_FILE_KEY_Count
@ GRID_FILE_KEY_Count
Definition: grid.h:118
CSG_Grid_System::Get_yFromSave
int Get_yFromSave(int Direction, int y) const
Definition: grid.h:372
CSG_Grid::is_NoData
virtual bool is_NoData(int x, int y) const
Definition: grid.h:727
GRID_FILE_KEY_POSITION_XMIN
@ GRID_FILE_KEY_POSITION_XMIN
Definition: grid.h:109
SSG_Point_Int::x
int x
Definition: geo_tools.h:422
GRID_FILE_FORMAT_ASCII
@ GRID_FILE_FORMAT_ASCII
Definition: grid.h:93
CSG_Grid_System::Get_Neighbor_Pos
bool Get_Neighbor_Pos(int Direction, int x, int y, int &xPos, int &yPos) const
Definition: grid.h:333
CSG_Grid::Get_Extent
virtual const CSG_Rect & Get_Extent(void)
Definition: grid.h:561
CSG_Grid_System::Fit_xto_Grid_System
double Fit_xto_Grid_System(double x) const
Aligns the world coordinate x to the rows of the grid system and returns it.
Definition: grid.h:287
GRID_FILE_KEY_DATAFILE_OFFSET
@ GRID_FILE_KEY_DATAFILE_OFFSET
Definition: grid.h:106
CSG_Simple_Statistics
Definition: mat_tools.h:725
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:268
uLong
unsigned long long uLong
Definition: api_core.h:159
CSG_Grid_System::Get_xToSave
int Get_xToSave(int Direction, int x) const
Definition: grid.h:369
SG_DATATYPE_Char
@ SG_DATATYPE_Char
Definition: api_core.h:1000
table.h
CSG_Data_Object::Destroy
virtual bool Destroy(void)
Definition: dataobject.cpp:281
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:785
SG_DATATYPE_ULong
@ SG_DATATYPE_ULong
Definition: api_core.h:1005
CSG_Grid_Stack
Definition: grid.h:1069
CSG_Data_Object::is_Valid
virtual bool is_Valid(void) const =0
CSG_Grid::Get_XMax
double Get_XMax(bool bCells=false) const
Definition: grid.h:573
CSG_Grid_System::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:260
CSG_Grid::asInt
virtual int asInt(sLong i, bool bScaled=true) const
Definition: grid.h:786
CSG_Grid::Get_NCells
sLong Get_NCells(void) const
Definition: grid.h:565
CSG_Grid_File_Info
Definition: grid.h:436
TSG_Grid_Operation
TSG_Grid_Operation
Definition: grid.h:194
CSG_Grid_System::is_InGrid
bool is_InGrid(int x, int y, int Rand) const
Definition: grid.h:375
CSG_Grid::Get_YMax
double Get_YMax(bool bCells=false) const
Definition: grid.h:577
CSG_Grid::Set_Modified
virtual void Set_Modified(bool bModified=true)
Definition: grid.h:664
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:1008
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473