Skip to content

GSIP 191

Fernando Miño edited this page Apr 15, 2020 · 1 revision

GSIP 191 - New extension point in WMS rendering to enrich style symbolizers

Overview

This is a proposal for adding a new extension point to enrich and process style symbolizers in Geoserver WMS rendering.

Proposed By

  • Fernando Miño
  • Nuno Oliveira

Assigned to Release

This proposal is for:

  • Geoserver 2.17-RC
  • GeoServer 2.16.3

State

  • Under Discussion
  • In Progress
  • Completed
  • Rejected
  • Deferred

Motivation

This is a proposal for adding an extension point for processing and enriching style symbolizers in base to the feature being rendered. In this manner now it will be possible to dinamically build and modify symbolizers in base to the feature data in GeoServer rendering stage by any module using the extension point.

Proposal

A Java interface named SymbolizersCallback will be added to GeoServer WMS module, on org.geoserver.wms package with the following signature:

    interface SymbolizersCallback {
	    /** Can modify the list of symbolizers to be painted */
	    List<Symbolizer> apply(Feature feature, List<Symbolizer> symbolizers);
	}

The modules implementing SymbolizersCallback interface will register the extension point in GeoServer Spring application context (via the applicationContext xml file).

On rendering stage, GeoServer will fetch all the registered Java beans implementing SymbolizersCallback interface using the extensions API, and will execute them providing the current Feature and list of symbolizers to be rendered. This process will be executed before the features/symbolizers are drawn.

To achieve this, this extension point mechanism will be executed before every code point where the StreamingRenderer Geotools class is instanced on GeoServer WMS, thus on classes:

  • RenderedImageMapOutputFormat
  • IconRenderer
  • PDFMapResponse
  • SVGBatikMapOutputFormat
  • CRSAreaOfValidityMapBuilder

For intercepting the about to render feature and Symbolizers list, the StreamingRenderer.processSymbolizers method will be extended, process the feature and symbolizers on callbacks found (if any) and return to the default execution method chain (the super method) with the resulting feature/symbolizers. Currently this method is private so we will need to change it to protected or add a new protected method intercepting the feature/symbolizers values before continuing with the render process.

Backwards Compatibility

This new enhancement is planned with backward compatibility in mind: when no callbacks are registered the execution chain will remain the same.

Feedback

Voting

Project Steering Committee:

  • Alessio Fabiani:
  • Andrea Aime:
  • Ian Turton:
  • Jody Garnett:
  • Jukka Rahkonen:
  • Kevin Smith:
  • Simone Giannecchini:
  • Torben Barsballe:
  • Nuno Oliveira:

Links