SAGA API  v9.6
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  Create(System);
303 
304  return( *this );
305 }
306 
307 //---------------------------------------------------------
309 {
310  return( is_Equal(System) == true );
311 }
312 
314 {
315  return( is_Equal(System) == false );
316 }
317 
318 
320 // //
322 
323 //---------------------------------------------------------
325 {
326  return( m_Cellsize == System.m_Cellsize
327  && m_NX == System.m_NX
328  && m_NY == System.m_NY
329  && m_Extent.xMin == System.m_Extent.xMin
330  && m_Extent.yMin == System.m_Extent.yMin
331  );
332 }
333 
334 //---------------------------------------------------------
335 bool CSG_Grid_System::is_Equal(double Cellsize, const TSG_Rect &Extent) const
336 {
337  return( m_Cellsize == Cellsize && m_Extent == Extent );
338 }
339 
340 
342 // //
343 // //
344 // //
346 
347 //---------------------------------------------------------
349 {
350  m_Kernel.Add_Field("X", SG_DATATYPE_Int );
351  m_Kernel.Add_Field("Y", SG_DATATYPE_Int );
352  m_Kernel.Add_Field("D", SG_DATATYPE_Double);
353  m_Kernel.Add_Field("W", SG_DATATYPE_Double);
354 }
355 
356 //---------------------------------------------------------
358 {
359  m_Kernel.Del_Records();
360 
361  m_Radius = 1.;
362  m_Radius_0 = 0.;
363  m_Direction = 0.;
364  m_Tolerance = 0.;
365 
366  return( true );
367 }
368 
369 
371 // //
373 
374 //---------------------------------------------------------
375 bool CSG_Grid_Cell_Addressor::Add_Parameters(CSG_Parameters &Parameters, const CSG_String &Parent, int Style)
376 {
377  CSG_String Types;
378 
379  if( (Style & SG_GRIDCELLADDR_PARM_SQUARE ) != 0 )
380  {
381  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_SQUARE , _TL("Square" ));
382  }
383 
384  if( (Style & SG_GRIDCELLADDR_PARM_CIRCLE ) != 0 )
385  {
386  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_CIRCLE , _TL("Circle" ));
387  }
388 
389  if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
390  {
391  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_ANNULUS, _TL("Annulus"));
392  }
393 
394  if( (Style & SG_GRIDCELLADDR_PARM_SECTOR ) != 0 )
395  {
396  Types += CSG_String::Format("{%d}%s|", SG_GRIDCELLADDR_PARM_SECTOR , _TL("Sector" ));
397  }
398 
399  Parameters.Add_Choice(Parent, "KERNEL_TYPE", _TL("Kernel Type"),
400  _TL("The kernel's shape."),
401  Types, 1
402  );
403 
404  Parameters.Set_Enabled("KERNEL_TYPE", Parameters("KERNEL_TYPE")->asChoice()->Get_Count() > 1);
405 
406  //-----------------------------------------------------
407  CSG_String Unit_Radius((Style & SG_GRIDCELLADDR_PARM_MAPUNIT) == 0 ? _TL("cells") : _TL("map units"));
408 
409  if( (Style & SG_GRIDCELLADDR_PARM_SIZEDBL) != 0 )
410  {
411  if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
412  {
413  Parameters.Add_Double("KERNEL_TYPE", "KERNEL_INNER" , _TL("Inner Radius"), Unit_Radius, 0., 0., true);
414  }
415 
416  Parameters .Add_Double("KERNEL_TYPE", "KERNEL_RADIUS", _TL( "Radius"), Unit_Radius, 1., 0., true);
417  }
418  else
419  {
420  if( (Style & SG_GRIDCELLADDR_PARM_ANNULUS) != 0 )
421  {
422  Parameters.Add_Int ("KERNEL_TYPE", "KERNEL_INNER" , _TL("Inner Radius"), Unit_Radius, 0 , 0 , true);
423  }
424 
425  Parameters .Add_Int ("KERNEL_TYPE", "KERNEL_RADIUS", _TL( "Radius"), Unit_Radius, 2 , 0 , true);
426  }
427 
428  //-----------------------------------------------------
429  if( (Style & SG_GRIDCELLADDR_PARM_SECTOR) != 0 )
430  {
431  Parameters.Add_Double("KERNEL_TYPE", "KERNEL_DIRECTION", _TL("Direction"), _TL("degree"), 0., -360., true, 360., true);
432  Parameters.Add_Double("KERNEL_TYPE", "KERNEL_TOLERANCE", _TL("Tolerance"), _TL("degree"), 5., 0., true, 180., true);
433  }
434 
435  if( (Style & SG_GRIDCELLADDR_PARM_WEIGHTING) != 0 )
436  {
438  Parameters("KERNEL_TYPE")->is_Enabled() ? CSG_String("KERNEL_TYPE") : Parent
439  );
440  }
441 
442  return( true );
443 }
444 
445 //---------------------------------------------------------
447 {
448  if( Type == 0 && Parameters("KERNEL_TYPE") )
449  {
450  Parameters("KERNEL_TYPE")->asChoice()->Get_Data(Type);
451  }
452 
453  switch( Type )
454  {
456  return( Set_Radius(
457  Parameters("KERNEL_RADIUS" )->asDouble(),
458  true
459  ));
460 
462  return( Set_Radius(
463  Parameters("KERNEL_RADIUS" )->asDouble(),
464  false
465  ));
466 
468  return( Set_Annulus(
469  Parameters("KERNEL_INNER" )->asDouble(),
470  Parameters("KERNEL_RADIUS" )->asDouble()
471  ));
472 
474  return( Set_Sector(
475  Parameters("KERNEL_RADIUS" )->asDouble(),
476  Parameters("KERNEL_DIRECTION")->asDouble() * M_DEG_TO_RAD,
477  Parameters("KERNEL_TOLERANCE")->asDouble() * M_DEG_TO_RAD
478  ));
479  }
480 
481  return( false );
482 }
483 
484 //---------------------------------------------------------
489 
490 
492 // //
494 
495 //---------------------------------------------------------
497 {
498  if( Parameters("KERNEL_TYPE") )
499  {
500  int Type = Parameters("KERNEL_TYPE")->asChoice()->Get_Item_Data(Parameters("KERNEL_TYPE")->asInt()).asInt();
501 
502  Parameters.Set_Enabled("KERNEL_INNER" , Type == SG_GRIDCELLADDR_PARM_ANNULUS);
503  Parameters.Set_Enabled("KERNEL_DIRECTION", Type == SG_GRIDCELLADDR_PARM_SECTOR );
504  Parameters.Set_Enabled("KERNEL_TOLERANCE", Type == SG_GRIDCELLADDR_PARM_SECTOR );
505  }
506 
508 
509  return( true );
510 }
511 
512 
514 // //
516 
517 //---------------------------------------------------------
518 bool CSG_Grid_Cell_Addressor::_Set_Kernel(int Type, double Radius, double Radius_Inner, double Direction, double Tolerance)
519 {
520  Destroy();
521 
522  m_Type = Type;
523  m_Radius = Radius;
524  m_Radius_0 = Radius_Inner;
525  m_Direction = fmod(Direction, M_PI_360); if( Direction < 0. ) Direction += M_PI_360;
526  m_Tolerance = fmod(Tolerance, M_PI_180); if( Tolerance < 0. ) Tolerance += M_PI_180;
527 
528  if( m_Radius < 0. || m_Radius < m_Radius_0 )
529  {
530  return( false );
531  }
532 
533  CSG_Vector Sector(2);
534 
535  if( m_Type == 3 ) // sector
536  {
537  Sector[0] = fmod(Direction - Tolerance, M_PI_360); if( Sector[0] < 0. ) Sector[0] += M_PI_360;
538  Sector[1] = fmod(Direction + Tolerance, M_PI_360); if( Sector[1] < 0. ) Sector[1] += M_PI_360;
539  }
540 
541  //-----------------------------------------------------
542  #define ADD_CELL(x, y, Distance) {\
543  CSG_Table_Record &Cell = *Kernel.Add_Record();\
544  Cell.Set_Value(0, x);\
545  Cell.Set_Value(1, y);\
546  Cell.Set_Value(2, Distance);\
547  Cell.Set_Value(3, m_Weighting.Get_Weight(d));\
548  }
549 
550  CSG_Table Kernel(&m_Kernel);
551 
552  int Size = (int)ceil(m_Radius);
553 
554  //-----------------------------------------------------
555  for(int y=-Size; y<=Size; y++)
556  {
557  if( abs(y) > m_Radius )
558  continue;
559 
560  for(int x=-Size; x<=Size; x++)
561  {
562  if( abs(x) > m_Radius )
563  continue;
564 
565  double d = SG_Get_Length(x, y);
566 
567  switch( m_Type )
568  {
569  default: // square
570  ADD_CELL(x, y, d);
571  break;
572 
573  case 1: // circle
574  if( d <= m_Radius )
575  {
576  ADD_CELL(x, y, d);
577  }
578  break;
579 
580  case 2: // annulus
581  if( d <= m_Radius && d >= m_Radius_0 )
582  {
583  ADD_CELL(x, y, d);
584  }
585  break;
586 
587  case 3: // sector
588  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)) )
589  {
590  ADD_CELL(x, y, d);
591  }
592  break;
593  }
594  }
595  }
596 
597  //-----------------------------------------------------
598  if( Kernel.Get_Count() < 1 )
599  {
600  return( false );
601  }
602 
603  Kernel.Set_Index(2, TABLE_INDEX_Ascending);
604 
605  for(int i=0; i<Kernel.Get_Count(); i++)
606  {
607  m_Kernel.Add_Record(Kernel.Get_Record_byIndex(i));
608  }
609 
610  return( true );
611 }
612 
613 //---------------------------------------------------------
614 bool CSG_Grid_Cell_Addressor::Set_Radius(double Radius, bool bSquare)
615 {
616  return( bSquare ? Set_Square(Radius) : Set_Circle(Radius) );
617 }
618 
619 //---------------------------------------------------------
621 {
622  return( _Set_Kernel(0, Radius, 0., 0., 0.) );
623 }
624 
625 //---------------------------------------------------------
627 {
628  return( _Set_Kernel(1, Radius, 0., 0., 0.) );
629 }
630 
631 //---------------------------------------------------------
632 bool CSG_Grid_Cell_Addressor::Set_Annulus(double Radius_Inner, double Radius_Outer)
633 {
634  return( _Set_Kernel(2, Radius_Outer, Radius_Inner, 0., 0.) );
635 }
636 
637 //---------------------------------------------------------
638 bool CSG_Grid_Cell_Addressor::Set_Sector(double Radius, double Direction, double Tolerance)
639 {
640  return( _Set_Kernel(3, Radius, 0., Direction, Tolerance) );
641 }
642 
643 
645 // //
646 // //
647 // //
649 
650 //---------------------------------------------------------
M_DEG_TO_RAD
#define M_DEG_TO_RAD
Definition: mat_tools.h:109
CSG_Rect
Definition: geo_tools.h:471
CSG_Grid_System::operator!=
bool operator!=(const CSG_Grid_System &System) const
Definition: grid_system.cpp:313
CSG_Grid_System::operator=
CSG_Grid_System & operator=(const CSG_Grid_System &System)
Definition: grid_system.cpp:300
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: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: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:485
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_Cell_Addressor::Destroy
bool Destroy(void)
Definition: grid_system.cpp:357
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:496
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: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:324
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:375
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:446
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: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:102
SG_Get_Significant_Decimals
SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals(double Value, int maxDecimals=6)
Definition: api_string.cpp:1256
CSG_Grid_Cell_Addressor::Set_Radius
bool Set_Radius(double Radius, bool bSquare=false)
Definition: grid_system.cpp:614
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:348
CSG_Grid_Cell_Addressor::Set_Circle
bool Set_Circle(class CSG_Parameters &Parameters)
Definition: grid_system.cpp:486
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:1096
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:767
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_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:488
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:106
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: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:487
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:308
CSG_Grid::asInt
virtual int asInt(int x, int y, bool bScaled=true) const
Definition: grid.h:759
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