SAGA API Version 9.14
Loading...
Searching...
No Matches
map_classify.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// map_classify.h //
15// //
16// Copyright (C) 2025 by //
17// Olaf Conrad //
18// //
19//-------------------------------------------------------//
20// //
21// This file is part of 'SAGA - System for Automated //
22// Geoscientific Analyses'. SAGA is free software; you //
23// can redistribute it and/or modify it under the terms //
24// of the GNU General Public License as published by the //
25// Free Software Foundation, either version 2 of the //
26// License, or (at your option) any later version. //
27// //
28// SAGA is distributed in the hope that it will be //
29// useful, but WITHOUT ANY WARRANTY; without even the //
30// implied warranty of MERCHANTABILITY or FITNESS FOR A //
31// PARTICULAR PURPOSE. See the GNU General Public //
32// License for more details. //
33// //
34// You should have received a copy of the GNU General //
35// Public License along with this program; if not, see //
36// <http://www.gnu.org/licenses/>. //
37// //
38//-------------------------------------------------------//
39// //
40// contact: Olaf Conrad //
41// Institute of Geography //
42// University of Hamburg //
43// Germany //
44// //
45// e-mail: oconrad@saga-gis.org //
46// //
48
49//---------------------------------------------------------
50#ifndef _HEADER_INCLUDED__SAGA_GDI__Map_Classify_H
51#define _HEADER_INCLUDED__SAGA_GDI__Map_Classify_H
52
53
55// //
56// //
57// //
59
60//---------------------------------------------------------
61#include "../table.h"
62
63
65// //
66// //
67// //
69
70//---------------------------------------------------------
72{
73public:
74
79
80 enum class LUT_Fields
81 {
83 };
84
85 //-----------------------------------------------------
86 CSG_Map_Classify(void);
87 virtual ~CSG_Map_Classify(void);
88
90 bool Create (CSG_Data_Object *pObject);
91
92 CSG_Map_Classify (CSG_Table *pTable, int Field, int Normalize = -1, bool bPercent = false);
93 bool Create (CSG_Table *pTable, int Field, int Normalize = -1, bool bPercent = false);
94
95 bool Destroy (void);
96
97 //-----------------------------------------------------
98 const CSG_String & Get_Name (Classifier Classifier) const;
99
100 bool is_Okay (void) const { return( m_pObject && m_nValues > 0 ); }
101 bool is_Classified (void) const { return( m_Classifier != Classifier::NotSet ); }
102 Classifier Get_Classifier (void) const { return( m_Classifier ); }
103
104 bool Set_LUT (CSG_Table &LUT, CSG_Colors Colors, int Labeling, int NumPrecision = -2) const;
105
106 bool Classify_Unique (int maxCount = 1024);
107 bool Classify_Equal (int Count, double Minimum, double Maximum);
108 bool Classify_Equal (int Count);
109 bool Classify_Defined (double Interval, double Offset);
110 bool Classify_Defined (double Interval);
111 bool Classify_Quantile (int Count, bool bHistogram = true);
112 bool Classify_Geometric (int Count, bool bIncreasing = true);
113 bool Classify_Natural (int Count);
114 bool Classify_StdDev (double StdDev, double StdDev_Max = 4.);
115
116 bool m_Show_Progress = false;
117
118
119private:
120
121 bool m_bPercent = false;
122
123 int m_Field = -1;
124
125 sLong m_nValues = 0;
126
127 CSG_Data_Object *m_pObject = NULL;
128
129 CSG_Table m_Normalized, m_Classes;
130
131 Classifier m_Classifier = Classifier::NotSet;
132
133
134 bool _is_Numeric (void) const;
135 bool _Create_Classes (void);
136
137 bool _Set_Progress (sLong i) const;
138
139 bool _Get_Value (sLong i, double &Value, bool bIndexed = false) const;
140 bool _Get_Value (sLong i, CSG_String &Value, bool bIndexed = false) const;
141
142 bool _Get_Statistics (CSG_Simple_Statistics &Statistics) const;
143 bool _Get_Histogram (CSG_Histogram &Histogram ) const;
144 bool _Set_Index (void);
145
146};
147
148
150// //
151// //
152// //
154
155//---------------------------------------------------------
156#endif // #ifndef _HEADER_INCLUDED__SAGA_GDI__Map_Classify_H
signed long long sLong
Definition api_core.h:158
#define SAGA_API_DLL_EXPORT
Definition api_core.h:94
bool is_Okay(void) const
bool is_Classified(void) const
Classifier Get_Classifier(void) const