public class TLfnVectorCoverageMetadata extends ALfnCoverageMetadata
A representation of a coverage which contains vector data. It provides the following parameters in addition to those defined in the superclass:
null
, the default value will be used.
false
.
1.0
.
See sections below for details.
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
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.
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:
getLineSimplificationFactor()
for more information.
getAreaSimplificationFactor()
for more information.
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:
TLfnGXYVectorLayer
will respect the SLD styling.TLspFusionVectorLayerBuilder
will pick up the SLD styling.
See getFeatureTypeStyles()
for more information.
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.
ALfnCoverageMetadata
Modifier and Type | Class and Description |
---|---|
static class |
TLfnVectorCoverageMetadata.Builder
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.
|
ALfnCoverageMetadata.AssetInfo
ISO19115_GCO_XML_NAMESPACE, ISO19115_GMD_XML_NAMESPACE, LTS_XML_NAMESPACE, NEW_UPDATE_SEQUENCE, XLINK_XML_NAMESPACE
Modifier and Type | Method and Description |
---|---|
void |
accept(ALfnResourceMetadataVisitor aVisitor)
Deprecated.
Accepts the visitor for visiting this resource.
|
TLfnVectorCoverageMetadata.Builder |
asBuilder()
Deprecated.
Creates a new builder from this resource metadata.
|
TLfnVectorCoverageMetadata.Builder |
asBuilder(ILfnResourceMetadataResolver aResolver)
Deprecated.
Creates a new builder from this coverage metadata using a given resolver.
|
boolean |
equals(Object aObject)
Deprecated.
|
double |
getAreaSimplificationFactor()
Deprecated.
Returns the area simplification factor.
|
TLcdDataModel |
getDataModel()
Deprecated.
Gets the data model of this coverage.
|
List<TLcdSLDFeatureTypeStyle> |
getFeatureTypeStyles()
Deprecated.
Gets the SLD feature type styles to be used for the visualization of this coverage.
|
Map<Integer,TLcdOGCFilter> |
getFilters()
Deprecated.
Returns the OGC filters and the scale denominator to which they apply.
|
double |
getLineSimplificationFactor()
Deprecated.
Returns the line simplification factor.
|
int |
getMaxLevel()
Deprecated.
Gets the number maximum level of this coverage, which is never negative.
|
int |
hashCode()
Deprecated.
|
boolean |
isForceLinearInterpolation()
Deprecated.
Returns
true when linear interpolation is used, even if the data indicates otherwise. |
static TLfnVectorCoverageMetadata.Builder |
newBuilder()
Deprecated.
Creates a new, empty builder.
|
static TLfnVectorCoverageMetadata.Builder |
newBuilder(ILfnResourceMetadataResolver aResolver)
Deprecated.
Creates a new, empty builder with a given resolver.
|
static TLfnVectorCoverageMetadata.Builder |
newBuilder(TLfnVectorCoverageMetadata aTemplate)
Deprecated.
Creates a new builder from a template.
|
static TLfnVectorCoverageMetadata.Builder |
newBuilder(TLfnVectorCoverageMetadata aTemplate,
ILfnResourceMetadataResolver aResolver)
Deprecated.
Creates a new builder from a given template and resolver.
|
getAssetInfos, getBoundingBox, getBounds, getDataDensity, getFormat, getFormatVersion, getGeoReference, getLevel0ColumnCount, getLevel0RowCount, getMessageDigestAlgorithm, getScaleDenominators, getType, isAssetSourcesInTileStore, isIgnoreNonFatalFailures
getAbstract, getGlobalUpdateSequence, getId, getISO19115Metadata, getName, getUpdateSequence, toString
public TLcdDataModel getDataModel()
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.
null
public int getMaxLevel()
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
public boolean isForceLinearInterpolation()
Returns true
when linear interpolation
is used, even if the data indicates otherwise.
When false
, the interpolation is:
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
.
public double getLineSimplificationFactor()
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).
The amount of points that gets removed is determined by this line simplification factor:
0.0
: disables the line simplification completely< 1.0
: less simplification1.0
: built-in default simplification factor> 1.0
: more simplificationpublic double getAreaSimplificationFactor()
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).
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 simplification1.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 whenpublic Map<Integer,TLcdOGCFilter> getFilters()
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:
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.
null
getFeatureTypeStyles()
public List<TLcdSLDFeatureTypeStyle> getFeatureTypeStyles()
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:
TLcdSLDFeatureTypeStyle
will be used.
Styling information will be ignored.
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.
getFeatureTypeStyles
in class ALfnCoverageMetadata
null
getFilters()
public void accept(ALfnResourceMetadataVisitor aVisitor)
ALfnResourceMetadata
accept
in class ALfnResourceMetadata
aVisitor
- the visitorALfnResourceMetadataVisitor
public boolean equals(Object aObject)
equals
in class ALfnCoverageMetadata
public int hashCode()
hashCode
in class ALfnCoverageMetadata
public TLfnVectorCoverageMetadata.Builder asBuilder()
ALfnResourceMetadata
asBuilder
in class ALfnCoverageMetadata
public TLfnVectorCoverageMetadata.Builder asBuilder(ILfnResourceMetadataResolver aResolver)
ALfnCoverageMetadata
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.asBuilder
in class ALfnCoverageMetadata
aResolver
- a resolver to resolve the asset metadata for computing auto-defaults, which may be null
public static TLfnVectorCoverageMetadata.Builder newBuilder()
TLfnVectorCoverageMetadata.Builder
public static TLfnVectorCoverageMetadata.Builder newBuilder(ILfnResourceMetadataResolver aResolver)
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.aResolver
- a resolver to resolve asset IDs to their asset metadatapublic static TLfnVectorCoverageMetadata.Builder newBuilder(TLfnVectorCoverageMetadata aTemplate)
The code
TLfnVectorCoverageMetadata.newBuilder(template);
is functionally equivalent to
template.asBuilder();
aTemplate
- a templateTLfnVectorCoverageMetadata.Builder
public static TLfnVectorCoverageMetadata.Builder newBuilder(TLfnVectorCoverageMetadata aTemplate, ILfnResourceMetadataResolver aResolver)
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);
aTemplate
- a template, must not be null
aResolver
- a resolver to resolve the asset metadata for computing auto-defaults, which may be null