Package noaa.coastwatch.io
Class OpendapReader
java.lang.Object
noaa.coastwatch.io.EarthDataReader
noaa.coastwatch.io.OpendapReader
- Direct Known Subclasses:
CWOpendapReader
The
OpendapReader
class is the base class for readers that
use the OPeNDAP API to read data and metadata.- Since:
- 3.2.1
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionprotected opendap.dap.DConnect2
The data connection.protected opendap.dap.DAS
The data attribute tables.protected opendap.dap.DDS
The data descriptor object.Fields inherited from class noaa.coastwatch.io.EarthDataReader
dataProjection, info, rawMetadataMap, variables
-
Constructor Summary
ModifierConstructorDescriptionprotected
OpendapReader
(String url) Creates a new reader using the specified URL. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the reader.protected static Map
getAttributeMap
(opendap.dap.AttributeTable table, Map map) Creates a map of attributes and values from an attribute table.protected static Class
getPrimitiveClassType
(opendap.dap.BaseType base) Gets the primitive Java class type for the specified OPeNDAP base type.protected static boolean
isUnsigned
(opendap.dap.BaseType base) Returns true if the OPeNDAP primitive type is unsigned.static void
Tests this class.Methods inherited from class noaa.coastwatch.io.EarthDataReader
canUpdateNavigation, containsVariable, finalize, getAllGrids, getAllVariables, getChunkProducer, getCoordinateSystems, getDataFormat, getIndex, getInfo, getName, getPreview, getPreview, getPreviewImpl, getRawMetadata, getRawMetadata, getSceneTime, getSource, getStatistics, getStatisticsVariables, getVariable, getVariable, getVariables, getVariablesForSystem, putStatistics, setDataProjection, setUnitsMap, updateNavigation
-
Field Details
-
connect
protected opendap.dap.DConnect2 connectThe data connection. -
das
protected opendap.dap.DAS dasThe data attribute tables. -
dds
protected opendap.dap.DDS ddsThe data descriptor object.
-
-
Constructor Details
-
OpendapReader
Creates a new reader using the specified URL.- Parameters:
url
- the network location.- Throws:
IOException
- if the an error occurred accessing the dataset.
-
-
Method Details
-
getAttributeMap
Creates a map of attributes and values from an attribute table. This makes it easier to use the attributes as they are given appropriate Java datatype values rather than string values. Any numeric values are converted to primitive arrays.- Parameters:
table
- the attribute table to read.map
- the map to add attribute values to, or null to create a new map.- Returns:
- the map of attribute names to values.
- Throws:
IOException
- if an error occurred converting an attribute value to a numeric type.
-
getPrimitiveClassType
Gets the primitive Java class type for the specified OPeNDAP base type.- Parameters:
base
- the OPeNDAP base type.- Returns:
- the Java primitive class or null if the base type cannot be represented with a Java primitive.
-
isUnsigned
protected static boolean isUnsigned(opendap.dap.BaseType base) Returns true if the OPeNDAP primitive type is unsigned. -
close
Closes the reader.- Specified by:
close
in classEarthDataReader
- Throws:
IOException
- if the data source had I/O errors.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-