SAGA API  v9.2
geo_tools.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 // geo_tools.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 Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51 
52 //---------------------------------------------------------
53 #ifndef HEADER_INCLUDED__SAGA_API__geo_tools_H
54 #define HEADER_INCLUDED__SAGA_API__geo_tools_H
55 
56 
58 // //
59 // //
60 // //
62 
63 //---------------------------------------------------------
72 // //
74 // //
75 // //
77 
78 //---------------------------------------------------------
79 #include "api_core.h"
80 #include "metadata.h"
81 
82 
84 // //
85 // //
86 // //
88 
89 //---------------------------------------------------------
90 #define SG_IS_BETWEEN(a, x, b) (((a) <= (x) && (x) <= (b)) || ((b) <= (x) && (x) <= (a)))
91 
92 
94 // //
95 // //
96 // //
98 
99 //---------------------------------------------------------
100 typedef enum
101 {
107 }
109 
110 //---------------------------------------------------------
111 enum class TSG_Point_Type
112 {
113  SG_POINT_TYPE_2D = 0,
114  SG_POINT_TYPE_3D,
115  SG_POINT_TYPE_4D,
117 };
118 
119 
121 // //
122 // //
123 // //
125 
126 //---------------------------------------------------------
127 typedef struct SSG_Point
128 {
129  double x, y;
130 }
132 
133 //---------------------------------------------------------
135 {
136 public:
137  CSG_Point(void);
138  CSG_Point(const CSG_Point &Point);
139  CSG_Point(const TSG_Point &Point);
140  CSG_Point(double x, double y);
141 
142  virtual ~CSG_Point(void) {}
143 
144  virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_2D ); }
145 
146  virtual bool operator == (const CSG_Point &Point) const { return( is_Equal(Point) ); }
147  virtual bool operator != (const CSG_Point &Point) const { return( !is_Equal(Point) ); }
148 
149  virtual CSG_Point operator + (const CSG_Point &Point) const { return( CSG_Point(x + Point.x, y + Point.y) ); }
150  virtual CSG_Point operator - (const CSG_Point &Point) const { return( CSG_Point(x - Point.x, y - Point.y) ); }
151 
152  virtual CSG_Point & operator = (const CSG_Point &Point) { Assign (Point); return( *this ); }
153  virtual CSG_Point & operator += (const CSG_Point &Point) { Add (Point); return( *this ); }
154  virtual CSG_Point & operator -= (const CSG_Point &Point) { Subtract(Point); return( *this ); }
155  virtual CSG_Point & operator *= (const CSG_Point &Point) { Multiply(Point); return( *this ); }
156 
157  CSG_Point operator * (double Value) const { return( CSG_Point(x * Value, y * Value) ); }
158  CSG_Point operator / (double Value) const { return( CSG_Point(x / Value, y / Value) ); }
159  virtual CSG_Point & operator *= (double Value) { Multiply(Value); return( *this ); }
160  virtual CSG_Point & operator /= (double Value) { Divide (Value); return( *this ); }
161 
162  virtual void Assign (double x, double y);
163  virtual void Assign (const CSG_Point &Point);
164 
165  virtual void Add (const CSG_Point &Point);
166  virtual void Subtract (const CSG_Point &Point);
167  virtual void Multiply (const CSG_Point &Point);
168 
169  virtual void Multiply (double Value);
170  virtual void Divide (double Value);
171 
172  virtual double Get_Length (void) const;
173 
174  virtual bool is_Equal (const CSG_Point &Point, double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, epsilon) ); }
175  virtual bool is_Equal (double _x, double _y, double epsilon = 0.) const
176  {
177  return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon );
178  }
179 
180 };
181 
182 //---------------------------------------------------------
184 {
185 public:
186  CSG_Points(void);
187  CSG_Points(const CSG_Points &Points);
188  CSG_Points(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
189 
190  bool Clear (void) { return( m_Points.Destroy() ); }
191 
192  CSG_Points & operator = (const CSG_Points &Points) { Assign(Points); return( *this ); }
193  bool Assign (const CSG_Points &Points);
194 
195  bool Add (double x, double y);
196  bool Add (const TSG_Point &Point) { return( Add(Point.x, Point.y) ); }
197  bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
198 
199  bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
200  sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
201 
202  TSG_Point * Get_Points (void) const { return( (TSG_Point *)m_Points.Get_Array() ); }
203 
204  TSG_Point & operator [] (sLong Index) { return( Get_Points()[Index] ); }
205  const TSG_Point & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
206 
207 
208 private:
209 
210  CSG_Array m_Points;
211 
212 };
213 
214 //---------------------------------------------------------
216 {
217 public:
218  CSG_Lines(void);
219  virtual ~CSG_Lines(void);
220 
221  CSG_Lines (const CSG_Lines &Lines);
222  bool Create (const CSG_Lines &Lines);
223 
224  CSG_Lines (sLong nLines);
225  bool Create (sLong nLines);
226 
227  bool Destroy (void);
228  bool Clear (void);
229 
230  CSG_Lines & operator = (const CSG_Lines &Lines) { Assign(Lines); return( *this ); }
231  bool Assign (const CSG_Lines &Lines);
232 
233  CSG_Points & Add (void);
234  bool Add (const CSG_Points &Line);
235  bool Add (const CSG_Lines &Lines);
236  bool Del (sLong Index);
237 
238  bool Set_Count (sLong nLines);
239  sLong Get_Count (void) const { return( m_Lines.Get_Size() ); }
240 
241  CSG_Points & Get_Line (sLong Index) { return( *((CSG_Points *)m_Lines[Index]) ); }
242  const CSG_Points & Get_Line (sLong Index) const { return( *((CSG_Points *)m_Lines[Index]) ); }
243 
244  CSG_Points & operator [] (sLong Index) { return( Get_Line(Index) ); }
245  const CSG_Points & operator [] (sLong Index) const { return( Get_Line(Index) ); }
246 
247  double Get_Length (void) const;
248  double Get_Length (sLong Index) const;
249 
250 
251 private:
252 
253  CSG_Array_Pointer m_Lines;
254 
255 };
256 
257 
259 // //
261 
262 //---------------------------------------------------------
263 typedef struct SSG_Point_3D
264 {
265  double x, y, z;
266 }
268 
269 //---------------------------------------------------------
271 {
272 public:
273  CSG_Point_3D(void);
274  CSG_Point_3D(const CSG_Point_3D &Point);
275  CSG_Point_3D(const TSG_Point_3D &Point);
276  CSG_Point_3D(double x, double y, double z);
277 
278  virtual ~CSG_Point_3D(void) {}
279 
280  virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_3D ); }
281 
282  virtual bool operator == (const CSG_Point_3D &Point) const { return( is_Equal(Point) ); }
283  virtual bool operator != (const CSG_Point_3D &Point) const { return( !is_Equal(Point) ); }
284 
285  virtual CSG_Point_3D operator + (const CSG_Point_3D &Point) const { return( CSG_Point_3D(x + Point.x, y + Point.y, z + Point.z) ); }
286  virtual CSG_Point_3D operator - (const CSG_Point_3D &Point) const { return( CSG_Point_3D(x - Point.x, y - Point.y, z - Point.z) ); }
287 
288  virtual CSG_Point_3D & operator = (const CSG_Point_3D &Point) { Assign (Point); return( *this ); }
289  virtual CSG_Point_3D & operator += (const CSG_Point_3D &Point) { Add (Point); return( *this ); }
290  virtual CSG_Point_3D & operator -= (const CSG_Point_3D &Point) { Subtract(Point); return( *this ); }
291  virtual CSG_Point_3D & operator *= (const CSG_Point_3D &Point) { Multiply(Point); return( *this ); }
292 
293  CSG_Point_3D operator * (double Value) const { return( CSG_Point_3D(x * Value, y * Value, z * Value) ); }
294  CSG_Point_3D operator / (double Value) const { return( CSG_Point_3D(x / Value, y / Value, z / Value) ); }
295  virtual CSG_Point_3D & operator *= (double Value) { Multiply(Value); return( *this ); }
296  virtual CSG_Point_3D & operator /= (double Value) { Divide (Value); return( *this ); }
297 
298  virtual void Assign (double x, double y, double z);
299  virtual void Assign (const CSG_Point_3D &Point);
300 
301  virtual void Add (const CSG_Point_3D &Point);
302  virtual void Subtract (const CSG_Point_3D &Point);
303  virtual void Multiply (const CSG_Point_3D &Point);
304 
305  virtual void Multiply (double Value);
306  virtual void Divide (double Value);
307 
308  virtual double Get_Length (void) const;
309 
310  virtual bool is_Equal (const CSG_Point_3D &Point , double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, Point.y, epsilon) ); }
311  virtual bool is_Equal (double _x, double _y, double _z, double epsilon = 0.) const
312  {
313  return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon && fabs(z - _z) <= epsilon );
314  }
315 
316 };
317 
318 //---------------------------------------------------------
320 {
321 public:
322  CSG_Points_3D(void);
323  CSG_Points_3D(const CSG_Points_3D &Points);
324  CSG_Points_3D(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
325 
326  bool Clear (void) { return( m_Points.Destroy() ); }
327 
328  CSG_Points_3D & operator = (const CSG_Points_3D &Points) { Assign(Points); return( *this ); }
329  bool Assign (const CSG_Points_3D &Points);
330 
331  bool Add (double x, double y, double z);
332  bool Add (const TSG_Point_3D &Point) { return( Add(Point.x, Point.y, Point.z) ); }
333  bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
334 
335  bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
336  sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
337 
338  TSG_Point_3D * Get_Points (void) const { return( (TSG_Point_3D *)m_Points.Get_Array() ); }
339 
340  TSG_Point_3D & operator [] (sLong Index) { return( Get_Points()[Index] ); }
341  const TSG_Point_3D & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
342 
343 
344 private:
345 
346  CSG_Array m_Points;
347 
348 };
349 
350 
352 // //
354 
355 //---------------------------------------------------------
356 typedef struct SSG_Point_4D
357 {
358  double x, y, z, m;
359 }
361 
362 //---------------------------------------------------------
364 {
365 public:
366  CSG_Point_4D(void);
367  CSG_Point_4D(const CSG_Point_4D &Point);
368  CSG_Point_4D(const TSG_Point_4D &Point);
369  CSG_Point_4D(double x, double y, double z, double m);
370 
371  virtual ~CSG_Point_4D(void) {}
372 
373  virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_4D ); }
374 
375  virtual bool operator == (const CSG_Point_4D &Point) const { return( is_Equal(Point) ); }
376  virtual bool operator != (const CSG_Point_4D &Point) const { return( !is_Equal(Point) ); }
377 
378  virtual CSG_Point_4D operator + (const CSG_Point_4D &Point) const { return( CSG_Point_4D(x + Point.x, y + Point.y, z + Point.z, m + Point.m) ); }
379  virtual CSG_Point_4D operator - (const CSG_Point_4D &Point) const { return( CSG_Point_4D(x - Point.x, y - Point.y, z - Point.z, m - Point.m) ); }
380 
381  CSG_Point_4D operator * (double Value) const { return( CSG_Point_4D(x * Value, y * Value, z * Value, m * Value) ); }
382  CSG_Point_4D operator / (double Value) const { return( CSG_Point_4D(x / Value, y / Value, z / Value, m * Value) ); }
383  virtual CSG_Point_4D & operator *= (double Value) { Multiply(Value); return( *this ); }
384  virtual CSG_Point_4D & operator /= (double Value) { Divide (Value); return( *this ); }
385 
386  virtual CSG_Point_4D & operator = (const CSG_Point_4D &Point) { Assign (Point); return( *this ); }
387  virtual CSG_Point_4D & operator += (const CSG_Point_4D &Point) { Add (Point); return( *this ); }
388  virtual CSG_Point_4D & operator -= (const CSG_Point_4D &Point) { Subtract(Point); return( *this ); }
389  virtual CSG_Point_4D & operator *= (const CSG_Point_4D &Point) { Multiply(Point); return( *this ); }
390 
391  virtual void Assign (double x, double y, double z, double m);
392  virtual void Assign (const CSG_Point_4D &Point);
393 
394  virtual void Add (const CSG_Point_4D &Point);
395  virtual void Subtract (const CSG_Point_4D &Point);
396  virtual void Multiply (const CSG_Point_4D &Point);
397 
398  virtual void Multiply (double Value);
399  virtual void Divide (double Value);
400 
401  virtual double Get_Length (void) const;
402 
403  virtual bool is_Equal (const CSG_Point_4D &Point , double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, Point.y, Point.m, epsilon) ); }
404  virtual bool is_Equal (double _x, double _y, double _z, double _m, double epsilon = 0.) const
405  {
406  return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon && fabs(z - _z) <= epsilon && fabs(m - _m) <= epsilon );
407  }
408 
409 };
410 
411 
413 // //
415 
416 //---------------------------------------------------------
417 typedef struct SSG_Point_Int
418 {
419  int x, y;
420 }
422 
423 //---------------------------------------------------------
425 {
426 public:
427  CSG_Points_Int(void);
428  CSG_Points_Int(const CSG_Points_Int &Points);
429  CSG_Points_Int(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
430 
431  bool Clear (void) { return( m_Points.Destroy() ); }
432 
433  CSG_Points_Int & operator = (const CSG_Points_Int &Points) { Assign(Points); return( *this ); }
434  bool Assign (const CSG_Points_Int &Points);
435 
436  bool Add (int x, int y);
437  bool Add (const TSG_Point_Int &Point) { return( Add(Point.x, Point.y) ); }
438  bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
439 
440  bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
441  sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
442 
443  TSG_Point_Int * Get_Points (void) const { return( (TSG_Point_Int *)m_Points.Get_Array() ); }
444 
445  TSG_Point_Int & operator [] (sLong Index) { return( Get_Points()[Index] ); }
446  const TSG_Point_Int & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
447 
448 
449 private:
450 
451  CSG_Array m_Points;
452 
453 };
454 
455 
457 // //
458 // //
459 // //
461 
462 //---------------------------------------------------------
463 typedef struct SSG_Rect
464 {
465  double xMin, yMin, xMax, yMax;
466 }
468 
469 //---------------------------------------------------------
471 {
472 public:
473  CSG_Rect(void);
474  CSG_Rect(const CSG_Rect &Rect);
475  CSG_Rect(const TSG_Rect &Rect);
476  CSG_Rect(const CSG_Point &A, const CSG_Point &B);
477  CSG_Rect(double xMin, double yMin, double xMax, double yMax);
478 
479  ~CSG_Rect(void);
480 
481  bool operator == (const CSG_Rect &Rect) const;
482  bool operator != (const CSG_Rect &Rect) const;
483 
484  CSG_Rect & operator = (const CSG_Rect &Rect);
485  void operator += (const CSG_Point &Point);
486  void operator -= (const CSG_Point &Point);
487 
488  void Assign (double xMin, double yMin, double xMax, double yMax);
489  void Assign (const CSG_Point &A, const CSG_Point &B);
490  void Assign (const CSG_Rect &Rect);
491 
492  void Set_BottomLeft (double x, double y);
493  void Set_BottomLeft (const CSG_Point &Point);
494  void Set_TopRight (double x, double y);
495  void Set_TopRight (const CSG_Point &Point);
496 
497  bool is_Equal (double xMin, double yMin, double xMax, double yMax, double epsilon = 0.) const;
498  bool is_Equal (const CSG_Rect &Rect , double epsilon = 0.) const;
499 
500  double Get_XMin (void) const { return( xMin ); }
501  double Get_XMax (void) const { return( xMax ); }
502  double Get_YMin (void) const { return( yMin ); }
503  double Get_YMax (void) const { return( yMax ); }
504 
505  double Get_XRange (void) const { return( xMax - xMin ); }
506  double Get_YRange (void) const { return( yMax - yMin ); }
507 
508  double Get_Area (void) const { return( Get_XRange() * Get_YRange() ); }
509  double Get_Diameter (void) const { return( sqrt(Get_XRange()*Get_XRange() + Get_YRange()*Get_YRange()) ); }
510 
511  CSG_Point Get_TopLeft (void) const { return( CSG_Point(xMin, yMax) ); }
512  CSG_Point Get_BottomRight (void) const { return( CSG_Point(xMax, yMin) ); }
513 
514  CSG_Point Get_Center (void) const { return( CSG_Point(Get_XCenter(), Get_YCenter()) ); }
515  double Get_XCenter (void) const { return( (xMin + xMax) / 2. ); }
516  double Get_YCenter (void) const { return( (yMin + yMax) / 2. ); }
517 
518  void Move (double dx, double dy);
519  void Move (const CSG_Point &Point);
520 
521  void Inflate (double d, bool bPercent = true);
522  void Deflate (double d, bool bPercent = true);
523  void Inflate (double dx, double dy, bool bPercent = true);
524  void Deflate (double dx, double dy, bool bPercent = true);
525 
526  void Union (double x, double y);
527  void Union (const CSG_Point &Point);
528  void Union (const CSG_Rect &Rect);
529  bool Intersect (const CSG_Rect &Rect);
530 
531  TSG_Intersection Intersects (const CSG_Rect &Rect) const;
532 
533  bool Contains (double x, double y) const;
534  bool Contains (const CSG_Point &Point) const;
535 
536 };
537 
538 //---------------------------------------------------------
540 {
541 public:
542  CSG_Rects(void);
543  CSG_Rects(const CSG_Rects &Rects);
544  virtual ~CSG_Rects(void);
545 
546  void Clear (void);
547 
548  CSG_Rects & operator = (const CSG_Rects &Rects);
549  bool Assign (const CSG_Rects &Rects);
550 
551  bool Add (void);
552  bool Add (double xMin, double yMin, double xMax, double yMax);
553  bool Add (const CSG_Rect &Rect);
554 
555  int Get_Count (void) const { return( m_nRects ); }
556 
557  CSG_Rect & operator [] (int Index) { return( *m_Rects[Index] ); }
558  CSG_Rect & Get_Rect (int Index) { return( *m_Rects[Index] ); }
559 
560 
561 private:
562 
563  int m_nRects;
564 
565  CSG_Rect **m_Rects;
566 
567 };
568 
569 
571 // //
573 
574 //---------------------------------------------------------
575 typedef struct SSG_Rect_Int
576 {
577  int xMin, yMin, xMax, yMax;
578 }
580 
581 //---------------------------------------------------------
583 {
584 public:
585  CSG_Rect_Int(void);
586  CSG_Rect_Int(const CSG_Rect_Int &Rect);
587  CSG_Rect_Int(const TSG_Rect_Int &Rect);
588  CSG_Rect_Int(const TSG_Point_Int &A, const TSG_Point_Int &B);
589  CSG_Rect_Int(int xMin, int yMin, int xMax, int yMax);
590 
591  ~CSG_Rect_Int(void);
592 
593  bool operator == (const CSG_Rect_Int &Rect) const;
594  bool operator != (const CSG_Rect_Int &Rect) const;
595 
596  CSG_Rect_Int & operator = (const CSG_Rect_Int &Rect);
597  void operator += (const TSG_Point_Int &Point);
598  void operator -= (const TSG_Point_Int &Point);
599 
600  void Assign (int xMin, int yMin, int xMax, int yMax);
601  void Assign (const TSG_Point_Int &A, const TSG_Point_Int &B);
602  void Assign (const CSG_Rect_Int &Rect);
603 
604  void Set_BottomLeft (int x, int y);
605  void Set_BottomLeft (const TSG_Point_Int &Point);
606  void Set_TopRight (int x, int y);
607  void Set_TopRight (const TSG_Point_Int &Point);
608 
609  bool is_Equal (int xMin, int yMin, int xMax, int yMax) const;
610  bool is_Equal (const CSG_Rect_Int &Rect ) const;
611 
612  int Get_XMin (void) const { return( xMin ); }
613  int Get_XMax (void) const { return( xMax ); }
614  int Get_YMin (void) const { return( yMin ); }
615  int Get_YMax (void) const { return( yMax ); }
616 
617  int Get_XRange (void) const { return( xMax - xMin ); }
618  int Get_YRange (void) const { return( yMax - yMin ); }
619 
620  double Get_Area (void) const { return( ((double)Get_XRange() * (double)Get_YRange()) ); }
621  double Get_Diameter (void) const { double x = (double)xMax - xMin, y = (double)yMax - yMin; return( sqrt(x*x + y*y) ); }
622 
623  TSG_Point_Int Get_TopLeft (void) const { TSG_Point_Int p; p.x = xMin; p.y = yMax; return( p ); }
624  TSG_Point_Int Get_BottomRight (void) const { TSG_Point_Int p; p.x = xMax; p.y = yMin; return( p ); }
625 
626  void Move (int dx, int dy);
627  void Move (const TSG_Point_Int &Point);
628 
629  void Inflate (int d);
630  void Deflate (int d);
631  void Inflate (int dx, int dy);
632  void Deflate (int dx, int dy);
633 
634  void Union (int x, int y);
635  void Union (const TSG_Point_Int &Point);
636  void Union (const CSG_Rect_Int &Rect);
637  bool Intersect (const CSG_Rect_Int &Rect);
638 
639  TSG_Intersection Intersects (const CSG_Rect_Int &Rect) const;
640 
641  bool Contains (double x, double y) const;
642  bool Contains (const TSG_Point_Int &Point) const;
643 
644 };
645 
646 //---------------------------------------------------------
648 {
649 public:
650  CSG_Rects_Int(void);
651  virtual ~CSG_Rects_Int(void);
652 
653  void Clear (void);
654 
655  CSG_Rects_Int & operator = (const CSG_Rects_Int &Rects);
656  bool Assign (const CSG_Rects_Int &Rects);
657 
658  bool Add (void);
659  bool Add (int xMin, int yMin, int xMax, int yMax);
660  bool Add (const CSG_Rect_Int &Rect);
661 
662  int Get_Count (void) const { return( m_nRects ); }
663 
664  CSG_Rect_Int & operator [] (int Index) { return( *m_Rects[Index] ); }
665  CSG_Rect_Int & Get_Rect (int Index) { return( *m_Rects[Index] ); }
666 
667 
668 private:
669 
670  int m_nRects;
671 
672  CSG_Rect_Int **m_Rects;
673 
674 };
675 
676 
678 // //
679 // //
680 // //
682 
683 //---------------------------------------------------------
684 typedef enum
685 {
690 }
692 
693 
695 // //
697 
698 //---------------------------------------------------------
700 {
701 public:
703  virtual ~CSG_Distance_Weighting(void);
704 
705  static bool Enable_Parameters (class CSG_Parameters &Parameters);
706  bool Create_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", bool bIDW_Offset = false);
707  static bool Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", bool bIDW_Offset = false);
708  bool Set_Parameters (class CSG_Parameters &Parameters);
709 
710  TSG_Distance_Weighting Get_Weighting (void) const { return( m_Weighting ); }
711  bool Set_Weighting (TSG_Distance_Weighting Weighting);
712 
713  double Get_IDW_Power (void) const { return( m_IDW_Power ); }
714  bool Set_IDW_Power (double Value);
715 
716  bool Get_IDW_Offset (void) const { return( m_IDW_bOffset ); }
717  bool Set_IDW_Offset (bool bOn = true);
718 
719  double Get_BandWidth (void) const { return( m_Bandwidth ); }
720  bool Set_BandWidth (double Value);
721 
722  //-----------------------------------------------------
723  double Get_Weight (double Distance) const
724  {
725  if( Distance < 0. )
726  {
727  return( 0. );
728  }
729 
730  switch( m_Weighting )
731  {
732  case SG_DISTWGHT_IDW :
733  return( m_IDW_bOffset
734  ? pow(1. + Distance, -m_IDW_Power) : Distance > 0.
735  ? pow( Distance, -m_IDW_Power) : 0.
736  );
737 
738  case SG_DISTWGHT_EXP :
739  return( exp(-Distance / m_Bandwidth) );
740 
741  case SG_DISTWGHT_GAUSS:
742  Distance /= m_Bandwidth;
743  return( exp(-0.5 * Distance*Distance) );
744 
745  default: // case SG_DISTWGHT_None:
746  return( 1. );
747  }
748  }
749 
750 
751 private:
752 
753  bool m_IDW_bOffset;
754 
755  double m_IDW_Power, m_Bandwidth;
756 
757  TSG_Distance_Weighting m_Weighting;
758 
759 };
760 
761 
763 // //
764 // //
765 // //
767 
768 //---------------------------------------------------------
769 typedef enum
770 {
775 }
777 
778 //---------------------------------------------------------
779 typedef enum
780 {
785 }
787 
788 //---------------------------------------------------------
789 typedef enum
790 {
813 }
815 
816 //---------------------------------------------------------
820 
825 
826 
828 // //
830 
831 //---------------------------------------------------------
833 {
834  friend class CSG_Projections;
835 
836 public:
837  CSG_Projection(void);
838  virtual ~CSG_Projection(void);
839 
840  void Destroy (void);
841 
842  CSG_Projection (const CSG_Projection &Projection);
843  bool Create (const CSG_Projection &Projection);
844  bool Assign (const CSG_Projection &Projection);
845  CSG_Projection & operator = (const CSG_Projection &Projection) { Assign(Projection); return( *this ); }
846 
847  CSG_Projection (int Authority_ID, const SG_Char *Authority = NULL);
848  bool Create (int Authority_ID, const SG_Char *Authority = NULL);
849  bool Assign (int Authority_ID, const SG_Char *Authority = NULL);
850  CSG_Projection & operator = (int Authority_ID) { Assign(Authority_ID); return( *this ); }
851 
852  CSG_Projection (const CSG_String &Projection, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
853  bool Create (const CSG_String &Projection, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
854  bool Assign (const CSG_String &Projection, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
855  CSG_Projection & operator = (const CSG_String &Projection) { Assign(Projection); return( *this ); }
856 
857  CSG_Projection (const CSG_String &WKT, const CSG_String &Proj4);
858  bool Create (const CSG_String &WKT, const CSG_String &Proj4);
859  bool Assign (const CSG_String &WKT, const CSG_String &Proj4);
860 
861  bool is_Okay (void) const { return( m_Type != SG_PROJ_TYPE_CS_Undefined ); }
862  bool is_Equal (const CSG_Projection &Projection) const;
863  bool operator == (const CSG_Projection &Projection) const { return( is_Equal(Projection) == true ); }
864  bool operator != (const CSG_Projection &Projection) const { return( is_Equal(Projection) == false ); }
865 
866  bool Set_GCS_WGS84 (void);
867  bool Set_UTM_WGS84 (int Zone, bool bSouth = false);
868 
869  bool Load (const CSG_String &FileName, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
870  bool Save (const CSG_String &FileName, TSG_Projection_Format Format = SG_PROJ_FMT_WKT) const;
871 
872  bool Load (CSG_File &Stream, TSG_Projection_Format Format = SG_PROJ_FMT_WKT);
873  bool Save (CSG_File &Stream, TSG_Projection_Format Format = SG_PROJ_FMT_WKT) const;
874 
875  bool Load (const CSG_MetaData &Projection);
876  bool Save ( CSG_MetaData &Projection) const;
877 
878  const CSG_String & Get_Name (void) const { return( m_Name ); }
879  const CSG_String & Get_WKT (void) const { return( m_WKT ); }
880  const CSG_String & Get_Proj4 (void) const { return( m_Proj4 ); }
881  const CSG_String & Get_Authority (void) const { return( m_Authority ); }
882  int Get_Authority_ID (void) const { return( m_Authority_ID ); }
883  int Get_EPSG (void) const { return( m_Authority.Cmp("EPSG") ? -1 : m_Authority_ID ); }
884 
885  CSG_String Get_Description (void) const;
886 
887  TSG_Projection_Type Get_Type (void) const { return( m_Type ); }
889  CSG_String Get_Type_Name (void) const { return( SG_Get_Projection_Type_Name (m_Type) ); }
890 
891  bool is_Projection (void) const { return( m_Type == SG_PROJ_TYPE_CS_Projected ); }
892  bool is_Geographic (void) const { return( m_Type == SG_PROJ_TYPE_CS_Geographic ); }
893  bool is_Geocentric (void) const { return( m_Type == SG_PROJ_TYPE_CS_Geocentric ); }
894 
895 
896  TSG_Projection_Unit Get_Unit (void) const { return( m_Unit ); }
898  CSG_String Get_Unit_Name (void) const { return( m_Unit_Name ); }
899  double Get_Unit_To_Meter (void) const { return( m_Unit_To_Meter ); }
900 
901 
902 private:
903 
904  int m_Authority_ID;
905 
906  double m_Unit_To_Meter;
907 
908  TSG_Projection_Type m_Type;
909 
910  TSG_Projection_Unit m_Unit;
911 
912  CSG_String m_Name, m_WKT, m_Proj4, m_Authority, m_Unit_Name;
913 
914 
915 };
916 
917 
919 // //
921 
922 //---------------------------------------------------------
926 //---------------------------------------------------------
928 {
929  friend class CSG_Projection;
930 
931 public:
932  CSG_Projections(void);
933  virtual ~CSG_Projections(void);
934 
935  CSG_Projections (bool bLoad_DB);
936  bool Create (bool bLoad_DB = true);
937 
938  CSG_Projections (const CSG_String &File_DB);
939  bool Create (const CSG_String &File_DB);
940 
941  void Destroy (void);
942 
943  bool Reset_Dictionary (void);
944  bool Load_Dictionary (const CSG_String &FileName);
945  bool Save_Dictionary (const CSG_String &FileName);
946 
947  bool Load_DB (const CSG_String &FileName, bool bAppend = false);
948  bool Save_DB (const CSG_String &FileName);
949 
950  sLong Get_Count (void) const;
951 
952  bool Add (const CSG_Projection &Projection);
953  bool Add (const SG_Char *WKT, const SG_Char *Proj4, const SG_Char *Authority, int Authority_ID);
954 
955  CSG_Projection Get_Projection (sLong Index) const;
956  CSG_Projection operator [] (sLong Index) const { return( Get_Projection(Index) ); }
957 
958  bool Get_Projection (CSG_Projection &Projection, int EPSG_ID ) const;
959  bool Get_Projection (CSG_Projection &Projection, const CSG_String &Authority, int Authority_ID) const;
960 
961  CSG_String Get_Names_List (TSG_Projection_Type Type = SG_PROJ_TYPE_CS_Undefined) const;
962 
963  static CSG_MetaData WKT_to_MetaData (const CSG_String &WKT);
964 
965  bool WKT_to_Proj4 (CSG_String &Proj4, const CSG_String &WKT ) const;
966  bool WKT_from_Proj4 (CSG_String &WKT , const CSG_String &Proj4) const;
967 
968  bool EPSG_to_Proj4 (CSG_String &Proj4, int EPSG_Code) const;
969  bool EPSG_to_WKT (CSG_String &WKT , int EPSG_Code) const;
970 
971  static const CSG_Projection & Get_GCS_WGS84 (void);
972  static CSG_Projection Get_UTM_WGS84 (int Zone, bool bSouth = false);
973 
974 
975 private:
976 
977  CSG_Translator m_WKT_to_Proj4, m_Proj4_to_WKT, m_EPSG_to_Idx;
978 
979  class CSG_Table *m_pProjections;
980 
981 
982  void _On_Construction (void);
983 
984  static bool _WKT_to_MetaData (CSG_MetaData &MetaData, const CSG_String &WKT);
985 
986  bool _WKT_to_Proj4_Set_Datum (CSG_String &Proj4, const CSG_MetaData &WKT) const;
987 
988  static bool _Proj4_Find_Parameter ( const CSG_String &Proj4, const CSG_String &Key);
989  static bool _Proj4_Read_Parameter (CSG_String &Value, const CSG_String &Proj4, const CSG_String &Key);
990  static bool _Proj4_Get_Ellipsoid (CSG_String &Value, const CSG_String &Proj4);
991  static bool _Proj4_Get_Datum (CSG_String &Value, const CSG_String &Proj4);
992  static bool _Proj4_Get_Prime_Meridian (CSG_String &Value, const CSG_String &Proj4);
993  static bool _Proj4_Get_Unit (CSG_String &Value, const CSG_String &Proj4);
994 
995  bool _Set_Dictionary (CSG_Table &Dictionary, int Direction);
996  bool _Set_Dictionary (CSG_Translator &Dictionary, int Direction);
997 
998 };
999 
1000 //---------------------------------------------------------
1002 
1003 //---------------------------------------------------------
1004 SAGA_API_DLL_EXPORT bool SG_Get_Projected (class CSG_Shapes *pSource, class CSG_Shapes *pTarget, const CSG_Projection &Target);
1005 
1006 SAGA_API_DLL_EXPORT bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point );
1007 SAGA_API_DLL_EXPORT bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle);
1008 
1009 //---------------------------------------------------------
1011 
1012 
1014 // //
1015 // Functions //
1016 // //
1018 
1019 //---------------------------------------------------------
1020 SAGA_API_DLL_EXPORT bool SG_Is_Equal (double a, double b, double epsilon = 0.);
1021 SAGA_API_DLL_EXPORT bool SG_Is_Equal (const TSG_Point &A, const TSG_Point &B, double epsilon = 0.);
1022 
1023 SAGA_API_DLL_EXPORT bool SG_Is_Between (double x, double a, double b, double epsilon = 0.);
1024 SAGA_API_DLL_EXPORT bool SG_Is_Between (const TSG_Point &Point, const TSG_Point &Corner_A, const TSG_Point &Corner_B, double epsilon = 0.);
1025 
1026 //---------------------------------------------------------
1027 SAGA_API_DLL_EXPORT double SG_Get_Length (double dx, double dy);
1028 
1029 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double bx, double by, bool bPolar);
1030 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point &A, const TSG_Point &B , bool bPolar);
1031 
1032 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double bx, double by);
1033 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point &A, const TSG_Point &B);
1034 
1035 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double az, double bx, double by, double bz);
1037 
1038 SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar (double aLon, double aLat, double bLon, double bLat, double a = 6378137., double e = 298.257223563, bool bDegree = true);
1039 SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar (const TSG_Point &A , const TSG_Point &B , double a = 6378137., double e = 298.257223563, bool bDegree = true);
1040 
1041 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (double dx, double dy);
1042 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (double ax, double ay, double bx, double by);
1045 SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference (double a, double b);
1046 SAGA_API_DLL_EXPORT bool SG_is_Angle_Between (double Angle, double Angle_Min, double Angle_Max, bool bCheckRange = true);
1047 
1048 SAGA_API_DLL_EXPORT bool SG_Get_Crossing (TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch = true);
1049 SAGA_API_DLL_EXPORT bool SG_Get_Crossing_InRegion (TSG_Point &Crossing, const TSG_Point &a , const TSG_Point & b, const TSG_Rect &Region);
1050 
1051 SAGA_API_DLL_EXPORT bool SG_Is_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch = false, double Epsilon = 0.);
1052 SAGA_API_DLL_EXPORT double SG_Get_Distance_To_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch = true);
1053 SAGA_API_DLL_EXPORT double SG_Get_Nearest_Point_On_Line (const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch = true);
1054 
1055 SAGA_API_DLL_EXPORT bool SG_Get_Triangle_CircumCircle (TSG_Point Triangle[3], TSG_Point &Point, double &Radius);
1056 
1057 SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area (TSG_Point *Points, int nPoints);
1058 SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area (const CSG_Points &Points);
1059 
1060 
1062 // //
1063 // //
1064 // //
1066 
1067 //---------------------------------------------------------
1068 #endif // #ifndef HEADER_INCLUDED__SAGA_API__geo_tools_H
SG_Get_Distance_To_Line
SAGA_API_DLL_EXPORT double SG_Get_Distance_To_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch=true)
Definition: geo_functions.cpp:413
CSG_Rect
Definition: geo_tools.h:471
SG_PROJ_UNIT_Indian_Foot
@ SG_PROJ_UNIT_Indian_Foot
Definition: geo_tools.h:810
CSG_Point::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:144
SG_PROJ_UNIT_Int_Chain
@ SG_PROJ_UNIT_Int_Chain
Definition: geo_tools.h:802
SG_Get_Projection_Unit_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Identifier(TSG_Projection_Unit Unit)
Definition: projections.cpp:160
SG_PROJ_UNIT_US_Statute_Mile
@ SG_PROJ_UNIT_US_Statute_Mile
Definition: geo_tools.h:808
CSG_Points_3D::Add
bool Add(const TSG_Point_3D &Point)
Definition: geo_tools.h:332
CSG_Translator
Definition: api_core.h:1424
CSG_Point::~CSG_Point
virtual ~CSG_Point(void)
Definition: geo_tools.h:142
SG_Get_Projection_Type_Identifier
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Identifier(TSG_Projection_Type Type)
Definition: projections.cpp:87
CSG_Rect_Int::Get_XMin
int Get_XMin(void) const
Definition: geo_tools.h:612
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:320
SG_Get_Length
SAGA_API_DLL_EXPORT double SG_Get_Length(double dx, double dy)
Definition: geo_functions.cpp:97
SSG_Rect_Int::yMax
int yMax
Definition: geo_tools.h:577
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
CSG_Rects
Definition: geo_tools.h:540
CSG_Rect_Int::Get_YMin
int Get_YMin(void) const
Definition: geo_tools.h:614
TSG_Distance_Weighting
TSG_Distance_Weighting
Definition: geo_tools.h:685
TSG_Rect_Int
struct SSG_Rect_Int TSG_Rect_Int
CSG_Points_Int::Get_Points
TSG_Point_Int * Get_Points(void) const
Definition: geo_tools.h:443
SG_PROJ_TYPE_CS_Geographic
@ SG_PROJ_TYPE_CS_Geographic
Definition: geo_tools.h:782
SG_Get_Angle_Of_Direction
SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction(double dx, double dy)
Definition: geo_functions.cpp:216
SSG_Rect_Int::yMin
int yMin
Definition: geo_tools.h:577
CSG_Point_4D::is_Equal
virtual bool is_Equal(double _x, double _y, double _z, double _m, double epsilon=0.) const
Definition: geo_tools.h:404
CSG_Point_4D::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:373
SG_Get_Angle_Difference
SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference(double a, double b)
Definition: geo_functions.cpp:247
SG_PROJ_FMT_Undefined
@ SG_PROJ_FMT_Undefined
Definition: geo_tools.h:774
CSG_Point_4D::is_Equal
virtual bool is_Equal(const CSG_Point_4D &Point, double epsilon=0.) const
Definition: geo_tools.h:403
SG_PROJ_FMT_WKT
@ SG_PROJ_FMT_WKT
Definition: geo_tools.h:771
CSG_Rect_Int::Get_XMax
int Get_XMax(void) const
Definition: geo_tools.h:613
CSG_Points_Int::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:441
CSG_Projections::Create
bool Create(bool bLoad_DB=true)
Definition: projections.cpp:721
SG_DISTWGHT_EXP
@ SG_DISTWGHT_EXP
Definition: geo_tools.h:688
CSG_Points_Int::Clear
bool Clear(void)
Definition: geo_tools.h:431
A
#define A
SG_PROJ_UNIT_Int_Statute_Mile
@ SG_PROJ_UNIT_Int_Statute_Mile
Definition: geo_tools.h:800
CSG_Points_Int
Definition: geo_tools.h:425
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:501
CSG_Projection::Get_Unit_Name
CSG_String Get_Unit_Name(void) const
Definition: geo_tools.h:898
SG_Get_Crossing
SAGA_API_DLL_EXPORT bool SG_Get_Crossing(TSG_Point &Crossing, const TSG_Point &a1, const TSG_Point &a2, const TSG_Point &b1, const TSG_Point &b2, bool bExactMatch=true)
Definition: geo_functions.cpp:280
CSG_Rect::Get_TopLeft
CSG_Point Get_TopLeft(void) const
Definition: geo_tools.h:511
SG_Get_Crossing_InRegion
SAGA_API_DLL_EXPORT bool SG_Get_Crossing_InRegion(TSG_Point &Crossing, const TSG_Point &a, const TSG_Point &b, const TSG_Rect &Region)
Definition: geo_functions.cpp:342
SG_PROJ_UNIT_Int_Foot
@ SG_PROJ_UNIT_Int_Foot
Definition: geo_tools.h:798
SG_DISTWGHT_GAUSS
@ SG_DISTWGHT_GAUSS
Definition: geo_tools.h:689
CSG_Points_3D::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:335
TSG_Projection_Type
TSG_Projection_Type
Definition: geo_tools.h:780
CSG_Rects::Get_Count
int Get_Count(void) const
Definition: geo_tools.h:555
CSG_Projections::CSG_Projection
friend class CSG_Projection
Definition: geo_tools.h:929
SG_Get_Projection_Unit
SAGA_API_DLL_EXPORT TSG_Projection_Unit SG_Get_Projection_Unit(const CSG_String &Identifier)
Definition: projections.cpp:144
CSG_Rect_Int::Get_XRange
int Get_XRange(void) const
Definition: geo_tools.h:617
SSG_Point_4D
Definition: geo_tools.h:357
SG_PROJ_UNIT_US_Inch
@ SG_PROJ_UNIT_US_Inch
Definition: geo_tools.h:804
SSG_Point_3D
Definition: geo_tools.h:264
SG_Get_Distance
SAGA_API_DLL_EXPORT double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
Definition: geo_functions.cpp:103
SG_PROJ_UNIT_Int_Inch
@ SG_PROJ_UNIT_Int_Inch
Definition: geo_tools.h:797
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:861
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Points_3D::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:336
SSG_Rect_Int
Definition: geo_tools.h:576
CSG_Point_3D::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:280
SSG_Point_3D::x
double x
Definition: geo_tools.h:265
CSG_Projection::is_Geographic
bool is_Geographic(void) const
Definition: geo_tools.h:892
CSG_Point_3D::is_Equal
virtual bool is_Equal(double _x, double _y, double _z, double epsilon=0.) const
Definition: geo_tools.h:311
SG_Is_Between
SAGA_API_DLL_EXPORT bool SG_Is_Between(double x, double a, double b, double epsilon=0.)
Definition: geo_functions.cpp:77
SSG_Rect::xMax
double xMax
Definition: geo_tools.h:465
api_core.h
SG_PROJ_UNIT_Int_Link
@ SG_PROJ_UNIT_Int_Link
Definition: geo_tools.h:803
SG_PROJ_UNIT_Int_Yard
@ SG_PROJ_UNIT_Int_Yard
Definition: geo_tools.h:799
SG_PROJ_UNIT_US_Foot
@ SG_PROJ_UNIT_US_Foot
Definition: geo_tools.h:805
CSG_Rects::Get_Rect
CSG_Rect & Get_Rect(int Index)
Definition: geo_tools.h:558
CSG_Rect::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:508
CSG_Projection::Get_WKT
const CSG_String & Get_WKT(void) const
Definition: geo_tools.h:879
SG_PROJ_UNIT_Indian_Yard
@ SG_PROJ_UNIT_Indian_Yard
Definition: geo_tools.h:809
CSG_Projection::CSG_Projections
friend class CSG_Projections
Definition: geo_tools.h:834
SSG_Point
Definition: geo_tools.h:128
CSG_Distance_Weighting::Get_Weight
double Get_Weight(double Distance) const
Definition: geo_tools.h:723
CSG_Points_3D::Clear
bool Clear(void)
Definition: geo_tools.h:326
CSG_Projection::Get_EPSG
int Get_EPSG(void) const
Definition: geo_tools.h:883
CSG_Rect_Int::Get_TopLeft
TSG_Point_Int Get_TopLeft(void) const
Definition: geo_tools.h:623
CSG_Projection::Destroy
void Destroy(void)
Definition: projections.cpp:394
TSG_Point_3D
struct SSG_Point_3D TSG_Point_3D
CSG_Rect_Int::Get_Diameter
double Get_Diameter(void) const
Definition: geo_tools.h:621
CSG_Projection::Get_Unit
TSG_Projection_Unit Get_Unit(void) const
Definition: geo_tools.h:896
CSG_File
Definition: api_core.h:1116
CSG_Point_4D::~CSG_Point_4D
virtual ~CSG_Point_4D(void)
Definition: geo_tools.h:371
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:465
SSG_Rect
Definition: geo_tools.h:464
SG_Get_Polygon_Area
SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area(TSG_Point *Points, int nPoints)
Definition: geo_functions.cpp:514
CSG_Points::Add
bool Add(const TSG_Point &Point)
Definition: geo_tools.h:196
SG_Get_Projection_Unit_To_Meter
SAGA_API_DLL_EXPORT double SG_Get_Projection_Unit_To_Meter(TSG_Projection_Unit Unit)
Definition: projections.cpp:178
CSG_Projection::Get_Type
TSG_Projection_Type Get_Type(void) const
Definition: geo_tools.h:887
SG_Get_Triangle_CircumCircle
SAGA_API_DLL_EXPORT bool SG_Get_Triangle_CircumCircle(TSG_Point Triangle[3], TSG_Point &Point, double &Radius)
Definition: geo_functions.cpp:465
SG_PROJ_UNIT_Indian_Chain
@ SG_PROJ_UNIT_Indian_Chain
Definition: geo_tools.h:811
CSG_Rect_Int
Definition: geo_tools.h:583
SG_DISTWGHT_IDW
@ SG_DISTWGHT_IDW
Definition: geo_tools.h:687
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:505
SG_Get_Distance_Polar
SAGA_API_DLL_EXPORT double SG_Get_Distance_Polar(double aLon, double aLat, double bLon, double bLat, double a=6378137., double e=298.257223563, bool bDegree=true)
Definition: geo_functions.cpp:157
CSG_Point
Definition: geo_tools.h:135
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:502
CSG_Points_Int::Add
bool Add(const TSG_Point_Int &Point)
Definition: geo_tools.h:437
CSG_Rects_Int::Get_Count
int Get_Count(void) const
Definition: geo_tools.h:662
CSG_Projection::Get_Name
const CSG_String & Get_Name(void) const
Definition: geo_tools.h:878
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:200
SSG_Point_4D::m
double m
Definition: geo_tools.h:358
CSG_Projection::Get_Unit_Identifier
CSG_String Get_Unit_Identifier(void) const
Definition: geo_tools.h:897
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
SSG_Point_4D::z
double z
Definition: geo_tools.h:358
CSG_Point_3D
Definition: geo_tools.h:271
CSG_Point_4D
Definition: geo_tools.h:364
sLong
signed long long sLong
Definition: api_core.h:158
SG_PROJ_UNIT_Int_Nautical_Mile
@ SG_PROJ_UNIT_Int_Nautical_Mile
Definition: geo_tools.h:796
CSG_Rect_Int::Get_BottomRight
TSG_Point_Int Get_BottomRight(void) const
Definition: geo_tools.h:624
CSG_Projection::Get_Authority_ID
int Get_Authority_ID(void) const
Definition: geo_tools.h:882
CSG_Distance_Weighting
Definition: geo_tools.h:700
CSG_Projection::Get_Proj4
const CSG_String & Get_Proj4(void) const
Definition: geo_tools.h:880
TSG_Point_Int
struct SSG_Point_Int TSG_Point_Int
SG_PROJ_UNIT_US_Chain
@ SG_PROJ_UNIT_US_Chain
Definition: geo_tools.h:807
SSG_Rect_Int::xMax
int xMax
Definition: geo_tools.h:577
CSG_Points_3D::Get_Points
TSG_Point_3D * Get_Points(void) const
Definition: geo_tools.h:338
SG_PROJ_UNIT_Centimeter
@ SG_PROJ_UNIT_Centimeter
Definition: geo_tools.h:794
CSG_Lines::Get_Line
const CSG_Points & Get_Line(sLong Index) const
Definition: geo_tools.h:242
SSG_Rect_Int::xMin
int xMin
Definition: geo_tools.h:577
SAGA_API_DLL_EXPORT
#define SAGA_API_DLL_EXPORT
Definition: api_core.h:94
CSG_Distance_Weighting::Get_BandWidth
double Get_BandWidth(void) const
Definition: geo_tools.h:719
CSG_Lines::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:239
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
TSG_Projection_Unit
TSG_Projection_Unit
Definition: geo_tools.h:790
SG_Get_Projections
SAGA_API_DLL_EXPORT CSG_Projections & SG_Get_Projections(void)
Definition: projections.cpp:66
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:465
TSG_Point_4D
struct SSG_Point_4D TSG_Point_4D
SG_is_Angle_Between
SAGA_API_DLL_EXPORT bool SG_is_Angle_Between(double Angle, double Angle_Min, double Angle_Max, bool bCheckRange=true)
Definition: geo_functions.cpp:257
SG_PROJ_TYPE_CS_Projected
@ SG_PROJ_TYPE_CS_Projected
Definition: geo_tools.h:781
CSG_Point::is_Equal
virtual bool is_Equal(double _x, double _y, double epsilon=0.) const
Definition: geo_tools.h:175
CSG_Points
Definition: geo_tools.h:184
SG_PROJ_UNIT_US_Yard
@ SG_PROJ_UNIT_US_Yard
Definition: geo_tools.h:806
CSG_Rect::Get_BottomRight
CSG_Point Get_BottomRight(void) const
Definition: geo_tools.h:512
CSG_Projection
Definition: geo_tools.h:833
CSG_Table
Definition: table.h:283
CSG_Projection::Get_Type_Name
CSG_String Get_Type_Name(void) const
Definition: geo_tools.h:889
CSG_Rect::Get_Diameter
double Get_Diameter(void) const
Definition: geo_tools.h:509
SG_PROJ_FMT_EPSG
@ SG_PROJ_FMT_EPSG
Definition: geo_tools.h:773
SSG_Point_4D::y
double y
Definition: geo_tools.h:358
CSG_Rects_Int::Get_Rect
CSG_Rect_Int & Get_Rect(int Index)
Definition: geo_tools.h:665
CSG_Points_3D::Del
bool Del(sLong Index)
Definition: geo_tools.h:333
SG_Char
#define SG_Char
Definition: api_core.h:530
CSG_Array
Definition: api_core.h:308
B
#define B
CSG_Points_Int::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:440
SG_PROJ_UNIT_Kilometer
@ SG_PROJ_UNIT_Kilometer
Definition: geo_tools.h:791
CSG_String
Definition: api_core.h:557
SG_Get_Projection_Unit_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Unit_Name(TSG_Projection_Unit Unit, bool bSimple=false)
Definition: projections.cpp:169
CSG_Array_Pointer
Definition: api_core.h:368
SG_PROJ_UNIT_Undefined
@ SG_PROJ_UNIT_Undefined
Definition: geo_tools.h:812
CSG_Point_3D::~CSG_Point_3D
virtual ~CSG_Point_3D(void)
Definition: geo_tools.h:278
SSG_Point_Int
Definition: geo_tools.h:418
CSG_MetaData
Definition: metadata.h:88
CSG_Projection::Get_Type_Identifier
CSG_String Get_Type_Identifier(void) const
Definition: geo_tools.h:888
CSG_Distance_Weighting::Get_IDW_Power
double Get_IDW_Power(void) const
Definition: geo_tools.h:713
TSG_Rect
struct SSG_Rect TSG_Rect
CSG_Rect::Get_Center
CSG_Point Get_Center(void) const
Definition: geo_tools.h:514
CSG_Rect_Int::Get_YRange
int Get_YRange(void) const
Definition: geo_tools.h:618
SG_Get_Projection_Type_Name
SAGA_API_DLL_EXPORT CSG_String SG_Get_Projection_Type_Name(TSG_Projection_Type Type)
Definition: projections.cpp:99
SSG_Point_3D::y
double y
Definition: geo_tools.h:265
SG_Is_Point_On_Line
SAGA_API_DLL_EXPORT bool SG_Is_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, bool bExactMatch=false, double Epsilon=0.)
Definition: geo_functions.cpp:394
CSG_Points_Int::Del
bool Del(sLong Index)
Definition: geo_tools.h:438
metadata.h
TSG_Point_Type::SG_POINT_TYPE_2D
@ SG_POINT_TYPE_2D
SSG_Point::x
double x
Definition: geo_tools.h:129
SSG_Point_4D::x
double x
Definition: geo_tools.h:358
CSG_Projection::Get_Unit_To_Meter
double Get_Unit_To_Meter(void) const
Definition: geo_tools.h:899
CSG_Projection::is_Projection
bool is_Projection(void) const
Definition: geo_tools.h:891
SG_PROJ_UNIT_Int_Fathom
@ SG_PROJ_UNIT_Int_Fathom
Definition: geo_tools.h:801
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:465
SG_PROJ_TYPE_CS_Undefined
@ SG_PROJ_TYPE_CS_Undefined
Definition: geo_tools.h:784
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:515
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:503
CSG_Rect_Int::Get_YMax
int Get_YMax(void) const
Definition: geo_tools.h:615
SG_PROJ_UNIT_Millimeter
@ SG_PROJ_UNIT_Millimeter
Definition: geo_tools.h:795
TSG_Projection_Format
TSG_Projection_Format
Definition: geo_tools.h:770
CSG_Point_3D::is_Equal
virtual bool is_Equal(const CSG_Point_3D &Point, double epsilon=0.) const
Definition: geo_tools.h:310
CSG_Rects_Int
Definition: geo_tools.h:648
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:500
SSG_Point_Int::y
int y
Definition: geo_tools.h:419
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:473
SG_PROJ_UNIT_Meter
@ SG_PROJ_UNIT_Meter
Definition: geo_tools.h:792
SSG_Point_3D::z
double z
Definition: geo_tools.h:265
CSG_Projection::is_Geocentric
bool is_Geocentric(void) const
Definition: geo_tools.h:893
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:516
CSG_Lines::Get_Line
CSG_Points & Get_Line(sLong Index)
Definition: geo_tools.h:241
SG_PROJ_UNIT_Decimeter
@ SG_PROJ_UNIT_Decimeter
Definition: geo_tools.h:793
CSG_Shapes
Definition: shapes.h:773
SG_PROJ_TYPE_CS_Geocentric
@ SG_PROJ_TYPE_CS_Geocentric
Definition: geo_tools.h:783
CSG_Lines
Definition: geo_tools.h:216
TSG_Point
struct SSG_Point TSG_Point
CSG_Points::Get_Points
TSG_Point * Get_Points(void) const
Definition: geo_tools.h:202
CSG_Projections::Destroy
void Destroy(void)
Definition: projections.cpp:786
CSG_Points::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:199
CSG_Points::Clear
bool Clear(void)
Definition: geo_tools.h:190
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Parameters
Definition: parameters.h:1650
SG_Get_Nearest_Point_On_Line
SAGA_API_DLL_EXPORT double SG_Get_Nearest_Point_On_Line(const TSG_Point &Point, const TSG_Point &Line_A, const TSG_Point &Line_B, TSG_Point &Line_Point, bool bExactMatch=true)
Definition: geo_functions.cpp:421
operator*
CSG_Vector operator*(double Scalar, const CSG_Vector &Vector)
Definition: mat_matrix.cpp:579
CSG_Projection::Get_Authority
const CSG_String & Get_Authority(void) const
Definition: geo_tools.h:881
SG_Get_Projection_Type
SAGA_API_DLL_EXPORT TSG_Projection_Type SG_Get_Projection_Type(const CSG_String &Identifier)
Definition: projections.cpp:77
SG_Is_Equal
SAGA_API_DLL_EXPORT bool SG_Is_Equal(double a, double b, double epsilon=0.)
Definition: geo_functions.cpp:64
CSG_Projection::Create
bool Create(const CSG_Projection &Projection)
Definition: projections.cpp:252
SSG_Point_Int::x
int x
Definition: geo_tools.h:419
TSG_Point_Type
TSG_Point_Type
Definition: geo_tools.h:112
CSG_Point::is_Equal
virtual bool is_Equal(const CSG_Point &Point, double epsilon=0.) const
Definition: geo_tools.h:174
SG_DISTWGHT_None
@ SG_DISTWGHT_None
Definition: geo_tools.h:686
SG_Get_Projected
SAGA_API_DLL_EXPORT bool SG_Get_Projected(class CSG_Shapes *pSource, class CSG_Shapes *pTarget, const CSG_Projection &Target)
Definition: projections.cpp:2191
INTERSECTION_Overlaps
@ INTERSECTION_Overlaps
Definition: geo_tools.h:104
CSG_Distance_Weighting::Get_Weighting
TSG_Distance_Weighting Get_Weighting(void) const
Definition: geo_tools.h:710
CSG_Rect_Int::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:620
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:506
CSG_Points::Del
bool Del(sLong Index)
Definition: geo_tools.h:197
CSG_Projections
Definition: geo_tools.h:928
SG_PROJ_FMT_Proj4
@ SG_PROJ_FMT_Proj4
Definition: geo_tools.h:772
SG_Grid_Get_Geographic_Coordinates
SAGA_API_DLL_EXPORT bool SG_Grid_Get_Geographic_Coordinates(CSG_Grid *pGrid, CSG_Grid *pLon, CSG_Grid *pLat)
Definition: projections.cpp:2307
CSG_Distance_Weighting::Get_IDW_Offset
bool Get_IDW_Offset(void) const
Definition: geo_tools.h:716
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:297
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473