Skip to content

Removal of Style model and simplification of style management #13227

@giohappy

Description

@giohappy

The management of the dataset's styles has been historically managed inside the GeoNode with a dedicated model. Datasets hold a relation to the Style(s)m because in the past, multiple styles could be managed for the dataset, and various synchronization mechanisms were (and some of them still are) in place to keep the information aligned with the Geoserver catalogue.

With GeoNode 4, we have switched to a model where the dataset has a single style assigned, which is used for the preview of the dataset. A different style can only be assigned to a dataset when used inside one (or multiple) maps.
This was already a good moment to remove the Style model and simplify the way the style for a dataset is tracked in GeoNode, but we weren't ready for other reasons.

With GeoNode 5, we want to get rid of the Style model in GeoNode and just keep track of the style name as a simple text field inside the Dataset model.
This way, the actual management of the style is only a concern of the client, who communicates directly with Geoserver and manages the styles assigned to the Geoserver layer. The client simply communicates to GeoNode the name of the current style for the dataset or the maplayer (i.e., a dataset in a map) when the dataset or the map is saved.

This task requires the following changes to models:

  • Removal of the Style model
  • Drop the Dataset.styles field
  • Change the Dataset.default_style to Dataset.style and make it a text field
  • manage the migration accordingly, to migrate existing data
  • Adapt the API endpoints

Review, and where possible, removal of any code related to the management of styles

  • this geoserver_proxy block
  • all methods that synchronize styles between GeoNode and Geoserver (e.g., gs_slurp, updatelayers, etc.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions