Package com.luciad.format.raster
Class TLcdETOPOModelDecoder
java.lang.Object
com.luciad.format.raster.TLcdETOPOModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=20000)
public class TLcdETOPOModelDecoder
extends Object
implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes the raw ETOPO1, ETOPO2, ETOPO2v2, and ETOPO5 data
sets. These data sets contain bathymetric and topographic rasters for the
entire world, at 1-minute, 2-minute, and 5-minute resolutions, respectively.
They can be downloaded from the
National Geophysical Data Center
(NGDC) at their
Global Relief
pages.
By default, the
Geoid offsets can be supported in two ways:
Input files
File | Required | Entry point | Description |
---|---|---|---|
etopo1_ice_c_i2.bin etopo1_bed_c_i2.bin |
x | x | Global Gridded 1-minute Database |
ETOPO2v2c_i2_MSB.bin ETOPO2v2_MSB.raw ETOPO2.raw.bin |
x | x | Global Gridded 2-minute Database |
ETOPO5.DAT | x | Global Gridded 5-minute Database |
Supported file transfer protocols
- This model decoder supports all transfer protocols that are supported by
the
inputStreamFactory
of this decoder.
Model reference
The model reference is WGS84 with a EGM96 geoid datum.Geoid support
The elevation values in the ETOPO data sets are measured as elevation above mean sea level (AMSL). This means that the elevations are offsets with respect to the geoid, the equipotential surface that coincides the mean ocean surface of the Earth.By default, the
TLcdETOPOModelDecoder
decodes the data as AMSL, but it can be configured to not apply the geoid and
instead interpret the data as above ellipsoid. This can be done for performance reasons
since integrating geoid offsets can consume a considerable amount of memory and CPU time.Geoid offsets can be supported in two ways:
Apply geoid datums
: This setting will cause the decoder to return a model with the ellipsoid as vertical datum, but the returned data will have the geoid offsets incorporated. In other words, elevations are returned as above ellipsoid, but have been corrected with the geoid offset.Support geoid datums
: This setting will cause the decoder to return a model with the EGM-96 geoid model as vertical datum. If set totrue
, Elevation data is returned as above mean sea level.
Model structure
- This model decoder creates a model per ETOPO file.
- All models returned by this model decoder implement
ILcd2DBoundsIndexedModel
.
Model descriptor
- All models returned by this model decoder have a
TLcdETOPOModelDescriptor
. - The type name of the model descriptor is the display name of this decoder.
Model elements
- Each decoded model contains one object: an
ALcdImage
(andILcdRaster
) instance. - Decoded grid-centered data is always point-sampled. This is however only
exposed via the
ALcdImage
interface. Legacy rasters are assumed to be area-sampled.
Useful settings
- The property
colorModel
allows to override the default 16-bits index color that is attached to the decoded rasters, since ETOPO files don't contain any color information.
Sample code
TLcdETOPOModelDecoder decoder = new TLcdETOPOModelDecoder();
ILcdColorModelFactory factory = new TLcdDTEDColorModelFactory();
ColorModel colorModel = factory.createColorModel();
decoder.setColorModel(colorModel);
ILcdModel model = decoder.decode("etopo1_ice_c_i2.bin");
Performance tips
- Since ETOPO rasters only provide a single level of detail, precomputing
and storing multiple levels of detail may speed up visualization and
some computations. For instance, the
TLcdGeoTIFFModelEncoder
can create compressed multilevel GeoTIFF files that can replace the original ETOPO files.
Thread safety
- The decoding of models is thread-safe, as long as no properties are changed during the decoding.
- The decoded models and elements are thread-safe for read access, on the condition that a thread-safe buffer is used.
Supported versions and specifications
- [ETOPO1] Amante, C. and B. W. Eakins, ETOPO1 1 Arc-Minute Global Relief Model: Procedures, Data Sources and Analysis. NOAA Technical Memorandum NESDIS NGDC-24, 19 pp, March 2009.
- [ETOPO2] ETOPO2v2 Global Gridded 2-minute Database, National Geophysical Data Center, National Oceanic and Atmospheric Administration, U.S. Dept. of Commerce, 2006.
- [ETOPO5] ETOPO5 Global Gridded 5-minute Database, National Geophysical Data Center, National Oceanic and Atmospheric Administration, U.S. Dept. of Commerce, 1993-2005.
Known limitations
- Only the big endian 2-byte integer (i2_MSB) databases are supported.
- Since:
- 6.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The display name of this decoder.static final String
The ETOPO1 cell-registered (with bedrock surface underneath ice) file name.static final String
The ETOPO1 grid-registered (with bedrock surface underneath ice) file name.static final String
The ETOPO1 cell-registered (with ice surface) file name.static final String
The ETOPO1 grid-registered (with ice surface) file name.static final String
The ETOPO2 file name.static final String
The ETOPO2 version 2 (MSB) file name.static final String
The ETOPO2 version 2 (cell-registered, MSB) file name.static final String
The ETOPO2 version 2 (grid-registered, MSB) file name.static final String
The ETOPO5 file name. -
Constructor Summary
ConstructorDescriptionCreates a new TLcdETOPOModelDecoder with a globally shared buffer for caching tiles.TLcdETOPOModelDecoder
(ILcdBuffer aBuffer) Creates a new TLcdETOPOModelDecoder with the given shared buffer. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns the color model that is attached to decoded rasters.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Returns the input stream factory that is used for creating input streams given source names.boolean
Determines if geoid datum correction is applied during decoding or not.boolean
Determines if geoid datum is supported or not.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
setColorModel
(ColorModel aColorModel) Sets the color model that is attached to decoded rasters.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that will be used for creating input streams given source names.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).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
DEFAULT_DISPLAY_NAME
The display name of this decoder.- See Also:
-
ETOPO1_ICE_C_NAME
The ETOPO1 cell-registered (with ice surface) file name.- See Also:
-
ETOPO1_BED_C_NAME
The ETOPO1 cell-registered (with bedrock surface underneath ice) file name.- See Also:
-
ETOPO1_ICE_G_NAME
The ETOPO1 grid-registered (with ice surface) file name.- See Also:
-
ETOPO1_BED_G_NAME
The ETOPO1 grid-registered (with bedrock surface underneath ice) file name.- See Also:
-
ETOPO2v2c_NAME
The ETOPO2 version 2 (cell-registered, MSB) file name.- See Also:
-
ETOPO2v2g_NAME
The ETOPO2 version 2 (grid-registered, MSB) file name.- See Also:
-
ETOPO2v2_NAME
The ETOPO2 version 2 (MSB) file name.- See Also:
-
ETOPO2_NAME
The ETOPO2 file name.- See Also:
-
ETOPO5_NAME
The ETOPO5 file name.- See Also:
-
-
Constructor Details
-
TLcdETOPOModelDecoder
public TLcdETOPOModelDecoder()Creates a new TLcdETOPOModelDecoder with a globally shared buffer for caching tiles.- See Also:
-
TLcdETOPOModelDecoder
Creates a new TLcdETOPOModelDecoder with the given shared buffer.
-
-
Method Details
-
setInputStreamFactory
Sets the input stream factory that will be used for creating input streams given source names.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used.
-
getInputStreamFactory
Returns the input stream factory that is used for creating input streams given source names.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the input stream factory that is used.
-
setColorModel
Sets the color model that is attached to decoded rasters.- Parameters:
aColorModel
- a 16-bit IndexColorModel.
-
getColorModel
Returns the color model that is attached to decoded rasters. -
setSupportGeoidDatums
public 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). The geoid varies smoothly between -110m and +90m around the ellipsoid. The geoid datum is more accurate, but it requires more memory and more processing time when it is being used in transformation calculations.More information on elevation handling can be found in the geoid section of the class documentation.
-
isSupportGeoidDatums
public boolean isSupportGeoidDatums()Determines if geoid datum is supported or not. The default value istrue
.- Returns:
true
if geoid datum is supported;false
otherwise- See Also:
-
setApplyGeoidDatums
public 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. The geoid varies smoothly between -110m and +90m around the ellipsoid. The geodetic datum of the geodetic reference will then be be an ordinary ellipsoid datum (WGS84). Decoded rasters will be more accurate, but the operation requires more memory and more processing time while decoding the elevation data (which is still done lazily).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.
More information on elevation handling can be found in the geoid section of the class documentation
-
isApplyGeoidDatums
public boolean isApplyGeoidDatums()Determines if geoid datum correction is applied during decoding or not.- Returns:
- true if geoid datum correction is applied during decoding; false otherwise
- See Also:
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
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.
- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be verified; typically a file name or a URL.- Returns:
true
if the given source name is "etopo1_ice_c_i2.bin", "etopo1_bed_c_i2.bin", "ETOPO2v2c_i2_MSB.bin", "ETOPO2v2_MSB.raw", "ETOPO2.raw.bin", or "ETOPO5.DAT".- See Also:
-
decode
Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
null
is allowed, implementors are advised to throw an error instead. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.public ILcdModel decode( String aSourceName ) throws IOException { try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) { // Perform decoding ... } catch (RuntimeException e) { throw new IOException(e); } }
- See Also:
-