SAGA API  v9.7
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  virtual double Get_Distance (const CSG_Point &Point) const { CSG_Point d(*this - Point); return( d.Get_Length() ); }
174 
175  virtual bool is_Equal (const CSG_Point &Point, double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, epsilon) ); }
176  virtual bool is_Equal (double _x, double _y, double epsilon = 0.) const
177  {
178  return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon );
179  }
180 
181 };
182 
183 //---------------------------------------------------------
185 {
186 public:
187  CSG_Points(void);
188  CSG_Points(const CSG_Points &Points);
189  CSG_Points(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
190 
191  bool Clear (void) { return( m_Points.Destroy() ); }
192 
193  CSG_Points & operator = (const CSG_Points &Points) { Assign(Points); return( *this ); }
194  bool Assign (const CSG_Points &Points);
195 
196  bool Add (double x, double y);
197  bool Add (const TSG_Point &Point) { return( Add(Point.x, Point.y) ); }
198  bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
199 
200  bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
201  sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
202 
203  TSG_Point * Get_Points (void) const { return( (TSG_Point *)m_Points.Get_Array() ); }
204 
205  TSG_Point & operator [] (sLong Index) { return( Get_Points()[Index] ); }
206  const TSG_Point & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
207 
208 
209 private:
210 
211  CSG_Array m_Points;
212 
213 };
214 
215 //---------------------------------------------------------
217 {
218 public:
219  CSG_Lines(void);
220  virtual ~CSG_Lines(void);
221 
222  CSG_Lines (const CSG_Lines &Lines);
223  bool Create (const CSG_Lines &Lines);
224 
225  CSG_Lines (sLong nLines);
226  bool Create (sLong nLines);
227 
228  bool Destroy (void);
229  bool Clear (void);
230 
231  CSG_Lines & operator = (const CSG_Lines &Lines) { Assign(Lines); return( *this ); }
232  bool Assign (const CSG_Lines &Lines);
233 
234  CSG_Points & Add (void);
235  bool Add (const CSG_Points &Line);
236  bool Add (const CSG_Lines &Lines);
237  bool Del (sLong Index);
238 
239  bool Set_Count (sLong nLines);
240  sLong Get_Count (void) const { return( m_Lines.Get_Size() ); }
241 
242  CSG_Points & Get_Line (sLong Index) { return( *((CSG_Points *)m_Lines[Index]) ); }
243  const CSG_Points & Get_Line (sLong Index) const { return( *((CSG_Points *)m_Lines[Index]) ); }
244 
245  CSG_Points & operator [] (sLong Index) { return( Get_Line(Index) ); }
246  const CSG_Points & operator [] (sLong Index) const { return( Get_Line(Index) ); }
247 
248  double Get_Length (void) const;
249  double Get_Length (sLong Index) const;
250 
251 
252 private:
253 
254  CSG_Array_Pointer m_Lines;
255 
256 };
257 
258 
260 // //
262 
263 //---------------------------------------------------------
264 typedef struct SSG_Point_3D
265 {
266  double x, y, z;
267 }
269 
270 //---------------------------------------------------------
272 {
273 public:
274  CSG_Point_3D(void);
275  CSG_Point_3D(const CSG_Point_3D &Point);
276  CSG_Point_3D(const TSG_Point_3D &Point);
277  CSG_Point_3D(double x, double y, double z);
278 
279  virtual ~CSG_Point_3D(void) {}
280 
281  virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_3D ); }
282 
283  virtual bool operator == (const CSG_Point_3D &Point) const { return( is_Equal(Point) ); }
284  virtual bool operator != (const CSG_Point_3D &Point) const { return( !is_Equal(Point) ); }
285 
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  virtual CSG_Point_3D operator - (const CSG_Point_3D &Point) const { return( CSG_Point_3D(x - Point.x, y - Point.y, z - Point.z) ); }
288 
289  virtual CSG_Point_3D & operator = (const CSG_Point_3D &Point) { Assign (Point); return( *this ); }
290  virtual CSG_Point_3D & operator += (const CSG_Point_3D &Point) { Add (Point); return( *this ); }
291  virtual CSG_Point_3D & operator -= (const CSG_Point_3D &Point) { Subtract(Point); return( *this ); }
292  virtual CSG_Point_3D & operator *= (const CSG_Point_3D &Point) { Multiply(Point); return( *this ); }
293 
294  CSG_Point_3D operator * (double Value) const { return( CSG_Point_3D(x * Value, y * Value, z * Value) ); }
295  CSG_Point_3D operator / (double Value) const { return( CSG_Point_3D(x / Value, y / Value, z / Value) ); }
296  virtual CSG_Point_3D & operator *= (double Value) { Multiply(Value); return( *this ); }
297  virtual CSG_Point_3D & operator /= (double Value) { Divide (Value); return( *this ); }
298 
299  virtual void Assign (double x, double y, double z);
300  virtual void Assign (const CSG_Point_3D &Point);
301 
302  virtual void Add (const CSG_Point_3D &Point);
303  virtual void Subtract (const CSG_Point_3D &Point);
304  virtual void Multiply (const CSG_Point_3D &Point);
305 
306  virtual void Multiply (double Value);
307  virtual void Divide (double Value);
308 
309  virtual double Get_Length (void) const;
310  virtual double Get_Distance (const CSG_Point_3D &Point) const { CSG_Point_3D d(*this - Point); return( d.Get_Length() ); }
311 
312  virtual bool is_Equal (const CSG_Point_3D &Point , double epsilon = 0.) const { return( is_Equal(Point.x, Point.y, Point.y, epsilon) ); }
313  virtual bool is_Equal (double _x, double _y, double _z, double epsilon = 0.) const
314  {
315  return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon && fabs(z - _z) <= epsilon );
316  }
317 
318 };
319 
320 //---------------------------------------------------------
322 {
323 public:
324  CSG_Points_3D(void);
325  CSG_Points_3D(const CSG_Points_3D &Points);
326  CSG_Points_3D(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
327 
328  bool Clear (void) { return( m_Points.Destroy() ); }
329 
330  CSG_Points_3D & operator = (const CSG_Points_3D &Points) { Assign(Points); return( *this ); }
331  bool Assign (const CSG_Points_3D &Points);
332 
333  bool Add (double x, double y, double z);
334  bool Add (const TSG_Point_3D &Point) { return( Add(Point.x, Point.y, Point.z) ); }
335  bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
336 
337  bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
338  sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
339 
340  TSG_Point_3D * Get_Points (void) const { return( (TSG_Point_3D *)m_Points.Get_Array() ); }
341 
342  TSG_Point_3D & operator [] (sLong Index) { return( Get_Points()[Index] ); }
343  const TSG_Point_3D & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
344 
345 
346 private:
347 
348  CSG_Array m_Points;
349 
350 };
351 
352 
354 // //
356 
357 //---------------------------------------------------------
358 typedef struct SSG_Point_4D
359 {
360  double x, y, z, m;
361 }
363 
364 //---------------------------------------------------------
366 {
367 public:
368  CSG_Point_4D(void);
369  CSG_Point_4D(const CSG_Point_4D &Point);
370  CSG_Point_4D(const TSG_Point_4D &Point);
371  CSG_Point_4D(double x, double y, double z, double m);
372 
373  virtual ~CSG_Point_4D(void) {}
374 
375  virtual TSG_Point_Type Get_Type (void) const { return( TSG_Point_Type::SG_POINT_TYPE_4D ); }
376 
377  virtual bool operator == (const CSG_Point_4D &Point) const { return( is_Equal(Point) ); }
378  virtual bool operator != (const CSG_Point_4D &Point) const { return( !is_Equal(Point) ); }
379 
380  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) ); }
381  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) ); }
382 
383  CSG_Point_4D operator * (double Value) const { return( CSG_Point_4D(x * Value, y * Value, z * Value, m * Value) ); }
384  CSG_Point_4D operator / (double Value) const { return( CSG_Point_4D(x / Value, y / Value, z / Value, m * Value) ); }
385  virtual CSG_Point_4D & operator *= (double Value) { Multiply(Value); return( *this ); }
386  virtual CSG_Point_4D & operator /= (double Value) { Divide (Value); return( *this ); }
387 
388  virtual CSG_Point_4D & operator = (const CSG_Point_4D &Point) { Assign (Point); return( *this ); }
389  virtual CSG_Point_4D & operator += (const CSG_Point_4D &Point) { Add (Point); return( *this ); }
390  virtual CSG_Point_4D & operator -= (const CSG_Point_4D &Point) { Subtract(Point); return( *this ); }
391  virtual CSG_Point_4D & operator *= (const CSG_Point_4D &Point) { Multiply(Point); return( *this ); }
392 
393  virtual void Assign (double x, double y, double z, double m);
394  virtual void Assign (const CSG_Point_4D &Point);
395 
396  virtual void Add (const CSG_Point_4D &Point);
397  virtual void Subtract (const CSG_Point_4D &Point);
398  virtual void Multiply (const CSG_Point_4D &Point);
399 
400  virtual void Multiply (double Value);
401  virtual void Divide (double Value);
402 
403  virtual double Get_Length (void) const;
404  virtual double Get_Distance (const CSG_Point_4D &Point) const { CSG_Point_4D d(*this - Point); return( d.Get_Length() ); }
405 
406  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) ); }
407  virtual bool is_Equal (double _x, double _y, double _z, double _m, double epsilon = 0.) const
408  {
409  return( fabs(x - _x) <= epsilon && fabs(y - _y) <= epsilon && fabs(z - _z) <= epsilon && fabs(m - _m) <= epsilon );
410  }
411 
412 };
413 
414 
416 // //
418 
419 //---------------------------------------------------------
420 typedef struct SSG_Point_Int
421 {
422  int x, y;
423 }
425 
426 //---------------------------------------------------------
428 {
429 public:
430  CSG_Points_Int(void);
431  CSG_Points_Int(const CSG_Points_Int &Points);
432  CSG_Points_Int(sLong nPoints, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_1);
433 
434  bool Clear (void) { return( m_Points.Destroy() ); }
435 
436  CSG_Points_Int & operator = (const CSG_Points_Int &Points) { Assign(Points); return( *this ); }
437  bool Assign (const CSG_Points_Int &Points);
438 
439  bool Add (int x, int y);
440  bool Add (const TSG_Point_Int &Point) { return( Add(Point.x, Point.y) ); }
441  bool Del (sLong Index) { return( m_Points.Del_Entry(Index) ); }
442 
443  bool Set_Count (sLong nPoints) { return( m_Points.Set_Array(nPoints) ); }
444  sLong Get_Count (void) const { return( m_Points.Get_Size() ); }
445 
446  TSG_Point_Int * Get_Points (void) const { return( (TSG_Point_Int *)m_Points.Get_Array() ); }
447 
448  TSG_Point_Int & operator [] (sLong Index) { return( Get_Points()[Index] ); }
449  const TSG_Point_Int & operator [] (sLong Index) const { return( Get_Points()[Index] ); }
450 
451 
452 private:
453 
454  CSG_Array m_Points;
455 
456 };
457 
458 
460 // //
461 // //
462 // //
464 
465 //---------------------------------------------------------
466 typedef struct SSG_Rect
467 {
468  double xMin, yMin, xMax, yMax;
469 }
471 
472 //---------------------------------------------------------
474 {
475 public:
476  CSG_Rect(void);
477  CSG_Rect(const CSG_Rect &Rect);
478  CSG_Rect(const TSG_Rect &Rect);
479  CSG_Rect(const CSG_Point &A, const CSG_Point &B);
480  CSG_Rect(double xMin, double yMin, double xMax, double yMax);
481 
482  ~CSG_Rect(void);
483 
484  bool Create (double xMin, double yMin, double xMax, double yMax);
485  bool Create (const CSG_Point &A, const CSG_Point &B);
486  bool Create (const CSG_Rect &Rect);
487 
488  bool operator == (const CSG_Rect &Rect) const { return( is_Equal(Rect) ); }
489  bool operator != (const CSG_Rect &Rect) const { return( !is_Equal(Rect) ); }
490 
491  CSG_Rect & operator = (const CSG_Rect &Rect) { Assign(Rect); return( *this ); }
492 
493  CSG_Rect & operator += (const CSG_Point &Point) { Move( Point.x, Point.y); return( *this ); }
494  CSG_Rect & operator -= (const CSG_Point &Point) { Move( -Point.x, -Point.y); return( *this ); }
495 
496  CSG_Rect & Assign (double xMin, double yMin, double xMax, double yMax);
497  CSG_Rect & Assign (const CSG_Point &A, const CSG_Point &B);
498  CSG_Rect & Assign (const CSG_Rect &Rect);
499 
500  CSG_Rect & Set_BottomLeft (double x, double y);
501  CSG_Rect & Set_BottomLeft (const CSG_Point &Point);
502  CSG_Rect & Set_TopRight (double x, double y);
503  CSG_Rect & Set_TopRight (const CSG_Point &Point);
504 
505  double Get_XMin (void) const { return( xMin ); }
506  double Get_XMax (void) const { return( xMax ); }
507  double Get_YMin (void) const { return( yMin ); }
508  double Get_YMax (void) const { return( yMax ); }
509 
510  double Get_XRange (void) const { return( xMax - xMin ); }
511  double Get_YRange (void) const { return( yMax - yMin ); }
512 
513  double Get_Area (void) const { return( Get_XRange() * Get_YRange() ); }
514  double Get_Diameter (void) const { return( sqrt(Get_XRange()*Get_XRange() + Get_YRange()*Get_YRange()) ); }
515 
516  CSG_Point Get_TopLeft (void) const { return( CSG_Point(xMin, yMax) ); }
517  CSG_Point Get_BottomRight (void) const { return( CSG_Point(xMax, yMin) ); }
518 
519  CSG_Point Get_Center (void) const { return( CSG_Point(Get_XCenter(), Get_YCenter()) ); }
520  double Get_XCenter (void) const { return( (xMin + xMax) / 2. ); }
521  double Get_YCenter (void) const { return( (yMin + yMax) / 2. ); }
522 
523  CSG_Rect & Move (double dx, double dy);
524  CSG_Rect & Move (const CSG_Point &Point);
525 
526  CSG_Rect & Inflate (double d, bool bPercent = true);
527  CSG_Rect & Deflate (double d, bool bPercent = true);
528  CSG_Rect & Inflate (double dx, double dy, bool bPercent = true);
529  CSG_Rect & Deflate (double dx, double dy, bool bPercent = true);
530 
531  CSG_Rect & Union (double x, double y);
532  CSG_Rect & Union (const CSG_Point &Point);
533  CSG_Rect & Union (const CSG_Rect &Rect);
534  bool Intersect (const CSG_Rect &Rect);
535 
536  bool is_Equal (double xMin, double yMin, double xMax, double yMax, double epsilon = 0.) const;
537  bool is_Equal (const CSG_Rect &Rect , double epsilon = 0.) const;
538 
539  bool Contains (double x, double y) const;
540  bool Contains (const CSG_Point &Point) const;
541 
542  TSG_Intersection Intersects (const CSG_Rect &Rect) const;
543 
544 };
545 
546 //---------------------------------------------------------
548 {
549 public:
550  CSG_Rects(void);
551  CSG_Rects(const CSG_Rects &Rects);
552  virtual ~CSG_Rects(void);
553 
554  void Clear (void);
555 
556  CSG_Rects & operator = (const CSG_Rects &Rects);
557  bool Assign (const CSG_Rects &Rects);
558 
559  bool Add (void);
560  bool Add (double xMin, double yMin, double xMax, double yMax);
561  bool Add (const CSG_Rect &Rect);
562 
563  int Get_Count (void) const { return( m_nRects ); }
564 
565  CSG_Rect & operator [] (int Index) { return( *m_Rects[Index] ); }
566  CSG_Rect & Get_Rect (int Index) { return( *m_Rects[Index] ); }
567 
568 
569 private:
570 
571  int m_nRects;
572 
573  CSG_Rect **m_Rects;
574 
575 };
576 
577 
579 // //
581 
582 //---------------------------------------------------------
583 typedef struct SSG_Rect_Int
584 {
585  int xMin, yMin, xMax, yMax;
586 }
588 
589 //---------------------------------------------------------
591 {
592 public:
593  CSG_Rect_Int(void);
594  CSG_Rect_Int(const CSG_Rect_Int &Rect);
595  CSG_Rect_Int(const TSG_Rect_Int &Rect);
596  CSG_Rect_Int(const TSG_Point_Int &A, const TSG_Point_Int &B);
597  CSG_Rect_Int(int xMin, int yMin, int xMax, int yMax);
598 
599  ~CSG_Rect_Int(void);
600 
601  bool Create (int xMin, int yMin, int xMax, int yMax);
602  bool Create (const TSG_Point_Int &A, const TSG_Point_Int &B);
603  bool Create (const CSG_Rect_Int &Rect);
604 
605  bool operator == (const CSG_Rect_Int &Rect) const { return( is_Equal(Rect) ); }
606  bool operator != (const CSG_Rect_Int &Rect) const { return( !is_Equal(Rect) ); }
607 
608  CSG_Rect_Int & operator = (const CSG_Rect_Int &Rect) { Assign(Rect); return( *this ); }
609 
610  CSG_Rect_Int & operator += (const TSG_Point_Int &Point) { Move( Point.x, Point.y); return( *this ); }
611  CSG_Rect_Int & operator -= (const TSG_Point_Int &Point) { Move(-Point.x, -Point.y); return( *this ); }
612 
613  CSG_Rect_Int & Assign (int xMin, int yMin, int xMax, int yMax);
614  CSG_Rect_Int & Assign (const TSG_Point_Int &A, const TSG_Point_Int &B);
615  CSG_Rect_Int & Assign (const CSG_Rect_Int &Rect);
616 
617  CSG_Rect_Int & Set_BottomLeft (int x, int y);
618  CSG_Rect_Int & Set_BottomLeft (const TSG_Point_Int &Point);
619  CSG_Rect_Int & Set_TopRight (int x, int y);
620  CSG_Rect_Int & Set_TopRight (const TSG_Point_Int &Point);
621 
622  int Get_XMin (void) const { return( xMin ); }
623  int Get_XMax (void) const { return( xMax ); }
624  int Get_YMin (void) const { return( yMin ); }
625  int Get_YMax (void) const { return( yMax ); }
626 
627  int Get_XRange (void) const { return( xMax - xMin ); }
628  int Get_YRange (void) const { return( yMax - yMin ); }
629 
630  double Get_Area (void) const { return( ((double)Get_XRange() * (double)Get_YRange()) ); }
631  double Get_Diameter (void) const { double x = (double)xMax - xMin, y = (double)yMax - yMin; return( sqrt(x*x + y*y) ); }
632 
633  TSG_Point_Int Get_TopLeft (void) const { TSG_Point_Int p; p.x = xMin; p.y = yMax; return( p ); }
634  TSG_Point_Int Get_BottomRight (void) const { TSG_Point_Int p; p.x = xMax; p.y = yMin; return( p ); }
635 
636  CSG_Rect_Int & Move (int dx, int dy);
637  CSG_Rect_Int & Move (const TSG_Point_Int &Point);
638 
639  CSG_Rect_Int & Inflate (int d);
640  CSG_Rect_Int & Deflate (int d);
641  CSG_Rect_Int & Inflate (int dx, int dy);
642  CSG_Rect_Int & Deflate (int dx, int dy);
643 
644  CSG_Rect_Int & Union (int x, int y);
645  CSG_Rect_Int & Union (const TSG_Point_Int &Point);
646  CSG_Rect_Int & Union (const CSG_Rect_Int &Rect);
647  bool Intersect (const CSG_Rect_Int &Rect);
648 
649  bool is_Equal (int xMin, int yMin, int xMax, int yMax) const;
650  bool is_Equal (const CSG_Rect_Int &Rect ) const;
651 
652  bool Contains (double x, double y) const;
653  bool Contains (const TSG_Point_Int &Point) const;
654 
655  TSG_Intersection Intersects (const CSG_Rect_Int &Rect) const;
656 
657 };
658 
659 //---------------------------------------------------------
661 {
662 public:
663  CSG_Rects_Int(void);
664  virtual ~CSG_Rects_Int(void);
665 
666  void Clear (void);
667 
668  CSG_Rects_Int & operator = (const CSG_Rects_Int &Rects);
669  bool Assign (const CSG_Rects_Int &Rects);
670 
671  bool Add (void);
672  bool Add (int xMin, int yMin, int xMax, int yMax);
673  bool Add (const CSG_Rect_Int &Rect);
674 
675  int Get_Count (void) const { return( m_nRects ); }
676 
677  CSG_Rect_Int & operator [] (int Index) { return( *m_Rects[Index] ); }
678  CSG_Rect_Int & Get_Rect (int Index) { return( *m_Rects[Index] ); }
679 
680 
681 private:
682 
683  int m_nRects;
684 
685  CSG_Rect_Int **m_Rects;
686 
687 };
688 
689 
691 // //
692 // //
693 // //
695 
696 //---------------------------------------------------------
697 typedef enum
698 {
703 }
705 
706 
708 // //
710 
711 //---------------------------------------------------------
713 {
714 public:
716  virtual ~CSG_Distance_Weighting(void);
717 
718  static bool Enable_Parameters (class CSG_Parameters &Parameters);
719  bool Create_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", bool bIDW_Offset = false);
720  static bool Add_Parameters (class CSG_Parameters &Parameters, const CSG_String &Parent = "", bool bIDW_Offset = false);
721  bool Set_Parameters (class CSG_Parameters &Parameters);
722 
723  TSG_Distance_Weighting Get_Weighting (void) const { return( m_Weighting ); }
724  bool Set_Weighting (TSG_Distance_Weighting Weighting);
725 
726  double Get_IDW_Power (void) const { return( m_IDW_Power ); }
727  bool Set_IDW_Power (double Value);
728 
729  bool Get_IDW_Offset (void) const { return( m_IDW_bOffset ); }
730  bool Set_IDW_Offset (bool bOn = true);
731 
732  double Get_BandWidth (void) const { return( m_Bandwidth ); }
733  bool Set_BandWidth (double Value);
734 
735  //-----------------------------------------------------
736  double Get_Weight (double Distance) const
737  {
738  if( Distance < 0. )
739  {
740  return( 0. );
741  }
742 
743  switch( m_Weighting )
744  {
745  case SG_DISTWGHT_IDW :
746  return( m_IDW_bOffset
747  ? pow(1. + Distance, -m_IDW_Power) : Distance > 0.
748  ? pow( Distance, -m_IDW_Power) : 0.
749  );
750 
751  case SG_DISTWGHT_EXP :
752  return( exp(-Distance / m_Bandwidth) );
753 
754  case SG_DISTWGHT_GAUSS:
755  Distance /= m_Bandwidth;
756  return( exp(-0.5 * Distance*Distance) );
757 
758  default: // case SG_DISTWGHT_None:
759  return( 1. );
760  }
761  }
762 
763 
764 private:
765 
766  bool m_IDW_bOffset;
767 
768  double m_IDW_Power, m_Bandwidth;
769 
770  TSG_Distance_Weighting m_Weighting;
771 
772 };
773 
774 
776 // //
777 // //
778 // //
780 
781 //---------------------------------------------------------
782 enum class ESG_CRS_Format
783 {
784  WKT1, WKT2, PROJ, JSON, ESRI, CODE, Undefined, WKT = WKT1
785 };
786 
787 //---------------------------------------------------------
788 enum class ESG_CRS_Type
789 {
790  Geographic, Geodetic, Geocentric, Projection, Undefined
791 };
792 
793 //---------------------------------------------------------
795 {
796  Kilometer,
797  Meter,
798  Decimeter,
799  Centimeter,
800  Millimeter,
801  Int_Nautical_Mile,
802  Int_Inch,
803  Int_Foot,
804  Int_Yard,
805  Int_Statute_Mile,
806  Int_Fathom,
807  Int_Chain,
808  Int_Link,
809  US_Inch,
810  US_Foot,
811  US_Yard,
812  US_Chain,
813  US_Statute_Mile,
814  Indian_Yard,
815  Indian_Foot,
816  Indian_Chain,
817  Undefined, First = Kilometer
818 };
819 
820 
822 // //
824 
825 //---------------------------------------------------------
827 {
828  friend class CSG_Projections;
829 
830 public:
831  CSG_Projection(void);
832  virtual ~CSG_Projection(void);
833 
834  void Destroy (void);
835 
836  CSG_Projection (const CSG_Projection &Projection);
837  bool Create (const CSG_Projection &Projection);
838  CSG_Projection & operator = (const CSG_Projection &Projection) { Create(Projection); return( *this ); }
839 
840  CSG_Projection (const char *Definition);
841  bool Create (const char *Definition);
842  CSG_Projection & operator = (const char *Definition) { Create(Definition); return( *this ); }
843 
844  CSG_Projection (const wchar_t *Definition);
845  bool Create (const wchar_t *Definition);
846  CSG_Projection & operator = (const wchar_t *Definition) { Create(Definition); return( *this ); }
847 
848  CSG_Projection (const CSG_String &Definition);
849  bool Create (const CSG_String &Definition);
850  CSG_Projection & operator = (const CSG_String &Definition) { Create(Definition); return( *this ); }
851 
852  CSG_Projection (int Code, const SG_Char *Authority = NULL);
853  bool Create (int Code, const SG_Char *Authority = NULL);
854  CSG_Projection & operator = (int Code) { Create(Code ); return( *this ); }
855 
856  CSG_Projection (const CSG_String &WKT2, const CSG_String &PROJ);
857  bool Create (const CSG_String &WKT2, const CSG_String &PROJ);
858 
859  bool Assign (const CSG_Projection &Projection) { return( Create(Projection ) ); }
860  bool Assign (const CSG_String &Definition) { return( Create(Definition ) ); }
861  bool Assign (int Code, const SG_Char *Authority = NULL) { return( Create(Code, Authority ) ); }
862 
863  bool is_Okay (void) const { return( m_Type != ESG_CRS_Type::Undefined ); }
864  bool is_Equal (const CSG_Projection &Projection) const;
865  bool operator == (const CSG_Projection &Projection) const { return( is_Equal(Projection) == true ); }
866  bool operator != (const CSG_Projection &Projection) const { return( is_Equal(Projection) == false ); }
867 
868  static const CSG_Projection & Get_GCS_WGS84 (void);
869  bool Set_GCS_WGS84 (void);
870 
871  static CSG_Projection Get_UTM_WGS84 (int Zone, bool bSouth = false);
872  bool Set_UTM_WGS84 (int Zone, bool bSouth = false);
873 
874  bool Load (const CSG_String &File);
875  bool Save (const CSG_String &File, ESG_CRS_Format Format = ESG_CRS_Format::WKT) const;
876 
877  bool Load (CSG_File &Stream);
878  bool Save (CSG_File &Stream , ESG_CRS_Format Format = ESG_CRS_Format::WKT) const;
879 
880  bool Load (const CSG_MetaData &Projection);
881  bool Save ( CSG_MetaData &Projection) const;
882 
883  CSG_String Get_Description (bool bDetails = false) const;
884 
885  const CSG_String & Get_Name (void) const { return( m_Name ); }
886 
887  const CSG_String & Get_WKT (void) const { return( m_WKT2 ); }
888  CSG_String Get_WKT1 (void) const;
889  const CSG_String & Get_WKT2 (void) const { return( m_WKT2 ); }
890  const CSG_String & Get_PROJ (void) const { return( m_PROJ ); }
891  CSG_String Get_JSON (void) const;
892  CSG_String Get_ESRI (void) const;
893  CSG_String Get_XML (void) const;
894  const CSG_String & Get_Authority (void) const { return( m_Authority ); }
895  int Get_Code (void) const { return( m_Code ); }
896 
897  const CSG_String & Get_Proj4 (void) const { return( m_PROJ ); }
898  int Get_Authority_ID (void) const { return( m_Code ); }
899  int Get_EPSG (void) const { return( m_Authority.CmpNoCase("EPSG") ? -1 : m_Code ); }
900 
901  bool is_Geographic (void) const { return( m_Type == ESG_CRS_Type::Geographic ); }
902  bool is_Geodetic (void) const { return( m_Type == ESG_CRS_Type::Geodetic ); }
903  bool is_Geocentric (void) const { return( m_Type == ESG_CRS_Type::Geocentric ); }
904  bool is_Projection (void) const { return( m_Type == ESG_CRS_Type::Projection ); }
905 
906  ESG_CRS_Type Get_Type (void) const { return( m_Type ); }
907  CSG_String Get_Type_Identifier (void) const;
908  CSG_String Get_Type_Name (void) const;
909 
910  ESG_Projection_Unit Get_Unit (void) const { return( m_Unit ); }
911  CSG_String Get_Unit_Identifier (void) const;
912  CSG_String Get_Unit_Name (void) const;
913  double Get_Unit_To_Meter (void) const;
914 
915 
916 private:
917 
918  int m_Code;
919 
920  ESG_CRS_Type m_Type;
921 
922  ESG_Projection_Unit m_Unit;
923 
924  CSG_String m_Name, m_Authority, m_PROJ, m_WKT2;
925 
926 };
927 
928 
930 // //
932 
933 //---------------------------------------------------------
937 //---------------------------------------------------------
939 {
940  friend class CSG_Projection;
941 
942 public:
943  CSG_Projections(void);
944  virtual ~CSG_Projections(void);
945 
946  CSG_Projections (bool LoadCodeList);
947  bool Create (bool LoadCodeList = true);
948 
949  void Destroy (void);
950 
951  static bool Parse (const CSG_String &Definition, CSG_String *PROJ = NULL, CSG_String *WKT2 = NULL, CSG_String *WKT1 = NULL, CSG_String *JSON = NULL, CSG_String *ESRI = NULL);
952  static CSG_String Parse (const CSG_String &Definition, ESG_CRS_Format Format);
953 
954  bool Load (const CSG_String &File, bool bAppend = false);
955  bool Save (const CSG_String &File);
956 
957  bool Add (const CSG_Projection &Projection);
958  bool Add (const SG_Char *WKT, const SG_Char *Proj4, const SG_Char *Authority, int Authority_ID);
959 
960  sLong Get_Count (void) const;
961 
962  CSG_Projection operator [] (sLong Index) const { return( Get_Projection(Index) ); }
963  CSG_Projection Get_Projection (sLong Index) const;
964  const SG_Char * Get_Projection ( int Code, const SG_Char *Authority = NULL) const;
965  bool Get_Projection (CSG_Projection &Projection, int Code, const SG_Char *Authority = NULL) const;
966 
967  bool Get_Preference (CSG_Projection &Projection, int Code, const CSG_String &Authority ) const;
968  bool Get_Preference (CSG_Projection &Projection , const CSG_String &Authority_Code ) const;
969 
970  CSG_String Get_Names_List (ESG_CRS_Type Type = ESG_CRS_Type::Undefined, bool bAddSelect = true) const;
971 
972  static ESG_CRS_Type Get_CRS_Type (const CSG_String &Identifier);
973  static CSG_String Get_CRS_Type_Identifier (ESG_CRS_Type Type);
974  static CSG_String Get_CRS_Type_Name (ESG_CRS_Type Type);
975 
976  static ESG_Projection_Unit Get_Unit (const CSG_String &Identifier);
978  static const CSG_String Get_Unit_Name (ESG_Projection_Unit Unit, bool bSimple = true);
979  static double Get_Unit_To_Meter (ESG_Projection_Unit Unit);
980 
981  static CSG_String Convert_WKT2_to_XML (const CSG_String &WKT);
982 
983 
984 private:
985 
986  class CSG_Table *m_pProjections, *m_pPreferences;
987 
988 
989  void _On_Construction (void);
990 
991 
992 private:
993 
994  CSG_Translator m_WKT1_to_Proj4, m_Proj4_to_WKT1, m_EPSG_to_Idx;
995 
996  bool _Load (class CSG_Table *pTable, const CSG_String &File, bool bAppend = false) const;
997 
998  static CSG_Projection _Get_Projection (class CSG_Table_Record *pProjection);
999 
1000  bool _Add_Preferences (void);
1001 
1002  static CSG_MetaData _WKT2_to_MetaData (const CSG_String &WKT, bool bTrim);
1003  static bool _WKT2_to_MetaData (CSG_MetaData &MetaData, const CSG_String &WKT);
1004 
1005  static CSG_MetaData _WKT1_to_MetaData (const CSG_String &WKT);
1006  static bool _WKT1_to_MetaData (CSG_MetaData &MetaData, const CSG_String &WKT);
1007 
1008  bool _WKT1_to_Proj4 (CSG_String &Proj4, const CSG_String &WKT ) const;
1009  bool _WKT1_from_Proj4 (CSG_String &WKT , const CSG_String &Proj4) const;
1010  bool _WKT1_to_Proj4_Set_Datum (CSG_String &Proj4, const CSG_MetaData &WKT) const;
1011 
1012  static bool _Proj4_Find_Parameter ( const CSG_String &Proj4, const CSG_String &Key);
1013  static bool _Proj4_Read_Parameter (CSG_String &Value, const CSG_String &Proj4, const CSG_String &Key);
1014  static bool _Proj4_Get_Ellipsoid (CSG_String &Value, const CSG_String &Proj4);
1015  static bool _Proj4_Get_Datum (CSG_String &Value, const CSG_String &Proj4);
1016  static bool _Proj4_Get_Prime_Meridian (CSG_String &Value, const CSG_String &Proj4);
1017  static bool _Proj4_Get_Unit (CSG_String &Value, const CSG_String &Proj4);
1018 
1019  bool _Set_Dictionary (void);
1020  bool _Set_Dictionary (CSG_Table &Dictionary, int Direction);
1021 
1022 };
1023 
1024 //---------------------------------------------------------
1026 
1027 //---------------------------------------------------------
1028 SAGA_API_DLL_EXPORT bool SG_Get_Projected (class CSG_Shapes *pSource, class CSG_Shapes *pTarget, const CSG_Projection &Target);
1029 
1030 SAGA_API_DLL_EXPORT bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Point &Point );
1031 SAGA_API_DLL_EXPORT bool SG_Get_Projected (const CSG_Projection &Source, const CSG_Projection &Target, TSG_Rect &Rectangle);
1032 
1033 //---------------------------------------------------------
1035 
1036 
1038 // //
1039 // Functions //
1040 // //
1042 
1043 //---------------------------------------------------------
1044 SAGA_API_DLL_EXPORT bool SG_Is_Equal (double a, double b, double epsilon = 0.);
1045 SAGA_API_DLL_EXPORT bool SG_Is_Equal (const TSG_Point &A, const TSG_Point &B, double epsilon = 0.);
1046 
1047 SAGA_API_DLL_EXPORT bool SG_Is_Between (double x, double a, double b, double epsilon = 0.);
1048 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.);
1049 
1050 //---------------------------------------------------------
1051 SAGA_API_DLL_EXPORT double SG_Get_Length (double dx, double dy);
1052 
1053 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double bx, double by, bool bPolar);
1054 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point &A, const TSG_Point &B , bool bPolar);
1055 
1056 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double bx, double by);
1057 SAGA_API_DLL_EXPORT double SG_Get_Distance (const TSG_Point &A, const TSG_Point &B);
1058 
1059 SAGA_API_DLL_EXPORT double SG_Get_Distance (double ax, double ay, double az, double bx, double by, double bz);
1061 
1062 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);
1063 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);
1064 
1065 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (double dx, double dy);
1066 SAGA_API_DLL_EXPORT double SG_Get_Angle_Of_Direction (double ax, double ay, double bx, double by);
1069 SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference (double a, double b);
1070 SAGA_API_DLL_EXPORT bool SG_is_Angle_Between (double Angle, double Angle_Min, double Angle_Max, bool bCheckRange = true);
1071 
1072 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);
1073 SAGA_API_DLL_EXPORT bool SG_Get_Crossing_InRegion (TSG_Point &Crossing, const TSG_Point &a , const TSG_Point & b, const TSG_Rect &Region);
1074 
1075 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.);
1076 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);
1077 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);
1078 
1079 SAGA_API_DLL_EXPORT bool SG_Get_Triangle_CircumCircle (TSG_Point Triangle[3], TSG_Point &Point, double &Radius);
1080 
1081 SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area (TSG_Point *Points, int nPoints);
1082 SAGA_API_DLL_EXPORT double SG_Get_Polygon_Area (const CSG_Points &Points);
1083 
1084 
1086 // //
1087 // //
1088 // //
1090 
1091 //---------------------------------------------------------
1092 #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:474
CSG_Point::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:144
CSG_Projections::Create
bool Create(bool LoadCodeList=true)
Definition: projections.cpp:787
CSG_Points_3D::Add
bool Add(const TSG_Point_3D &Point)
Definition: geo_tools.h:334
CSG_Translator
Definition: api_core.h:1451
CSG_Point::~CSG_Point
virtual ~CSG_Point(void)
Definition: geo_tools.h:142
CSG_Projection::Save
bool Save(const CSG_String &File, ESG_CRS_Format Format=ESG_CRS_Format::WKT) const
Definition: projections.cpp:261
CSG_Rect_Int::Get_XMin
int Get_XMin(void) const
Definition: geo_tools.h:622
TSG_Intersection
TSG_Intersection
Definition: geo_tools.h:101
CSG_Points_3D
Definition: geo_tools.h:322
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:585
TSG_Array_Growth
TSG_Array_Growth
Definition: api_core.h:291
CSG_Rects
Definition: geo_tools.h:548
CSG_Rect_Int::Get_YMin
int Get_YMin(void) const
Definition: geo_tools.h:624
TSG_Distance_Weighting
TSG_Distance_Weighting
Definition: geo_tools.h:698
CSG_Projection::Assign
bool Assign(const CSG_Projection &Projection)
Definition: geo_tools.h:859
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:446
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:585
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:407
CSG_Point_4D::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:375
SG_Get_Angle_Difference
SAGA_API_DLL_EXPORT double SG_Get_Angle_Difference(double a, double b)
Definition: geo_functions.cpp:247
CSG_Point_4D::is_Equal
virtual bool is_Equal(const CSG_Point_4D &Point, double epsilon=0.) const
Definition: geo_tools.h:406
CSG_Point_3D::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:213
CSG_Rect_Int::Get_XMax
int Get_XMax(void) const
Definition: geo_tools.h:623
CSG_Points_Int::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:444
CSG_Point::Get_Distance
virtual double Get_Distance(const CSG_Point &Point) const
Definition: geo_tools.h:173
SG_DISTWGHT_EXP
@ SG_DISTWGHT_EXP
Definition: geo_tools.h:701
CSG_Points_Int::Clear
bool Clear(void)
Definition: geo_tools.h:434
A
#define A
CSG_Table_Record
Definition: table.h:130
CSG_Projection::Assign
bool Assign(const CSG_String &Definition)
Definition: geo_tools.h:860
CSG_Points_Int
Definition: geo_tools.h:428
CSG_Rect::Get_XMax
double Get_XMax(void) const
Definition: geo_tools.h:506
CSG_Projection::Get_Unit_Name
CSG_String Get_Unit_Name(void) const
Definition: projections.cpp:612
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_Projection::Get_Unit
ESG_Projection_Unit Get_Unit(void) const
Definition: geo_tools.h:910
CSG_Rect::Get_TopLeft
CSG_Point Get_TopLeft(void) const
Definition: geo_tools.h:516
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
CSG_Point::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:130
SG_DISTWGHT_GAUSS
@ SG_DISTWGHT_GAUSS
Definition: geo_tools.h:702
CSG_Points_3D::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:337
CSG_Rects::Get_Count
int Get_Count(void) const
Definition: geo_tools.h:563
CSG_Projections::CSG_Projection
friend class CSG_Projection
Definition: geo_tools.h:940
CSG_Rect_Int::Get_XRange
int Get_XRange(void) const
Definition: geo_tools.h:627
SSG_Point_4D
Definition: geo_tools.h:359
SSG_Point_3D
Definition: geo_tools.h:265
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
CSG_Projection::is_Okay
bool is_Okay(void) const
Definition: geo_tools.h:863
INTERSECTION_Contains
@ INTERSECTION_Contains
Definition: geo_tools.h:106
CSG_Points_3D::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:338
SSG_Rect_Int
Definition: geo_tools.h:584
CSG_Point_3D::Get_Type
virtual TSG_Point_Type Get_Type(void) const
Definition: geo_tools.h:281
SSG_Point_3D::x
double x
Definition: geo_tools.h:266
CSG_Projection::is_Geographic
bool is_Geographic(void) const
Definition: geo_tools.h:901
CSG_Point_3D::is_Equal
virtual bool is_Equal(double _x, double _y, double _z, double epsilon=0.) const
Definition: geo_tools.h:313
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:468
CSG_Projections::Get_Unit_To_Meter
static double Get_Unit_To_Meter(ESG_Projection_Unit Unit)
Definition: projections.cpp:2330
api_core.h
ESG_CRS_Format::WKT1
@ WKT1
ESG_Projection_Unit
ESG_Projection_Unit
Definition: geo_tools.h:795
CSG_Rects::Get_Rect
CSG_Rect & Get_Rect(int Index)
Definition: geo_tools.h:566
CSG_Rect::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:513
ESG_CRS_Type::Geographic
@ Geographic
CSG_Projection::Get_WKT
const CSG_String & Get_WKT(void) const
Definition: geo_tools.h:887
CSG_Projection::CSG_Projections
friend class CSG_Projections
Definition: geo_tools.h:828
SSG_Point
Definition: geo_tools.h:128
CSG_Distance_Weighting::Get_Weight
double Get_Weight(double Distance) const
Definition: geo_tools.h:736
CSG_Points_3D::Clear
bool Clear(void)
Definition: geo_tools.h:328
CSG_Projection::Get_EPSG
int Get_EPSG(void) const
Definition: geo_tools.h:899
CSG_Rect_Int::Get_TopLeft
TSG_Point_Int Get_TopLeft(void) const
Definition: geo_tools.h:633
CSG_Projection::Destroy
void Destroy(void)
Definition: projections.cpp:235
TSG_Point_3D
struct SSG_Point_3D TSG_Point_3D
CSG_Rect_Int::Get_Diameter
double Get_Diameter(void) const
Definition: geo_tools.h:631
CSG_File
Definition: api_core.h:1126
CSG_Point_4D::~CSG_Point_4D
virtual ~CSG_Point_4D(void)
Definition: geo_tools.h:373
SSG_Rect::xMin
double xMin
Definition: geo_tools.h:468
SSG_Rect
Definition: geo_tools.h:467
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:197
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
CSG_Rect_Int
Definition: geo_tools.h:591
SG_DISTWGHT_IDW
@ SG_DISTWGHT_IDW
Definition: geo_tools.h:700
CSG_Rect::Get_XRange
double Get_XRange(void) const
Definition: geo_tools.h:510
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
ESG_Projection_Unit::Kilometer
@ Kilometer
CSG_Point
Definition: geo_tools.h:135
CSG_Rect::Get_YMin
double Get_YMin(void) const
Definition: geo_tools.h:507
CSG_Points_Int::Add
bool Add(const TSG_Point_Int &Point)
Definition: geo_tools.h:440
CSG_Rects_Int::Get_Count
int Get_Count(void) const
Definition: geo_tools.h:675
CSG_Projection::Get_Name
const CSG_String & Get_Name(void) const
Definition: geo_tools.h:885
CSG_Points::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:201
SSG_Point_4D::m
double m
Definition: geo_tools.h:360
CSG_Projection::Get_Unit_Identifier
CSG_String Get_Unit_Identifier(void) const
Definition: projections.cpp:606
INTERSECTION_None
@ INTERSECTION_None
Definition: geo_tools.h:102
SSG_Point_4D::z
double z
Definition: geo_tools.h:360
CSG_Point_3D
Definition: geo_tools.h:272
CSG_Point_3D::Get_Distance
virtual double Get_Distance(const CSG_Point_3D &Point) const
Definition: geo_tools.h:310
CSG_Point_4D
Definition: geo_tools.h:366
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Projections::Load
bool Load(const CSG_String &File, bool bAppend=false)
Definition: projections.cpp:1103
CSG_Rect_Int::Get_BottomRight
TSG_Point_Int Get_BottomRight(void) const
Definition: geo_tools.h:634
CSG_Projection::Get_Authority_ID
int Get_Authority_ID(void) const
Definition: geo_tools.h:898
CSG_Distance_Weighting
Definition: geo_tools.h:713
CSG_Projection::Get_Proj4
const CSG_String & Get_Proj4(void) const
Definition: geo_tools.h:897
TSG_Point_Int
struct SSG_Point_Int TSG_Point_Int
CSG_Projection::Get_Type
ESG_CRS_Type Get_Type(void) const
Definition: geo_tools.h:906
CSG_Point_4D::Get_Length
virtual double Get_Length(void) const
Definition: geo_classes.cpp:303
SSG_Rect_Int::xMax
int xMax
Definition: geo_tools.h:585
CSG_Points_3D::Get_Points
TSG_Point_3D * Get_Points(void) const
Definition: geo_tools.h:340
CSG_Lines::Get_Line
const CSG_Points & Get_Line(sLong Index) const
Definition: geo_tools.h:243
SSG_Rect_Int::xMin
int xMin
Definition: geo_tools.h:585
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:732
CSG_Lines::Get_Count
sLong Get_Count(void) const
Definition: geo_tools.h:240
INTERSECTION_Identical
@ INTERSECTION_Identical
Definition: geo_tools.h:103
SG_Get_Projections
SAGA_API_DLL_EXPORT CSG_Projections & SG_Get_Projections(void)
Definition: projections.cpp:69
SSG_Rect::yMax
double yMax
Definition: geo_tools.h:468
CSG_Projection::Load
bool Load(const CSG_String &File)
Definition: projections.cpp:253
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
ESG_CRS_Format
ESG_CRS_Format
Definition: geo_tools.h:783
CSG_Point::is_Equal
virtual bool is_Equal(double _x, double _y, double epsilon=0.) const
Definition: geo_tools.h:176
CSG_Points
Definition: geo_tools.h:185
CSG_Projection::Get_PROJ
const CSG_String & Get_PROJ(void) const
Definition: geo_tools.h:890
CSG_Rect::Get_BottomRight
CSG_Point Get_BottomRight(void) const
Definition: geo_tools.h:517
CSG_Projection
Definition: geo_tools.h:827
CSG_Table
Definition: table.h:285
CSG_Rect::Get_Diameter
double Get_Diameter(void) const
Definition: geo_tools.h:514
SSG_Point_4D::y
double y
Definition: geo_tools.h:360
CSG_Rects_Int::Get_Rect
CSG_Rect_Int & Get_Rect(int Index)
Definition: geo_tools.h:678
CSG_Points_3D::Del
bool Del(sLong Index)
Definition: geo_tools.h:335
CSG_Projection::Assign
bool Assign(int Code, const SG_Char *Authority=NULL)
Definition: geo_tools.h:861
SG_Char
#define SG_Char
Definition: api_core.h:536
CSG_Array
Definition: api_core.h:308
B
#define B
CSG_Points_Int::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:443
ESG_CRS_Type
ESG_CRS_Type
Definition: geo_tools.h:789
CSG_String
Definition: api_core.h:563
CSG_Array_Pointer
Definition: api_core.h:368
CSG_Point_3D::~CSG_Point_3D
virtual ~CSG_Point_3D(void)
Definition: geo_tools.h:279
CSG_Projection::Get_WKT2
const CSG_String & Get_WKT2(void) const
Definition: geo_tools.h:889
SSG_Point_Int
Definition: geo_tools.h:421
CSG_MetaData
Definition: metadata.h:88
CSG_Projection::Get_Code
int Get_Code(void) const
Definition: geo_tools.h:895
CSG_Distance_Weighting::Get_IDW_Power
double Get_IDW_Power(void) const
Definition: geo_tools.h:726
TSG_Rect
struct SSG_Rect TSG_Rect
CSG_Rect::Get_Center
CSG_Point Get_Center(void) const
Definition: geo_tools.h:519
CSG_Rect_Int::Get_YRange
int Get_YRange(void) const
Definition: geo_tools.h:628
SSG_Point_3D::y
double y
Definition: geo_tools.h:266
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:441
metadata.h
TSG_Point_Type::SG_POINT_TYPE_2D
@ SG_POINT_TYPE_2D
SSG_Point::x
double x
Definition: geo_tools.h:129
CSG_Projections::Get_Unit_Name
static const CSG_String Get_Unit_Name(ESG_Projection_Unit Unit, bool bSimple=true)
Definition: projections.cpp:2300
SSG_Point_4D::x
double x
Definition: geo_tools.h:360
CSG_Projection::Get_Unit_To_Meter
double Get_Unit_To_Meter(void) const
Definition: projections.cpp:618
CSG_Projection::is_Projection
bool is_Projection(void) const
Definition: geo_tools.h:904
SSG_Rect::yMin
double yMin
Definition: geo_tools.h:468
CSG_Rect::Get_XCenter
double Get_XCenter(void) const
Definition: geo_tools.h:520
CSG_Rect::Get_YMax
double Get_YMax(void) const
Definition: geo_tools.h:508
CSG_Rect_Int::Get_YMax
int Get_YMax(void) const
Definition: geo_tools.h:625
CSG_Point_3D::is_Equal
virtual bool is_Equal(const CSG_Point_3D &Point, double epsilon=0.) const
Definition: geo_tools.h:312
CSG_Rects_Int
Definition: geo_tools.h:661
CSG_Rect::Get_XMin
double Get_XMin(void) const
Definition: geo_tools.h:505
SSG_Point_Int::y
int y
Definition: geo_tools.h:422
SSG_Point::y
double y
Definition: geo_tools.h:129
CSG_Grid
Definition: grid.h:475
SSG_Point_3D::z
double z
Definition: geo_tools.h:266
CSG_Projections::Get_Unit_Identifier
static const CSG_String Get_Unit_Identifier(ESG_Projection_Unit Unit)
Definition: projections.cpp:2270
CSG_Projection::is_Geocentric
bool is_Geocentric(void) const
Definition: geo_tools.h:903
CSG_Rect::Get_YCenter
double Get_YCenter(void) const
Definition: geo_tools.h:521
CSG_Projection::is_Geodetic
bool is_Geodetic(void) const
Definition: geo_tools.h:902
CSG_Lines::Get_Line
CSG_Points & Get_Line(sLong Index)
Definition: geo_tools.h:242
CSG_Shapes
Definition: shapes.h:773
CSG_Point_4D::Get_Distance
virtual double Get_Distance(const CSG_Point_4D &Point) const
Definition: geo_tools.h:404
CSG_Lines
Definition: geo_tools.h:217
TSG_Point
struct SSG_Point TSG_Point
CSG_Points::Get_Points
TSG_Point * Get_Points(void) const
Definition: geo_tools.h:203
CSG_Projections::Destroy
void Destroy(void)
Definition: projections.cpp:848
CSG_Points::Set_Count
bool Set_Count(sLong nPoints)
Definition: geo_tools.h:200
CSG_Points::Clear
bool Clear(void)
Definition: geo_tools.h:191
INTERSECTION_Contained
@ INTERSECTION_Contained
Definition: geo_tools.h:105
CSG_Parameters
Definition: parameters.h:1690
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_Projections::Save
bool Save(const CSG_String &File)
Definition: projections.cpp:1109
CSG_Projection::Get_Authority
const CSG_String & Get_Authority(void) const
Definition: geo_tools.h:894
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:96
SSG_Point_Int::x
int x
Definition: geo_tools.h:422
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:175
SG_DISTWGHT_None
@ SG_DISTWGHT_None
Definition: geo_tools.h:699
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:2694
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:723
CSG_Rect_Int::Get_Area
double Get_Area(void) const
Definition: geo_tools.h:630
CSG_Rect::Get_YRange
double Get_YRange(void) const
Definition: geo_tools.h:511
CSG_Points::Del
bool Del(sLong Index)
Definition: geo_tools.h:198
CSG_Projections
Definition: geo_tools.h:939
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:2811
CSG_Distance_Weighting::Get_IDW_Offset
bool Get_IDW_Offset(void) const
Definition: geo_tools.h:729
CSG_Table::_On_Construction
virtual void _On_Construction(void)
Definition: table.cpp:295
operator+
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473