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