Skip to content

raster layer - Use GeoNode SLD style when loading in QGIS #91

@ricardogsilva

Description

@ricardogsilva

The GeoNode v2 API returns a layer's style in SLD format. Lets use that to style a raster layer that is loaded into QGIS.

Unfortunately, QGIS does not currently support import of SLD for raster layers (export is supported though) We'll likely need to read in the SLD and convert it to QGIS' native style format (QML). There are a couple of plugins that implement such functionality:

  • SLD4raster - its sld4raster.py has two interesting methods which we can likely adapt: qml2Sld() and sld2qml()`
  • GeoCatBridge - is also able to convert qml to sld but the code is more complex

Let's study these and come up with a suitable implementation that would allows us load a raster SLD style into QGIS.

NOTES

  • A GeoNode layer can have multiple styles, not just one. Regardless, there is always a default style. When a layer is first loaded we shall assign it the default style it has on GeoNode. GeoNode is moving towards a single style per layer
  • It shall be possible to select one of the other styles the layer may have for loading. This shall be implemented by means of an additional GUI control, so it will be better described in a later issue.
  • The layer's SLD style shall be retrieved from the API's detail response (i.e. /layers/{layer-id}), not from the list response (/layers)
  • The current version of GeoNode API returns the SLD document directly in the layer details. However, this may change in the future. As such, lets not assume that we will always have the style readily accessible for loading.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions