Class TLspAISStyler
- All Implemented Interfaces:
ILspStyler
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:
- 3d only: com/my/ais/se/MyAerodrome_3D.sld
- 3d only: com/luciad/ais/symbology/se/MyAerodrome_3D.sld
- 3d only: com/my/ais/se/Aerodrome_3D.sld
- 3d only: com/luciad/ais/symbology/se/Aerodrome_3D.sld
- com/my/ais/se/MyAerodrome.sld
- com/luciad/ais/symbology/se/MyAerodrome.sld
- com/my/ais/se/Aerodrome.sld
- com/luciad/ais/symbology/se/Aerodrome.sld
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:
- For
aerodromes
: Identifier - For
airspaces
: Class, Identifier, Name, Type, ControllingAgency, LowerLimit, LowerLimitUnit, LowerLimitReference, UpperLimit, UpperLimitUnit, UpperLimitReference - For
ATS routes
: Identifier - For
navaids
: Identifier, Name, Type, Frequency, MorseCode - For
refueling tracks
: Identifier - For
runways
: SurfaceType - For
waypoints
: Name - For
obstacles
: Name
Similarly, the default .sld
files refer to properties that are intercepted to calculate geometry from domain objects:
- For
holdings
andprocedures
: 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 Summary
ConstructorDescriptionTLspAISStyler
(TLcdSLDContext aSLDContext, String... aBaseDirectories) Creates a new styler that looks in the given directories for.sld
files.TLspAISStyler
(String... aBaseDirectories) Creates a new styler that looks in the given directories for.sld
files. -
Method Summary
Modifier and TypeMethodDescriptionvoid
style
(Collection<?> aObjects, ALspLabelStyleCollector aLabelStyleCollector, TLspContext aContext) Convenience method that takes anALspLabelStyleCollector
as argument instead of anALspStyleCollector
.void
style
(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext) Implementation ofILspStyler.style
that either casts theALspStyleCollector
toALspLabelStyleCollector
if possible, or adapts it otherwise.Methods inherited from class com.luciad.view.lightspeed.style.styler.ALspStyler
addStyleChangeListener, fireStyleChangeEvent, fireStyleChangeEvent, removeStyleChangeListener
-
Constructor Details
-
TLspAISStyler
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
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 benull
aBaseDirectories
- An optional set of directories to search for.sld
files
-
-
Method Details
-
style
public void style(Collection<?> aObjects, ALspLabelStyleCollector aLabelStyleCollector, TLspContext aContext) Description copied from class:ALspLabelStyler
Convenience method that takes an
ALspLabelStyleCollector
as argument instead of anALspStyleCollector
. This method is called fromALspLabelStyler.style(Collection, ALspStyleCollector, TLspContext)
.- Specified by:
style
in classALspLabelStyler
- Parameters:
aObjects
- The set of domain objects to provide information foraLabelStyleCollector
- The label style collector to submit the information to.aContext
- The context- See Also:
-
style
Description copied from class:ALspLabelStyler
Implementation of
ILspStyler.style
that either casts theALspStyleCollector
toALspLabelStyleCollector
if possible, or adapts it otherwise. In the latter case, the labeling-specific calls (label
,anchorLabel
,algorithm
, ...) are ignored. TheALspLabelStyleCollector
is then passed to thestyle(Collection,ALspLabelStyleCollector,TLspContext)
method.- Specified by:
style
in interfaceILspStyler
- Overrides:
style
in classALspLabelStyler
- Parameters:
aObjects
- The objects to be styled.aStyleCollector
- A style collector to which all styling information should be passed, this collector is only valid within this method call, and can no longer be used afterwards.aContext
- Provides context information that may affect styling, such as view specific properties.
-