@@ -60,6 +60,7 @@ def apply(
60
60
value : int ,
61
61
description : str | None = None ,
62
62
name : str | None = None ,
63
+ title : str | None = None ,
63
64
color_hint : str | None = None ,
64
65
nodata : bool | None = None ,
65
66
percentage : float | None = None ,
@@ -74,6 +75,7 @@ def apply(
74
75
name: Short name of the class for machine readability. Must consist only
75
76
of letters, numbers, -, and _ characters. Required as of v2.0 of
76
77
this extension.
78
+ title: Human-readable name for use in, e.g., a map legend
77
79
color_hint: An optional hexadecimal string-encoded representation of the
78
80
RGB color that is suggested to represent this class (six hexadecimal
79
81
characters, all capitalized)
@@ -90,6 +92,7 @@ def apply(
90
92
"As of v2.0.0 of the classification extension, 'name' is required"
91
93
)
92
94
self .name = name
95
+ self .title = title
93
96
self .description = description
94
97
self .color_hint = color_hint
95
98
self .nodata = nodata
@@ -108,6 +111,7 @@ def create(
108
111
value : int ,
109
112
description : str | None = None ,
110
113
name : str | None = None ,
114
+ title : str | None = None ,
111
115
color_hint : str | None = None ,
112
116
nodata : bool | None = None ,
113
117
percentage : float | None = None ,
@@ -122,6 +126,7 @@ def create(
122
126
name: Short name of the class for machine readability. Must consist only
123
127
of letters, numbers, -, and _ characters. Required as of v2.0 of
124
128
this extension.
129
+ title: Human-readable name for use in, e.g., a map legend
125
130
color_hint: An optional hexadecimal string-encoded representation of the
126
131
RGB color that is suggested to represent this class (six hexadecimal
127
132
characters, all capitalized)
@@ -134,6 +139,7 @@ def create(
134
139
c .apply (
135
140
value = value ,
136
141
name = name ,
142
+ title = title ,
137
143
description = description ,
138
144
color_hint = color_hint ,
139
145
nodata = nodata ,
@@ -189,6 +195,17 @@ def name(self, v: str) -> None:
189
195
)
190
196
self .properties ["name" ] = v
191
197
198
+ @property
199
+ def title (self ) -> str | None :
200
+ return self .properties .get ("title" )
201
+
202
+ @title .setter
203
+ def title (self , v : str ) -> None :
204
+ if v is not None :
205
+ self .properties ["title" ] = v
206
+ else :
207
+ self .properties .pop ("title" , None )
208
+
192
209
@property
193
210
def color_hint (self ) -> str | None :
194
211
"""Get or set the optional color hint for this class.
0 commit comments