public class TLcdRasterModelHeightProviderFactory extends ALcdRasterModelHeightProviderFactory
Important notice: the package com.luciad.imaging
presents a new API
for the modeling of raster data. For new projects, it is recommended to use
this API instead of ILcdRaster
et al.
ILcdHeightProvider
when an
ILcdModel
is given that only contains elements of the type
ILcdRaster
or ILcdMultilevelRaster
.
A class that requires a height provider based on a raster model could construct one as follows:
// Create a height provider factory.
ILcdModelHeightProviderFactory factory = new TLcdRasterModelHeightProviderFactory();
// Specify the desired properties for the height provider.
Map<String, Object> requiredProperties = new HashMap<String, Object>();
requiredProperties.put(ALcdModelHeightProviderFactory.KEY_GEO_REFERENCE, aModelReference);
Map<String, Object> optionalProperties = new HashMap<String, Object>();
optionalProperties.put(TLcdRasterModelHeightProviderFactory.KEY_PIXEL_DENSITY, 2.5);
// Create a height provider from a raster model.
ILcdHeightProvider heightProvider =
factory.createHeightProvider(aModel, requiredProperties, optionalProperties);
For many cases it is sufficient to add the ILcdModelHeightProviderFactory.KEY_GEO_REFERENCE
property. Not setting this property will generate an exception in most cases. When using a
ILcdHeightProvider
constructed with a specific ILcdGeoReference
as
required property, one can retrieve height using ILcdPoint
s that are defined in this
reference. For example, if the reference is a TLcdGeodeticReference
, the points passed to
ILcdHeightProvider.retrieveHeightAt(ILcdPoint)
should be TLcdLonLatPoint
s.
If the reference is a TLcdGridReference
, the points passed to it should be
TLcdXYPoints
.
An other property that can be passed is for example ALcdRasterModelHeightProviderFactory.KEY_PIXEL_DENSITY
. This property
determines which raster is chosen from a multi level raster based on a pixel density. In most
cases, this property should be passed as an optional property since not all height providers
factories can interpret it.
KEY_INTERPOLATE_DATA, KEY_MAX_VALID_HEIGHT, KEY_MIN_VALID_HEIGHT, KEY_PIXEL_DENSITY
KEY_GEO_REFERENCE
Constructor and Description |
---|
TLcdRasterModelHeightProviderFactory()
Constructs a new
TLcdRasterModelHeightProviderFactory . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canCreateHeightProvider(ILcdModel aModel)
Check if a height provider can be created from the given
ILcdModel . |
protected ILcdHeightProvider |
createModelElementHeightProvider(Object aElement,
Map<String,Object> aRequiredPropertiesSFCT,
Map<String,Object> aOptionalProperties)
Creates an
ILcdHeightProvider for the given model element. |
transformProperties
createHeightProvider
public TLcdRasterModelHeightProviderFactory()
TLcdRasterModelHeightProviderFactory
.protected ILcdHeightProvider createModelElementHeightProvider(Object aElement, Map<String,Object> aRequiredPropertiesSFCT, Map<String,Object> aOptionalProperties) throws TLcdMissingPropertyException, TLcdUnsupportedPropertyException
ALcdModelHeightProviderFactory
ILcdHeightProvider
for the given model element.createModelElementHeightProvider
in class ALcdRasterModelHeightProviderFactory
aElement
- a model element.aRequiredPropertiesSFCT
- the required properties.aOptionalProperties
- the optional properties.ILcdHeightProvider
for the given model element or null
if no ILcdHeightProvider
can be created.TLcdMissingPropertyException
- when a property is missing that is necessary to
create the ILcdHeightProvider
.TLcdUnsupportedPropertyException
- when a required property was never used while
creating the ILcdHeightProvider
.protected boolean canCreateHeightProvider(ILcdModel aModel)
ALcdRasterModelHeightProviderFactory
ILcdModel
. The default
implementation only returns true
if the model contains a TLcdRasterModelDescriptor
or a TLcdMultilevelRasterModelDescriptor
, and false
otherwise.canCreateHeightProvider
in class ALcdRasterModelHeightProviderFactory
aModel
- the given model.true
if a height provider can be created from the given model and
false
otherwise.