@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdDTEDDirectoryModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
File | Required | Entry point | Description |
---|---|---|---|
dted/[we]???/[sn]??.dt[012] | x | x | DTED files containing elevations |
ILcd2DBoundsIndexedModel
.TLcdDMEDModelDescriptor
.ILcdGeodeticReference
as a model reference.supportGeoidDatums
is set to
true
, the more accurate geoid datum EGM96. Alternatively,
if applyGeoidDatums
is set to true
, the geoid
height is already added to the elevations of the rasters, and the
geodetic datum is WGS84.ALcdImage
(and ILcdMultilevelRaster
) instance.
The object by default contains DTED levels 0, 1, and 2.ILcdRaster
instances that correspond
to DTED levels in turn contain TLcdDTEDTile
s that
correspond to DTED cells and that point to additional information about
the cells (only if checkTilesImmediately
is
true
and for cells that are present).ALcdImage
interface. Legacy rasters are assumed to
be area-sampled.bounds
and auto-detect bounds
properties can be used to adjust the decoded region.checkTilesImmediately
property allows to specify whether
the presence of the DTED cells should be checked right away when the
model is decoded. If so, only DTED levels that are present will be
created. Otherwise, all levels will be created, even though their
contents may be empty when the elevation data are accessed.fallBackOnHigherResolution
property is set to
true
). If that fails, the raster will try to find a
corresponding lower resolution DTED file (unless the
fallBackOnLowerResolution
property is set to
false
).level0Extension
allows to specify which
extension should be used for DTED level 0.
dted/e001/n52.dt0
dted/e001/n53.dt0
dted/e000/n52.dt0
dted/e000/n53.dt0
dted/w001/n52.dt0
dted/w001/n53.dt0
This data set can be decoded with:
TLcdDTEDDirectoryModelDecoder decoder =
new TLcdDTEDDirectoryModelDecoder(TLcdSharedBuffer.getBufferInstance(),
new TLcdLonLatBounds(-1.0, 52.0, 3.0, 2.0));
ILcdModel model = decoder.decode("dted");
minLevel
and maxLevel
properly can help avoiding unnecessarily looking for DTED cells at
levels that are not available.checkTilesImmediately
to
true
may slow down the initial decoding, especially if many
cells have to be accessed across a slow network connection.fallBackOnHigherResolution
to
true
may introduce a significant overhead, since higher
resolution cells are considerably larger than the lower resolution
counterparts that they are replacing.checkTilesImmediately
is set to
true
.TLcdDMEDModelDecoder
,
TLcdDTEDModelDecoder
Modifier and Type | Field and Description |
---|---|
static int |
AVERAGE
The sampling strategy that returns the average value of the corners of
each DTED sample cell.
|
static int |
BILINEAR
The sampling strategy that returns a bilinear interpolation of the values
of the corners of each DTED sample cell.
|
static String |
DEFAULT_DISPLAY_NAME |
static String |
DEFAULT_EXTENSION |
static int |
MAXIMUM
The sampling strategy that returns the maximum value of the corners of
each DTED sample cell.
|
static int |
MINIMUM
The sampling strategy that returns the minimum value of the corners of
each DTED sample cell.
|
static int |
NORTH_EAST_CORNER
The sampling strategy that returns the North-East corner of each DTED
sample cell.
|
static int |
NORTH_WEST_CORNER
The sampling strategy that returns the North-West corner of each DTED
sample cell.
|
static String |
SHADING_DISPLAY_NAME |
static int |
SOUTH_EAST_CORNER
The sampling strategy that returns the South-East corner of each DTED
sample cell.
|
static int |
SOUTH_WEST_CORNER
The sampling strategy that returns the South-West corner of each DTED
sample cell.
|
Constructor and Description |
---|
TLcdDTEDDirectoryModelDecoder()
Creates a model decoder to decode directories containing DTED files
spanning the entire globe, with a globally shared
buffer for caching tiles.
|
TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer)
Creates a model decoder to decode directories containing DTED files
spanning the entire globe.
|
TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer,
boolean aShading)
Creates a model decoder to decode directories containing DTED files
spanning the entire globe, optionally producing shaded rasters instead
of elevation rasters.
|
TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer,
ILcdBounds aBounds)
Creates a model decoder to decode directories containing DTED files.
|
TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer,
ILcdBounds aBounds,
boolean aShading)
Creates a model decoder to decode directories containing DTED files,
optionally producing shaded rasters instead of elevation rasters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data by decoding the DTED files found
in the given directory.
|
TLcdModelMetadata |
decodeModelMetadata(String aSourceName)
Decodes metadata for the specified DTED directory.
|
ILcdBounds |
getBounds()
Returns the region of data that is decoded.
|
ColorModel |
getColorModel()
Returns the color model that is attached to decoded
ILcdRaster 's. |
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used for creating input streams
given source names.
|
String |
getLevel0Extension() |
int |
getMaxLevel() |
int |
getMinLevel() |
int |
getSampleStrategy() |
boolean |
isApplyGeoidDatums() |
boolean |
isAutoDetectBounds()
Returns whether the data bounds are automatically detected or not.
|
boolean |
isCheckTilesImmediately() |
boolean |
isFallBackOnHigherResolution() |
boolean |
isFallBackOnLowerResolution() |
boolean |
isSupportGeoidDatums() |
void |
setApplyGeoidDatums(boolean aApplyGeoidDatums)
Specifies whether the geoid heights of the geodetic datum (EGM96) should
be added to the elevation data right away while decoding.
|
void |
setAutoDetectBounds(boolean aAutoDetectBounds)
Enables or disables auto-detection of the data bounds.
|
void |
setBounds(ILcdBounds aBounds)
Sets the bounds of the DTED raster to be decoded.
|
void |
setCheckTilesImmediately(boolean aCheckTilesImmediately)
Specifies whether the DTED tiles should be checked immediately or lazily.
|
void |
setColorModel(ColorModel aColorModel)
Sets the color model that is attached to decoded
ILcdRaster 's. |
void |
setFallBackOnHigherResolution(boolean aFallBackOnHigherResolution)
Specifies whether to fall back on higher resolution DTED files if a file
at some level cannot be found.
|
void |
setFallBackOnLowerResolution(boolean aFallBackOnLowerResolution)
Specifies whether to fall back on lower resolution DTED files if a file
at some level cannot be found.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for creating input streams
given source names.
|
void |
setLevel0Extension(String aLevel0Extension)
Sets the extension for DTED level 0 files.
|
void |
setMaxLevel(int aMaxLevel)
Sets the maximum DTED level that is decoded.
|
void |
setMinLevel(int aMinLevel)
Sets the minimum DTED level that is decoded.
|
void |
setSampleStrategy(int aSampleStrategy)
Sets the sampling strategy for retrieving elevation values.
|
void |
setSupportGeoidDatums(boolean aSupportGeoidDatums)
Specifies whether the decoded geodetic datum of the geodetic reference
should be a geoid datum (EGM96), instead of the default ellipsoid datum
(WGS84 or WGS72).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeSource, discoverDataSources
public static final String DEFAULT_DISPLAY_NAME
public static final String SHADING_DISPLAY_NAME
public static final String DEFAULT_EXTENSION
public static final int NORTH_WEST_CORNER
public static final int SOUTH_WEST_CORNER
public static final int NORTH_EAST_CORNER
public static final int SOUTH_EAST_CORNER
public static final int MINIMUM
public static final int MAXIMUM
public static final int AVERAGE
public static final int BILINEAR
public TLcdDTEDDirectoryModelDecoder()
TLcdSharedBuffer.getBufferInstance()
public TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer)
aBuffer
- the buffer in which decoded raster tiles are cached.public TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer, ILcdBounds aBounds)
aBuffer
- the buffer in which decoded raster tiles are cached.aBounds
- the bounds within which DTED files are considered.public TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer, boolean aShading)
aBuffer
- the buffer in which decoded raster tiles are cached.aShading
- specifies whether rasters should be shaded.public TLcdDTEDDirectoryModelDecoder(ILcdBuffer aBuffer, ILcdBounds aBounds, boolean aShading)
aBuffer
- the buffer in which decoded raster tiles are cached.aBounds
- the bounds within which DTED files are considered.aShading
- specifies whether rasters should be shaded.public void setBounds(ILcdBounds aBounds)
bounds auto-detection
is enabled.aBounds
- the region to decodesetAutoDetectBounds(boolean)
public ILcdBounds getBounds()
setBounds(com.luciad.shape.ILcdBounds)
public void setAutoDetectBounds(boolean aAutoDetectBounds)
getBounds()
.
Typically auto-detection of bounds only succeeds if the source name is:
aAutoDetectBounds
- true
if the bounds should be auto-detectedpublic boolean isAutoDetectBounds()
true
if the data bounds are automatically detectedsetAutoDetectBounds(boolean)
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public void setColorModel(ColorModel aColorModel)
ILcdRaster
's.aColorModel
- a 16-bit IndexColorModelpublic ColorModel getColorModel()
ILcdRaster
's.public void setMinLevel(int aMinLevel)
public int getMinLevel()
public void setMaxLevel(int aMaxLevel)
public int getMaxLevel()
public void setCheckTilesImmediately(boolean aCheckTilesImmediately)
If true
, the decoded multi-level rasters will only contain the
DTED levels that are actually present. In addition, the tiles will be
instances of TLcdDTEDTile
, which contain instances of
TLcdDTEDModelDescriptor
. If any DTED files cannot be found,
the tiles may fall back on higher or lower levels.
If false
, the decoded multi-level rasters will contain all
DTED levels (0, 1, and 2). If any DTED files cannot be found later on,
when elevation data are actually requested, the tiles may still fall back
on higher or lower levels.
The default is false
.
public boolean isCheckTilesImmediately()
public void setFallBackOnHigherResolution(boolean aFallBackOnHigherResolution)
false
.public boolean isFallBackOnHigherResolution()
public void setFallBackOnLowerResolution(boolean aFallBackOnLowerResolution)
true
.public boolean isFallBackOnLowerResolution()
public void setLevel0Extension(String aLevel0Extension)
setSampleStrategy(int)
public String getLevel0Extension()
public void setSampleStrategy(int aSampleStrategy)
ILcdRaster
API. The ALcdImage
API explicitly models
DTED data as being point-sampled and will ignore this setting.aSampleStrategy
- one of
NORTH_WEST_CORNER
,
SOUTH_WEST_CORNER
,
NORTH_EAST_CORNER
,
SOUTH_EAST_CORNER
,
MINIMUM
,
MAXIMUM
,
AVERAGE
, or
BILINEAR
.public int getSampleStrategy()
public void setSupportGeoidDatums(boolean aSupportGeoidDatums)
public boolean isSupportGeoidDatums()
public void setApplyGeoidDatums(boolean aApplyGeoidDatums)
This is an alternative to setSupportGeoidDatums(boolean)
. It
has precedence if both options are set.
Note that the 0m elevation (sea level) becomes the geoid height, which may be confusing when a raster is displayed with an elevation color model that assigns blue colors to negative elevations.
public boolean isApplyGeoidDatums()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
ILcdModelDecoder
true
for a source name while decode
throws an exception for that same source name.
For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified; typically a file name or a URL.true
if the given path name ends with a directory
named "dted".ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
decode
in interface ILcdModelDecoder
aSourceName
- the path to the main "dted" directory.
For example, "ElevationData/dted" may be a valid source
name.IOException
- for any I/O errors.ILcdModelDecoder.canDecodeSource(String)
public TLcdModelMetadata decodeModelMetadata(String aSourceName) throws IOException
TLcdModelMetadata.discoverDataSeries()
, without triggering any additional I/O.
Note that this method directly accesses the file system, instead of using the decoder's inputstream factory.
This also means that the method will fail for sources that are not located on the file system,
such as sources served over HTTP.decodeModelMetadata
in interface ILcdModelDecoder
aSourceName
- the DTED directory for which the model metadata will be decoded.IOException
- if the metadata cannot be decoded for some reason.ILcdModelDecoder.canDecodeSource(String)