Class TLspAISStyler

All Implemented Interfaces:
ILspStyler

public class TLspAISStyler extends ALspLabelStyler
ICAO styler for AIS data based on Symbology Encoding.

This styler can be used for bodies as well as labels.

SLD file lookup

This styler looks for .sld files in a set of locations based on the data type of an object.

  • The file must be named <datatype>.sld.
  • If a matching file is found it will be used, the others ignored.
  • If no file is found, it looks for a file using the data type's super type.
  • The default AIS .sld files ("com/luciad/ais/symbology/se") are automatically added to the list with lowest priority. There is a file for each of the AIS data types.
  • In a 3D view, the styler will first look for a file named <datatype>_3D.sld. If no such file is found, it will look for a file named <datatype>.sld

Example

Consider an example where you have an object with data type MyAerodrome, extending from Aerodrome, and you created a styler with location com/my/ais/se. The styler will sequentially look for these files, and use the first it encounters:

  1. 3d only: com/my/ais/se/MyAerodrome_3D.sld
  2. 3d only: com/luciad/ais/symbology/se/MyAerodrome_3D.sld
  3. 3d only: com/my/ais/se/Aerodrome_3D.sld
  4. 3d only: com/luciad/ais/symbology/se/Aerodrome_3D.sld
  5. com/my/ais/se/MyAerodrome.sld
  6. com/luciad/ais/symbology/se/MyAerodrome.sld
  7. com/my/ais/se/Aerodrome.sld
  8. com/luciad/ais/symbology/se/Aerodrome.sld
If no such file is encountered, a warning is logged and no styling will be applied.

Customization

You have various ways to customize the styling provided by this styler.

Provide custom .sld files
In the example above, you can override the styling of all aerodromes if you provide com/my/ais/se/Aerodrome.sld. Note that this file completely replaces the default one, so no existing rules are kept. You can copy one of the existing files from "com/luciad/ais/symbology/se", or create one from scratch.

Use custom property retriever
Sometimes, you may need to use properties that are not available on your data model but rather calculated from other properties. Also, some of the default styling relies on property names that may not exist on your data model (see further). In this case, it may be useful to use your own SLD property retriever. You can provide it through the SLD context in the constructor of this styler.

Wrap this styler
For complete control, you can wrap this styler and delegate to this styler in your style method. You can choose when to delegate, when to adapt styles or when to submit your own styles. See ALspStyleCollectorWrapper to make wrapping easier.

Data modeling assumptions

This styler does styling based on information that is commonly present in the AIS sub-types, but not explicitly modeled in the TLcdAISDataTypes, for example runway surface type.

To do this, the default .sld files used by this styler (in "com/luciad/ais/symbology/se") refer to properties that do not exist in the data model. If your model does have these properties, they will be picked up. Otherwise, you can create your own .sld files based on the default ones, as described above, and for example adjust them to use other properties.
The properties are:

Similarly, the default .sld files refer to properties that are intercepted to calculate geometry from domain objects:

  • For holdings and procedures: GeometryLineNormal, GeometryLineMissed, GeometryLineConnector, GeometryLineDecorator, GeometryLineError, GeometryPointDecorator, GeometryPoint
  • For runways: GeometryRunwayBuffer

ICAO labels

This styler can display AIS labels using a custom SLD extension, AISTextSymbolizer. This symbolizer is an extension of a regular TextSymbolizer, so you can use its customization tags, as well as some others. You can configure what properties to use for specific parts of the label.

For more details, see the documentation in the schema definition com/luciad/ais/symbology/se/lcd_icao_sld.xsd.

Example:

     <FeatureTypeStyle>
       <Rule>
        <lcd:AISTextSymbolizer>
          <lcd:PropertyMappings>
            <lcd:PropertyMapping key="Identifier">Id</lcd:PropertyMapping>
            <lcd:PropertyMapping key="Type">NavaidClass</lcd:PropertyMapping>
            ...
          </lcd:PropertyMappings>
        </lcd:AISTextSymbolizer>
      </Rule>
    </FeatureTypeStyle>
  

Since:
2014.0
  • Constructor Details

    • TLspAISStyler

      public TLspAISStyler(String... aBaseDirectories)

      Creates a new styler that looks in the given directories for .sld files. These directories can either be absolute paths or relative paths in the classpath.

      The first location has the highest priority. The default AIS files ("com/luciad/ais/symbology/se") will automatically be appended and have lowest priority.

      See class javadoc for details on how the given directories are used.

      Parameters:
      aBaseDirectories - An optional set of directories to search for .sld files.
    • TLspAISStyler

      public TLspAISStyler(TLcdSLDContext aSLDContext, String... aBaseDirectories)

      Creates a new styler that looks in the given directories for .sld files. These directories can either be absolute paths or relative paths in the classpath.

      The first location has the highest priority. The default AIS files ("com/luciad/ais/symbology/se") will automatically be appended and have lowest priority.

      A SLD context can be provided, for example to provide a custom property retriever.

      See class javadoc for details on how the given directories are used.

      Parameters:
      aSLDContext - The SLD context to use. Can be null
      aBaseDirectories - An optional set of directories to search for .sld files
  • Method Details