Class TLfnVectorCoverageMetadata

All Implemented Interfaces:
ILcdBounded

public class TLfnVectorCoverageMetadata extends ALfnCoverageMetadata
Deprecated.
Since 2017.0 support for coverages of type VECTOR has been superseded with other mechanisms. Please refer to the Fusion migration guide for more information.

A representation of a coverage which contains vector data. It provides the following parameters in addition to those defined in the superclass:

  • data model: the data model of the coverage. If not set or set to negative value, an auto-default value will be used based on the data models of the assets.
  • maximum level: the coverage's maximum level. In contrast with raster coverages, a vector coverage's maximum level is uniform across the coverage. If not set or set to a negative value, an auto-default value will be used based on the compilation scales of the assets.
  • filters: geometry filters to transform or suppress features at less detailed levels. The default value is an empty list. If not set or set to null, the default value will be used.
  • force linear interpolation: interpret all lines as cartesian, regardless of the geographic reference. The default value is false.
  • line simplification factor: sets the line simplification factor. The default value is 1.0. See sections below for details.
  • area simplification factor: set the area simplification factor. The default value is 1.0. See sections below for details.

For vector data, it is extremely important to correctly configure the coverage. Without configuration, a tile contains all the data of the physical area it covers in full detail. A tile at a lower level covers a physical area which is four times larger than the tiles one level higher, meaning it contains much more data. Tiles at level 0 would then contain all of the data in the assets. When working with large data sets, this would quickly lead to an out-of-memory exception.

To avoid this there are two mechanisms available which can both be configured on the coverage: feature simplification and feature filtering. The next sections discuss both mechanisms in more detail. Note that both mechanisms can (and should) be used together.

Feature simplification

For most features it is not needed to always show them in full detail. When zoomed out, most of those details cannot be distinguished so there is no need to show them. The following simplification modes are available:

  • Line simplification: when enabled, this will progressively reduce the number of points on less-detailed levels. This can be applied to all datasets out-of-the box. See getLineSimplificationFactor() for more information.
  • Area simplification: when enabled, this will automatically discard parts of features or entire features if the area of the geometry is below a certain threshold. The threshold is such that discarded parts would be smaller than a few pixels when viewed at the corresponding scale. See getAreaSimplificationFactor() for more information.

Feature filtering

Feature filtering is based on the properties of the data model. This allows LuciadFusion to remove entire features at less-detailed levels. For example if you have a data set with road data, you typically only want to show the major roads (e.g. highways) when zoomed out. When zooming in further, all road types can become visible (e.g. small country lanes, pedestrian roads, ... ).

Since the filtering is dependent on the information in the data set, LuciadFusion cannot do this automatically. It must be configured on the coverage by the API user.

There are two filtering mechanisms available. They are mutually exclusive.

In general SLD is used to style data. It allows to associate a style with a certain filter, which is used to determine on which data the style must be applied. You can also define a scale range to indicate where this filter is valid.

When SLD styling information is available, LuciadFusion can use this information to determine at which scales features should be visible. LuciadFusion will use the filters defined in the SLD file to determine which features should be present at a certain level, and which features can be removed. This avoids that you have to manually configure which features must appear at a certain scale (see next section).

Another major benefit of using SLD is that the styling information (colors, line widths, ... ) is automatically picked up by LuciadFusion as well:

  • By default, a TLfnGXYVectorLayer will respect the SLD styling.
  • By default, a TLspFusionVectorLayerBuilder will pick up the SLD styling.
  • The WMS server will respect the SLD styling by default and serve styled data to the clients.

See getFeatureTypeStyles() for more information.

Manual filter configuration

You can define TLcdOGCFilter instances and associate them with a certain scale. Features which are accepted by such a filter will become visible at that scale, and remain visible when zooming in further. See the getFilters() method for more information.

