Skip to end of metadata
Go to start of metadata


Upgrading styles for more functionalities


Johann Sorel


Style Upgrade


Currently, GeoTools styles package is based on OGC SLD 1.0.0.

This proposal will upgrade GeoTools style package to follow newer specifications :

  • OGC Symbology Encoding 1.1
  • SLD 1.1.0 (only the style class)
  • ISO 19117 "portrayal"

JavaDoc of the GeoAPI interfaces :

A Basic Implementation :

To tests on the go-renderer, I committed a basic implementation in the unsupported GO module.
package :

What is new :

  • styles can be expressed in display units (pixels for screen) or in land units like meters, foots ...
  • styles interfaces are more accurate, some interfaces have been splitted (like graphic that can be graphicFill or GraphicStroke with more details)
  • styles handle inline objects.
  • Java5 Generics and Enumerations helps do avoid mistakes
  • symbolizers are immutable
  • FeatureTypeStyle is mutable and has add/remove listeners

Some changes may be more or less a problem like :

  • arrays[] replaced by lists or collections
  • raster symbolizer functions

    Solution for array versus collection


    A solution is to rename GeoAPI " getRules() " method to " rules() " .

    Raster function test


    Jody provided a version of Categorize function and I tryed to use it.
    It looks usable, we can get back all attributs from the function.
    We can also extends the function with a special "categorizeFunction" interface
    which provide more convinient methods to grab parameters.

    The GeoAPI interfaces are new and have never been implemented before, if while implementing some interface raise problems then a solution is to backport changes in GeoAPI.


Style Creation

We will be adding additional methods as needed to the GeoTools StyleFactoryImpl. When we are happy with the result we will create a GeoAPI StyleFactory with the needed methods.

We will be using single words (no "create" prefix) similar to FilterFactory. We must be careful to provide each and every parameter during construction of the immutable objects. For mutable objects we will have two methods; one taking only the required parameters; and one taking each and every parameter.

Integration with existing Interfaces

We are making use of type narrowing to allow the GeoTools implementation to implement both org.geotools.styling and interfaces. The acceptance test is to have existing code still compile; and to migrate the renderers to the new interfaces.



Direct Collection Use

We are setting up new methods for direct manipulation of collection based access. Modifications made to the collection will issue change events.



  • We cannot use the List in the Factory - we will need to use our own collection internally that can issue events as contents are added / removed / and moved up and down.

Listeners for Mutable Classes


Note each data structure is having its own set of listeners.


  • Be sure to include oldValue and newValue in the StyleEvent

New Methods for FeatureTypeStyle


New Methods for Symbolizer


API Change for ColorMap




  • Is the Function a copy? Or is the Function another "view" on the same data structure? Can ColorMap implement Function and get it over with?

Those are only the most interesting/problematic changes, feel free to explore the interfaces to find other changes.


This proposal was started by Johann Sorel but never completed; please see Cleanup Style Interface Deprecations for a plan to clean up after this incomplete work.

Voting on this proposal:

Community support:


This section is used to make sure your proposal is complete (did you remember documentation?) and has enough paid or volunteer time lined up to be a success


no progress






lack mandate/funds/time


volunteer needed

July 15th deadline:

  1. API change before GeoTools 2.5 goes out; deprecate symbolizer setter methods (tick)
  2. Update wiki upgrade to to 2.5 pages; linking to instructions for DuplicatingStyleVisitor
  3. Start 2.5.x branch
  4. API changed based on BEFORE / AFTER
  5. Update default implementation
  6. Add factory methods
  7. Deploy for other team members

After July 15th deadline:

  1. Remove deprecated code from GeoTools project (yeah!)
  2. Create based on experience above
  3. Update or provided sample code in demo
  4. Update the user guide examples (there are only two pages; copy and paste from demo)
  • No labels