SAGA API  v9.2
grid_system.cpp
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_system.cpp //
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 Hamburg //
44 // Germany //
45 // //
46 // e-mail: oconrad@saga-gis.org //
47 // //
49 
50 //---------------------------------------------------------
51 #include "grid.h"
52 #include "shapes.h"
53 #include "parameters.h"
54 
55 
57 // //
58 // //
59 // //
61 
62 //---------------------------------------------------------
63 int CSG_Grid_System::m_Precision = 16; // 16 decimal digits, default precision used for storing cellsize and extent
64 
65 //---------------------------------------------------------
67 {
68  if( Decimals >= 0 )
69  {
70  m_Precision = Decimals;
71  }
72 
73  return( m_Precision );
74 }
75 
76 //---------------------------------------------------------
78 {
79  return( m_Precision );
80 }
81 
82 
84 // //
86 
87 //---------------------------------------------------------
89 {
90  Destroy();
91 }
92 
93 //---------------------------------------------------------
95 {
96  Create(System);
97 }
98 
99 //---------------------------------------------------------
100 CSG_Grid_System::CSG_Grid_System(double Cellsize, const CSG_Rect &Extent)
101 {
102  Create(Cellsize, Extent);
103 }
104 
105 //---------------------------------------------------------
106 CSG_Grid_System::CSG_Grid_System(double Cellsize, double xMin, double yMin, double xMax, double yMax)
107 {
108  Create(Cellsize, xMin, yMin, xMax, yMax);
109 }
110 
111 //---------------------------------------------------------
112 CSG_Grid_System::CSG_Grid_System(double Cellsize, double xMin, double yMin, int NX, int NY)
113 {
114  Create(Cellsize, xMin, yMin, NX, NY);
115 }
116 
117 //---------------------------------------------------------
119 {
120  Destroy();
121 }
122 
123 
125 // //
127 
128 //---------------------------------------------------------
130 {
131  m_NX = System.m_NX;
132  m_NY = System.m_NY;
133  m_NCells = System.m_NCells;
134 
135  m_Cellsize = System.m_Cellsize;
136  m_Cellarea = System.m_Cellarea;
137  m_Diagonal = System.m_Diagonal;
138 
139  m_Extent = System.m_Extent;
140  m_Extent_Cells = System.m_Extent_Cells;
141 
142  return( is_Valid() );
143 }
144 
145 //---------------------------------------------------------
146 bool CSG_Grid_System::Create(double Cellsize, const CSG_Rect &Extent)
147 {
148  if( Cellsize > 0. && Extent.Get_XRange() >= 0. && Extent.Get_YRange() >= 0. )
149  {
150  int nx = 1 + (int)(0.5 + Extent.Get_XRange() / Cellsize);
151  int ny = 1 + (int)(0.5 + Extent.Get_YRange() / Cellsize);
152 
153  double x = fabs(Cellsize - Extent.Get_XRange() / (nx - 1.)) <= 0. ? Extent.Get_XMin() : Extent.Get_Center().x - Cellsize * (nx - 1.) / 2.;
154  double y = fabs(Cellsize - Extent.Get_YRange() / (ny - 1.)) <= 0. ? Extent.Get_YMin() : Extent.Get_Center().y - Cellsize * (ny - 1.) / 2.;
155 
156  return( Create(Cellsize, x, y, nx, ny) );
157  }
158 
159  Destroy();
160 
161  return( false );
162 }
163 
164 //---------------------------------------------------------
165 bool CSG_Grid_System::Create(double Cellsize, double xMin, double yMin, double xMax, double yMax)
166 {
167  return( Create(Cellsize, CSG_Rect(xMin, yMin, xMax, yMax)) );
168 }
169 
170 //---------------------------------------------------------
171 bool CSG_Grid_System::Create(double Cellsize, double xMin, double yMin, int NX, int NY)
172 {
173  if( Cellsize > 0. && NX > 0 && NY > 0 )
174  {
175  Cellsize = SG_Get_Rounded(Cellsize, m_Precision);
176  xMin = SG_Get_Rounded(xMin , m_Precision);
177  yMin = SG_Get_Rounded(yMin , m_Precision);
178 
179  if( Cellsize > 0. )
180  {
181  m_NX = NX;
182  m_NY = NY;
183  m_NCells = (sLong)NY * NX;
184 
185  m_Cellsize = Cellsize;
186  m_Cellarea = Cellsize * Cellsize;
187  m_Diagonal = Cellsize * sqrt(2.);
188 
189  m_Extent.xMin = xMin;
190  m_Extent.yMin = yMin;
191  m_Extent.xMax = xMin + (NX - 1.) * Cellsize;
192  m_Extent.yMax = yMin + (NY - 1.) * Cellsize;
193 
194  m_Extent_Cells = m_Extent;
195  m_Extent_Cells.Inflate(0.5 * Cellsize, false);
196 
197  return( true );
198  }
199  }
200 
201  //-----------------------------------------------------
202  m_NX = 0;
203  m_NY = 0;
204  m_NCells = 0;
205 
206  m_Cellsize = 0.;
207  m_Cellarea = 0.;
208  m_Diagonal = 0.;
209 
210  m_Extent .Assign(0., 0., 0., 0.);
211  m_Extent_Cells .Assign(0., 0., 0., 0.);
212 
213  return( false );
214 }
215 
216 //---------------------------------------------------------
218 {
219  Create(0., 0., 0., 0, 0);
220 
221  return( true );
222 }
223 
224 //---------------------------------------------------------
226 { return( Create(System) ); }
227 
228 bool CSG_Grid_System::Assign(double Cellsize, const CSG_Rect &Extent)
229 { return( Create(Cellsize, Extent) ); }
230 
231 bool CSG_Grid_System::Assign(double Cellsize, double xMin, double yMin, double xMax, double yMax)
232 { return( Create(Cellsize, xMin, yMin, xMax, yMax) ); }
233 
234 bool CSG_Grid_System::Assign(double Cellsize, double xMin, double yMin, int NX, int NY)
235 { return( Create(Cellsize, xMin, yMin, NX, NY) ); }
236 
237 
239 // //
241 
242 //---------------------------------------------------------
244 {
245  return( m_Cellsize > 0. );
246 }
247 
248 //---------------------------------------------------------
249 const SG_Char * CSG_Grid_System::Get_Name(bool bShort)
250 {
251  if( is_Valid() )
252  {
253  if( bShort )
254  {
255  m_Name.Printf("%.*f; %dx %dy; %.*fx %.*fy",
257  Get_NX(), Get_NY(),
260  );
261  }
262  else
263  {
264  m_Name.Printf("%s: %f, %s: %dx/%dy, %s: %fx/%fy",
265  _TL("Cell size" ), Get_Cellsize(),
266  _TL("Number of cells" ), Get_NX(), Get_NY(),
267  _TL("Lower left corner"), Get_XMin(), Get_YMin()
268  );
269  }
270  }
271  else
272  {
273  m_Name = _TL("<not set>");
274  }
275 
276  return( m_Name );
277 }
278 
279 
281 // //
283 
284 //---------------------------------------------------------
286 {
287  return( is_Equal(System) );
288 }
289 
290 //---------------------------------------------------------
292 {
293  Create(System);
294 }
295 
296 
298 // //
300 
301 //---------------------------------------------------------
303 {
304  return( m_Cellsize == System.m_Cellsize
305  && m_NX == System.m_NX
306  && m_NY == System.m_NY
307  && m_Extent.xMin == System.m_Extent.xMin
308  && m_Extent.yMin == System.m_Extent.yMin
309  );
310 }
311 
312 //---------------------------------------------------------
313 bool CSG_Grid_System::is_Equal(double Cellsize, const TSG_Rect &Extent) const
314 {
315  return( m_Cellsize == Cellsize && m_Extent == Extent );
316 }
317 
318 
320 // //
321 // //
322 // //
324 
325 //---------------------------------------------------------
327 {
328  m_Kernel.Add_Field("X", SG_DATATYPE_Int );
329  m_Kernel.Add_Field("Y", SG_DATATYPE_Int );
330  m_Kernel.Add_Field("D", SG_DATATYPE_Double);
331  m_Kernel.Add_Field("W", SG_DATATYPE_Double);
332 }
333 
334 //---------------------------------------------------------
336 {
337  m_Kernel.Del_Records();
338 
339  m_Radius = 1.;
340  m_Radius_0 = 0.;
341  m_Direction = 0.;
342  m_Tolerance = 0.;
343 
344  return( true );
345 }
346 
347 
349 // //
351 
352 //---------------------------------------------------------
353 bool CSG_Grid_Cell_Addressor::Add_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, int Style)
354 {
355  CSG_String Types;
356 
357  if( (Style & SG_GRIDCELLADDR_PARM_SQUARE ) != 0 )
358  {
359  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_SQUARE , _TL("Square" ));
360  }
361 
362  if( (Style & SG_GRIDCELLADDR_PARM_CIRCLE ) != 0 )
363  {
364  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_CIRCLE , _TL("Circle" ));
365  }
366 
367  if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
368  {
369  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_ANNULUS, _TL("Annulus"));
370  }
371 
372  if( (Style & SG_GRIDCELLADDR_PARM_SECTOR ) != 0 )
373  {
374  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_SECTOR , _TL("Sector" ));
375  }
376 
377  Parameters.Add_Choice(Parent, "KERNEL_TYPE", _TL("Kernel Type"),
378  _TL("The kernel's shape."),
379  Types, 1
380  );
381 
382  Parameters.Set_Enabled("KERNEL_TYPE", Parameters("KERNEL_TYPE")->asChoice()->Get_Count() > 1);
383 
384  //-----------------------------------------------------
385  CSG_String Unit_Radius((Style & SG_GRIDCELLADDR_PARM_MAPUNIT) == 0 ? _TL("cells") : _TL("map units"));
386 
387  if( (Style & SG_GRIDCELLADDR_PARM_SIZEDBL) != 0 )
388  {
389  if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
390  {
391  Parameters.Add_Double("KERNEL_TYPE", "KERNEL_INNER" , _TL("Inner Radius"), Unit_Radius, 0., 0., true);
392  }
393 
394  Parameters .Add_Double("KERNEL_TYPE", "KERNEL_RADIUS", _TL( "Radius"), Unit_Radius, 1., 0., true);
395  }
396  else
397  {
398  if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
399  {
400  Parameters.Add_Int ("KERNEL_TYPE", "KERNEL_INNER" , _TL("Inner Radius"), Unit_Radius, 0 , 0 , true);
401  }
402 
403  Parameters .Add_Int ("KERNEL_TYPE", "KERNEL_RADIUS", _TL( "Radius"), Unit_Radius, 2 , 0 , true);
404  }
405 
406  //-----------------------------------------------------
407  if( (Style & SG_GRIDCELLADDR_PARM_SECTOR) != 0 )
408  {
409  Parameters.Add_Double("KERNEL_TYPE", "KERNEL_DIRECTION", _TL("Direction"), _TL("degree"), 0., -360., true, 360., true);
410  Parameters.Add_Double("KERNEL_TYPE", "KERNEL_TOLERANCE", _TL("Tolerance"), _TL("degree"), 5., 0., true, 180., true);
411  }
412 
413  if( (Style & SG_GRIDCELLADDR_PARM_WEIGHTING) != 0 )
414  {
416  Parameters("KERNEL_TYPE")->is_Enabled() ? CSG_String("KERNEL_TYPE") : Parent
417  );
418  }
419 
420  return( true );
421 }
422 
423 //---------------------------------------------------------
425 {
426  if( Type == 0 && Parameters("KERNEL_TYPE") )
427  {
428  Parameters("KERNEL_TYPE")->asChoice()->Get_Data(Type);
429  }
430 
431  switch( Type )
432  {
434  return( Set_Radius(
435  Parameters("KERNEL_RADIUS" )->asDouble(),
436  true
437  ));
438 
440  return( Set_Radius(
441  Parameters("KERNEL_RADIUS" )->asDouble(),
442  false
443  ));
444 
446  return( Set_Annulus(
447  Parameters("KERNEL_INNER" )->asDouble(),
448  Parameters("KERNEL_RADIUS" )->asDouble()
449  ));
450 
452  return( Set_Sector(
453  Parameters("KERNEL_RADIUS" )->asDouble(),
454  Parameters("KERNEL_DIRECTION")->asDouble() * M_DEG_TO_RAD,
455  Parameters("KERNEL_TOLERANCE")->asDouble() * M_DEG_TO_RAD
456  ));
457  }
458 
459  return( false );
460 }
461 
462 //---------------------------------------------------------
467 
468 
470 // //
472 
473 //---------------------------------------------------------
475 {
476  if( Parameters("KERNEL_TYPE") )
477  {
478  int Type = Parameters("KERNEL_TYPE")->asChoice()->Get_Item_Data(Parameters("KERNEL_TYPE")->asInt()).asInt();
479 
480  Parameters.Set_Enabled("KERNEL_INNER" , Type == SG_GRIDCELLADDR_PARM_ANNULUS);
481  Parameters.Set_Enabled("KERNEL_DIRECTION", Type == SG_GRIDCELLADDR_PARM_SECTOR );
482  Parameters.Set_Enabled("KERNEL_TOLERANCE", Type == SG_GRIDCELLADDR_PARM_SECTOR );
483  }
484 
486 
487  return( true );
488 }
489 
490 
492 // //
494 
495 //---------------------------------------------------------
496 bool CSG_Grid_Cell_Addressor::_Set_Kernel(int Type, double Radius, double Radius_Inner, double Direction, double Tolerance)
497 {
498  Destroy();
499 
500  m_Type = Type;
501  m_Radius = Radius;
502  m_Radius_0 = Radius_Inner;
503  m_Direction = fmod(Direction, M_PI_360); if( Direction < 0. ) Direction += M_PI_360;
504  m_Tolerance = fmod(Tolerance, M_PI_180); if( Tolerance < 0. ) Tolerance += M_PI_180;
505 
506  if( m_Radius < 0. || m_Radius < m_Radius_0 )
507  {
508  return( false );
509  }
510 
511  CSG_Vector Sector(2);
512 
513  if( m_Type == 3 ) // sector
514  {
515  Sector[0] = fmod(Direction - Tolerance, M_PI_360); if( Sector[0] < 0. ) Sector[0] += M_PI_360;
516  Sector[1] = fmod(Direction + Tolerance, M_PI_360); if( Sector[1] < 0. ) Sector[1] += M_PI_360;
517  }
518 
519  //-----------------------------------------------------
520  #define ADD_CELL(x, y, Distance) {\
521  CSG_Table_Record &Cell = *Kernel.Add_Record();\
522  Cell.Set_Value(0, x);\
523  Cell.Set_Value(1, y);\
524  Cell.Set_Value(2, Distance);\
525  Cell.Set_Value(3, m_Weighting.Get_Weight(d));\
526  }
527 
528  CSG_Table Kernel(&m_Kernel);
529 
530  int Size = (int)ceil(m_Radius);
531 
532  //-----------------------------------------------------
533  for(int y=-Size; y<=Size; y++)
534  {
535  if( abs(y) > m_Radius )
536  continue;
537 
538  for(int x=-Size; x<=Size; x++)
539  {
540  if( abs(x) > m_Radius )
541  continue;
542 
543  double d = SG_Get_Length(x, y);
544 
545  switch( m_Type )
546  {
547  default: // square
548  ADD_CELL(x, y, d);
549  break;
550 
551  case 1: // circle
552  if( d <= m_Radius )
553  {
554  ADD_CELL(x, y, d);
555  }
556  break;
557 
558  case 2: // annulus
559  if( d <= m_Radius && d >= m_Radius_0 )
560  {
561  ADD_CELL(x, y, d);
562  }
563  break;
564 
565  case 3: // sector
566  if( d <= m_Radius && d >= m_Radius_0 && ((x == 0 && y == 0) || SG_is_Angle_Between(SG_Get_Angle_Of_Direction(x, y), Sector[0], Sector[1], false)) )
567  {
568  ADD_CELL(x, y, d);
569  }
570  break;
571  }
572  }
573  }
574 
575  //-----------------------------------------------------
576  if( Kernel.Get_Count() < 1 )
577  {
578  return( false );
579  }
580 
581  Kernel.Set_Index(2, TABLE_INDEX_Ascending);
582 
583  for(int i=0; i<Kernel.Get_Count(); i++)
584  {
585  m_Kernel.Add_Record(Kernel.Get_Record_byIndex(i));
586  }
587 
588  return( true );
589 }
590 
591 //---------------------------------------------------------
592 bool CSG_Grid_Cell_Addressor::Set_Radius(double Radius, bool bSquare)
593 {
594  return( bSquare ? Set_Square(Radius) : Set_Circle(Radius) );
595 }
596 
597 //---------------------------------------------------------
599 {
600  return( _Set_Kernel(0, Radius, 0., 0., 0.) );
601 }
602 
603 //---------------------------------------------------------
605 {
606  return( _Set_Kernel(1, Radius, 0., 0., 0.) );
607 }
608 
609 //---------------------------------------------------------
610 bool CSG_Grid_Cell_Addressor::Set_Annulus(double Radius_Inner, double Radius_Outer)
611 {
612  return( _Set_Kernel(2, Radius_Outer, Radius_Inner, 0., 0.) );
613 }
614 
615 //---------------------------------------------------------
616 bool CSG_Grid_Cell_Addressor::Set_Sector(double Radius, double Direction, double Tolerance)
617 {
618  return( _Set_Kernel(3, Radius, 0., Direction, Tolerance) );
619 }
620 
621 
623 // //
624 // //
625 // //
627 
628 //---------------------------------------------------------
M_DEG_TO_RAD
#define M_DEG_TO_RAD
Definition: mat_tools.h:111
CSG_Rect
Definition: geo_tools.h:471
SG_DATATYPE_Int
@ SG_DATATYPE_Int
Definition: api_core.h:992
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_Grid_System::Get_Precision
static int Get_Precision(void)
Definition: grid_system.cpp:77
CSG_Grid_System::Get_Cellsize
double Get_Cellsize(void) const
Definition: grid.h:231
_TL
#define _TL(s)
Definition: api_core.h:1480
CSG_Table::Del_Records
virtual bool Del_Records(void)
Definition: table.cpp:912
CSG_Distance_Weighting::Enable_Parameters
static bool Enable_Parameters(class CSG_Parameters &Parameters)
Definition: geo_classes.cpp:1418
SG_GRIDCELLADDR_PARM_SECTOR
#define SG_GRIDCELLADDR_PARM_SECTOR
Definition: grid.h:1095
SG_Get_Rounded
double SG_Get_Rounded(double Value, int Decimals)
Definition: mat_tools.cpp:83
CSG_Grid_System::Get_XMin
double Get_XMin(bool bCells=false) const
Definition: grid.h:240
CSG_Grid_System
Definition: grid.h:200
SG_GRIDCELLADDR_PARM_SQUARE
#define SG_GRIDCELLADDR_PARM_SQUARE
Definition: grid.h:1092
grid.h
CSG_Parameters::Add_Double
CSG_Parameter * Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
Definition: parameters.cpp:406
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
CSG_Grid_Cell_Addressor::Set_Square
bool Set_Square(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:463
SG_GRIDCELLADDR_PARM_WEIGHTING
#define SG_GRIDCELLADDR_PARM_WEIGHTING
Definition: grid.h:1098
SG_Get_Angle_Of_Direction
double SG_Get_Angle_Of_Direction(double dx, double dy)
Definition: geo_functions.cpp:216
CSG_Grid_System::Create
bool Create(const CSG_Grid_System &System)
Definition: grid_system.cpp:129
CSG_Grid_Cell_Addressor::Destroy
bool Destroy(void)
Definition: grid_system.cpp:335
CSG_Grid_Cell_Addressor::Get_Count
int Get_Count(void) const
Definition: grid.h:1137
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
CSG_Grid_Cell_Addressor::Enable_Parameters
static bool Enable_Parameters(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:474
SG_GRIDCELLADDR_PARM_CIRCLE
#define SG_GRIDCELLADDR_PARM_CIRCLE
Definition: grid.h:1093
CSG_Grid_System::CSG_Grid_System
CSG_Grid_System(void)
Definition: grid_system.cpp:88
CSG_Grid_System::Get_Name
const SG_Char * Get_Name(bool bShort=true)
Definition: grid_system.cpp:249
CSG_Grid_System::Set_Precision
static int Set_Precision(int Decimals)
Definition: grid_system.cpp:66
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
CSG_Vector
Definition: mat_tools.h:345
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Grid_System::is_Equal
bool is_Equal(const CSG_Grid_System &System) const
Definition: grid_system.cpp:302
CSG_Grid_Cell_Addressor::Add_Parameters
static bool Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", int Style=SG_GRIDCELLADDR_PARM_DEFAULT)
Definition: grid_system.cpp:353
CSG_Rect::Assign
void Assign(double xMin, double yMin, double xMax, double yMax)
Definition: geo_classes.cpp:721
CSG_Parameters::Set_Enabled
void Set_Enabled(bool bEnabled=true)
Definition: parameters.cpp:336
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Rect::Inflate
void Inflate(double d, bool bPercent=true)
Definition: geo_classes.cpp:816
CSG_Grid_Cell_Addressor::Set_Parameters
bool Set_Parameters(class CSG_Parameters &Parameters, int Type=0)
Definition: grid_system.cpp:424
SG_GRIDCELLADDR_PARM_ANNULUS
#define SG_GRIDCELLADDR_PARM_ANNULUS
Definition: grid.h:1094
CSG_Parameters::Add_Int
CSG_Parameter * Add_Int(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0, int Minimum=0, bool bMinimum=false, int Maximum=0, bool bMaximum=false)
Definition: parameters.cpp:401
CSG_Grid_System::Destroy
bool Destroy(void)
Definition: grid_system.cpp:217
SG_Get_Length
double SG_Get_Length(double dx, double dy)
Definition: geo_functions.cpp:97
CSG_Grid_System::Assign
bool Assign(const CSG_Grid_System &System)
Definition: grid_system.cpp:225
M_PI_180
#define M_PI_180
Definition: mat_tools.h:104
SG_Get_Significant_Decimals
SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals(double Value, int maxDecimals=6)
Definition: api_string.cpp:1274
CSG_Grid_Cell_Addressor::Set_Radius
bool Set_Radius(double Radius, bool bSquare=false)
Definition: grid_system.cpp:592
SG_is_Angle_Between
bool SG_is_Angle_Between(double Angle, double Angle_Min, double Angle_Max, bool bCheckRange)
Definition: geo_functions.cpp:257
CSG_Grid_Cell_Addressor::CSG_Grid_Cell_Addressor
CSG_Grid_Cell_Addressor(void)
Definition: grid_system.cpp:326
CSG_Grid_Cell_Addressor::Set_Circle
bool Set_Circle(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:464
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
CSG_Grid_System::Get_NY
int Get_NY(void) const
Definition: grid.h:235
parameters.h
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_Table::Add_Field
virtual bool Add_Field(const CSG_String &Name, TSG_Data_Type Type, int Position=-1)
Definition: table.cpp:487
CSG_Table
Definition: table.h:283
ADD_CELL
#define ADD_CELL(x, y, Distance)
SG_GRIDCELLADDR_PARM_SIZEDBL
#define SG_GRIDCELLADDR_PARM_SIZEDBL
Definition: grid.h:1096
SG_Char
#define SG_Char
Definition: api_core.h:530
shapes.h
CSG_String
Definition: api_core.h:557
CSG_Grid::asDouble
virtual double asDouble(sLong i, bool bScaled=true) const
Definition: grid.h:765
CSG_Distance_Weighting::Add_Parameters
static bool Add_Parameters(class CSG_Parameters &Parameters, const CSG_String &Parent="", bool bIDW_Offset=false)
Definition: geo_classes.cpp:1380
CSG_Grid_System::operator=
void operator=(const CSG_Grid_System &System)
Definition: grid_system.cpp:291
CSG_Rect::Get_Center
CSG_Point Get_Center(void) const
Definition: geo_tools.h:514
CSG_Grid_Cell_Addressor::Set_Sector
bool Set_Sector(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:466
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
M_PI_360
#define M_PI_360
Definition: mat_tools.h:108
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
SSG_Point::y
double y
Definition: geo_tools.h:129
SG_GRIDCELLADDR_PARM_MAPUNIT
#define SG_GRIDCELLADDR_PARM_MAPUNIT
Definition: grid.h:1097
TABLE_INDEX_Ascending
@ TABLE_INDEX_Ascending
Definition: table.h:105
CSG_Grid_System::Get_NX
int Get_NX(void) const
Definition: grid.h:234
CSG_Grid_Cell_Addressor::Set_Annulus
bool Set_Annulus(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:465
CSG_Parameters
Definition: parameters.h:1650
CSG_Table::Add_Record
virtual CSG_Table_Record * Add_Record(CSG_Table_Record *pCopy=NULL)
Definition: table.cpp:799
CSG_Grid_System::Get_YMin
double Get_YMin(bool bCells=false) const
Definition: grid.h:244
CSG_Grid_System::operator==
bool operator==(const CSG_Grid_System &System) const
Definition: grid_system.cpp:285
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:757
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Grid_System::is_Valid
bool is_Valid(void) const
Definition: grid_system.cpp:243
CSG_Grid_System::~CSG_Grid_System
~CSG_Grid_System(void)
Definition: grid_system.cpp:118
CSG_Parameters::Add_Choice
CSG_Parameter * Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
Definition: parameters.cpp:464
SG_DATATYPE_Double
@ SG_DATATYPE_Double
Definition: api_core.h:996