Since:
11.0
See Also:
  • Method Details

    • getDataModel

      public TLcdDataModel getDataModel()
      Deprecated.

      Gets the data model of this coverage.

      The data model structure is an anonymous data model containing zero or more named data models. The named data models depend only on the core data model and each other. Only the following primitive types from the core data model are supported:

      • String
      • Integer
      • Short
      • Double
      • Boolean
      • Long
      • Byte
      • Float

      The name of a contained data model is coverage-id:original-name, where the original name corresponds to the name of the asset data model. Based on this convention, data types in the asset data model can be mapped to data types in the coverage data model during fusion. The data type names in the corresponding data models should be the same.

      Each data type used in an asset of the coverage must be present in the coverage data model. The coverage data type must have a subset of the properties of the original data type. This subset may be empty or complete.

      OGC filter is not supported for this property.

      Returns:
      the data model, possibly empty but never null
    • getMaxLevel

      public int getMaxLevel()
      Deprecated.

      Gets the number maximum level of this coverage, which is never negative. The maximum level is the most detailed level, while level 0 is the least detailed level.

      LuciadFusion will generate tiles for levels 0 until the maximum level (inclusive).

      OGC filter property XPath: lts:MaxLevel

      Returns:
      the max level
    • isForceLinearInterpolation

      public boolean isForceLinearInterpolation()
      Deprecated.

      Returns true when linear interpolation is used, even if the data indicates otherwise. When false, the interpolation is:

      • based on the shape's interpolation type (through ILcdCurve.getInterpolation() when available)
      • based on the model's geographic reference otherwise

      Enable this option when you have data described in a geodetic reference but that should be processed as straight lines. This is typically the case for Shape files (*.shp).

      The default value is false.

      Returns:
      whether forcing linear interpolation is enabled or not
      Since:
      2013.0
    • getLineSimplificationFactor

      public double getLineSimplificationFactor()
      Deprecated.

      Returns the line simplification factor. This factor determines the number of points which are removed from a line at a certain scale. By default, line simplification is disabled.

      When enabled, this will progressively reduce the number of points on less-detailed levels for polylines and polygon outlines. The algorithm (Douglas-Peucker line simplification algorithm) makes sure there is almost no visible difference when viewing the simplified geometry at its corresponding scale.

      The effect of the simplification is shown in the figure below: the original geometry is located on the left, the simplified geometry on the right. Notice that while many points have been removed, this is not noticeable at the intended viewing scale (outlined in red).

      Line simplification: original geometry on the left, simplified geometry on the right

      The amount of points that gets removed is determined by this line simplification factor:

      • 0.0 : disables the line simplification completely
      • < 1.0 : less simplification
      • 1.0 : built-in default simplification factor
      • > 1.0 : more simplification
      Returns:
      the line simplification factor
      Since:
      2013.0
    • getAreaSimplificationFactor

      public double getAreaSimplificationFactor()
      Deprecated.

      Returns the area simplification factor. This factor determines the size of feature parts which are removed from an area at a certain scale. By default, area simplification is disabled.

      When enabled, this will automatically discard parts of features or entire features if the area of the geometry is below a certain threshold. The threshold is such that discarded parts would be smaller than a few pixels when view at the corresponding scale. Such a discarded part could be an "island", but it could just be as well a "hole" in a larger polygon.

      The effect of the simplification is shown in the figure below: all geometry is located on the left, the filtered geometry on the right. Notice that while many holes have been removed, this is not noticeable at the intended viewing scale (outlined in red).

      Area simplification: all geometries on the left, filtered geometries on the right

      The threshold to remove or retain an area is determined by this area simplification factor:

      • 0.0 : disables the area simplification completely
      • < 1.0 : less simplification
      • 1.0 : built-in default simplification factor
      • > 1.0 : more simplification

      Filtering features on area can be useful to keep your dataset scalable and uncluttered when zoomed out. This filtering is done on area-size. More elaborate filtering can be done using OGC filters (see getFilters()).

      This functionality can be used when you have features varying in size, or features with many parts that vary in size. A good example are country borders, which often combine small islands, large islands and mainland into one feature. When zoomed out, the islands can be omitted.

      Warning: this functionality should not be used when
      • The dataset contains adjacent features that form one logical whole. For example, roads are often modeled as a sequence of separate small lines where each small line is an individual feature. Filtering out such features would result in holes in the road.
      • The size of the geometry is not related to the importance of the feature. For example, you need certain small features to be visible when other larger features may be discarded.
      Returns:
      the area simplification factor
      Since:
      2013.0
    • getFilters

      public Map<Integer,TLcdOGCFilter> getFilters()
      Deprecated.

      Returns the OGC filters and the scale denominator to which they apply. This map determines which features are filtered out and which are retained at each scale. By default, none of the features are filtered out. It is however strongly recommended to add filters. Consult the class javadoc for more information about feature filtering.

      The filters in the map describe what features you want to keep until the corresponding scale. Features which pass the filter will be visible at that scale and for all more zoomed-in scales. Features that do not match any filter will be kept throughout the whole coverage.

      For example, if you have a roads dataset, you can define two filters:

    • A filter for the highways at scale 1:1000 000 . This will ensure that the highways become visible at that scale and for all more "zoomed-in" scales.
    • A filter for the secondary roads at scale 1:50 000 . This will ensure that the secondary roads appear only at more zoomed-in scales then the highways, avoiding cluttering of the view.
    • During the fusion process, the fusion engine will store at each discrete level which features should be present, and in which form. For example when line simplification is enabled, certain points could be removed from a line at certain levels. Each of those levels corresponds to a certain scale.

      Note: it is strongly recommended to use SLD to filter and style your data instead of this method. Consult the class javadoc and the javadoc of getFeatureTypeStyles() for more information.

      Returns:
      a snapshot of the filters, ordered by scale denominator, possibly empty but never null
      Since:
      2013.0
      See Also:
    • getFeatureTypeStyles

      public List<TLcdSLDFeatureTypeStyle> getFeatureTypeStyles()
      Deprecated.

      Gets the SLD feature type styles to be used for the visualization of this coverage. The SLD feature type styles are possibly empty, but never null. The default is an empty list.

      As explained in the class javadoc, the TLcdSLDFeatureTypeStyle instances returned by this method will be used:

      • During the fusion process to determine which features should be retained and which ones can be discarded at each level. At this point only the filter info of the TLcdSLDFeatureTypeStyle will be used. Styling information will be ignored.
      • When visualizing the coverage, the default layers will ensure that the data is visualized as it is defined in the TLcdSLDFeatureTypeStyle.

      This will ensure that the data on the client side is visualized exactly as defined in the SLD information, and avoid that a tile contains too much features.

      Overrides:
      getFeatureTypeStyles in class ALfnCoverageMetadata
      Returns:
      the SLD feature type styles to be used for the visualization of this coverage, possibly empty but never null
      See Also:
    • accept

      public void accept(ALfnResourceMetadataVisitor aVisitor)
      Deprecated.
      Description copied from class: ALfnResourceMetadata
      Accepts the visitor for visiting this resource. This provides a double-dispatch.
      Specified by:
      accept in class ALfnResourceMetadata
      Parameters:
      aVisitor - the visitor
      See Also:
    • equals

      public boolean equals(Object aObject)
      Deprecated.
      Overrides:
      equals in class ALfnCoverageMetadata
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class ALfnCoverageMetadata
    • asBuilder

      Deprecated.
      Description copied from class: ALfnResourceMetadata
      Creates a new builder from this resource metadata. The builder's fields are initialized to the values of this resource metadata. The builder will build a resource metadata of the same type as this instance.
      Specified by:
      asBuilder in class ALfnCoverageMetadata
      Returns:
      a new builder
    • asBuilder

      Deprecated.
      Description copied from class: ALfnCoverageMetadata
      Creates a new builder from this coverage metadata using a given resolver. If not null, the resolver is used to resolve asset metadata when computing a coverage's auto-defaults. See ALfnCoverageMetadata.Builder for the uses of a resolver.
      Specified by:
      asBuilder in class ALfnCoverageMetadata
      Parameters:
      aResolver - a resolver to resolve the asset metadata for computing auto-defaults, which may be null
      Returns:
      this builder
    • newBuilder

      public static TLfnVectorCoverageMetadata.Builder newBuilder()
      Deprecated.
      Creates a new, empty builder. The builder's fields are initialized to the default values.
      Returns:
      a new builder
      See Also:
    • newBuilder

      Deprecated.
      Creates a new, empty builder with a given resolver. If not null, the resolver is used to resolve asset IDs to their asset metadata when computing a coverage's auto-defaults. Even if you don't give a resolver, you can still use auto-defaults by passing the asset metadata directly by using ALfnCoverageMetadata.Builder.addAssetInfo(ALfnAssetMetadata, String). See ALfnCoverageMetadata.Builder for the uses of a resolver.
      Parameters:
      aResolver - a resolver to resolve asset IDs to their asset metadata
      Returns:
      a new builder
    • newBuilder

      public static TLfnVectorCoverageMetadata.Builder newBuilder(TLfnVectorCoverageMetadata aTemplate)
      Deprecated.
      Creates a new builder from a template. The builder's properties are initialized from the template.

      The code

      
       TLfnVectorCoverageMetadata.newBuilder(template);
       
      is functionally equivalent to
      
       template.asBuilder();
       

      Parameters:
      aTemplate - a template
      See Also:
    • newBuilder

      Deprecated.
      Creates a new builder from a given template and resolver. If not null, the resolver is used to resolve asset metadata when computing a coverage's auto-defaults. Even if you don't give a resolver, you can still use auto-defaults by passing the asset metadata directly by using ALfnCoverageMetadata.Builder.addAssetInfo(ALfnAssetMetadata, String). See ALfnCoverageMetadata.Builder for the uses of a resolver.

      The code

      
       TLfnVectorCoverageMetadata.newBuilder(template, resolver);
       
      is functionally equivalent to
      
       template.asBuilder(resolver);
       

      Parameters:
      aTemplate - a template, must not be null
      aResolver - a resolver to resolve the asset metadata for computing auto-defaults, which may be null
      Returns:
      this builder
      Since:
      2014.0