Skip to content

Commit

Permalink
Tweak categorial raster fsl
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 10, 2024
1 parent a104c1d commit 053f693
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion felt/core/fsl_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ def paletted_renderer_to_fsl(
colors = []
labels = {}
for _class in renderer.classes():
categories.append(_class.value)
categories.append(str(_class.value))
colors.append(_class.color.name())
labels[str(_class.value)] = _class.label
return {
Expand Down
2 changes: 1 addition & 1 deletion felt/core/layer_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def representative_layer_style(
)

if fsl:
fsl['version'] = '2.1'
fsl['version'] = '2.1.1'

return LayerStyle(
fsl=fsl
Expand Down
4 changes: 2 additions & 2 deletions felt/test/test_fsl_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ def test_convert_paletted_raster(self):

self.assertEqual(FslConverter.raster_renderer_to_fsl(
renderer, context),
{'config': {'band': 1, 'categories': [120.0, 125.0, 130.0]},
{'config': {'band': 1, 'categories': ['120.0', '125.0', '130.0']},
'legend': {'displayName': {'120.0': 'lowest',
'125.0': 'mid',
'130.0': 'highest'}},
Expand All @@ -2026,7 +2026,7 @@ def test_convert_paletted_raster(self):

self.assertEqual(FslConverter.raster_renderer_to_fsl(
renderer, context),
{'config': {'band': 2, 'categories': [120.0, 125.0, 130.0]},
{'config': {'band': 2, 'categories': ['120.0', '125.0', '130.0']},
'legend': {'displayName': {'120.0': 'lowest',
'125.0': 'mid',
'130.0': 'highest'}},
Expand Down

0 comments on commit 053f693

Please sign in to comment.