public class NcmlReader
extends java.lang.Object
This is an internal class, users should usually call NetcdfDatasets.openDataset(String)
| Constructor and Description |
|---|
NcmlReader() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getLocationFromNcml(java.lang.String ncml)
Find the location attribute in a NcML string
|
static NetcdfDataset.Builder |
mergeNcml(NetcdfFile ref,
org.jdom2.Element ncmlElem)
Use NCML to modify the referenced dataset, create a new dataset with the merged info Used to wrap each dataset of
an aggregation before its aggregated.
|
static java.util.Set<NetcdfDataset.Enhance> |
parseEnhanceMode(java.lang.String enhanceMode)
Retrieve the set of Enhancements that is associated with the given NcML string.
|
static Array |
readAttributeValues(org.jdom2.Element s)
Parse the values element
|
static NetcdfDataset.Builder |
readNcml(java.io.Reader r,
java.lang.String ncmlLocation,
CancelTask cancelTask)
Read NcML doc from a Reader, and construct a NetcdfDataset.Builder.
|
static NetcdfDataset.Builder |
readNcml(java.lang.String ncmlLocation,
java.lang.String referencedDatasetUri,
CancelTask cancelTask)
Read an NcML file from a URL location, and construct a NetcdfDataset.
|
static void |
setDebugFlags(DebugFlags debugFlag) |
static void |
wrapNcml(NetcdfDataset.Builder ncDataset,
java.lang.String ncmlLocation,
CancelTask cancelTask)
Use NCML to modify the dataset, getting NcML from a URL.
|
static void |
wrapNcmlResource(NetcdfDataset.Builder ncDataset,
java.lang.String ncmlResourceLocation,
CancelTask cancelTask)
Use NCML to modify a dataset, getting the NcML document as a resource stream.
|
public static void setDebugFlags(DebugFlags debugFlag)
public static java.util.Set<NetcdfDataset.Enhance> parseEnhanceMode(java.lang.String enhanceMode)
| String | Enhancements |
|---|---|
| All | ConvertEnums, ConvertUnsigned, ApplyScaleOffset, ConvertMissing, CoordSystems |
| None | <empty> |
| ConvertEnums | ConvertEnums |
| ConvertUnsigned | ConvertUnsigned |
| ApplyScaleOffset | ApplyScaleOffset |
| ConvertMissing | ConvertMissing |
| CoordSystems | CoordSystems |
| IncompleteCoordSystems | CoordSystems |
| true | Alias for "All" |
| ScaleMissingDefer | Alias for "None" |
| AllDefer | ConvertEnums, CoordSystems |
| ScaleMissing | ConvertUnsigned, ApplyScaleOffset, ConvertMissing |
enhanceMode - a string from the above table.enhanceMode, or null if there is no correspondence.public static void wrapNcml(NetcdfDataset.Builder ncDataset, java.lang.String ncmlLocation, CancelTask cancelTask) throws java.io.IOException
ncDataset - modify this datasetncmlLocation - URL location of NcMLcancelTask - allow user to cancel task; may be nulljava.io.IOException - on read errorpublic static void wrapNcmlResource(NetcdfDataset.Builder ncDataset, java.lang.String ncmlResourceLocation, CancelTask cancelTask) throws java.io.IOException
ncDataset - modify this datasetncmlResourceLocation - resource location of NcMLcancelTask - allow user to cancel task; may be nulljava.io.IOException - on read errorpublic static NetcdfDataset.Builder mergeNcml(NetcdfFile ref, @Nullable org.jdom2.Element ncmlElem) throws java.io.IOException
ref - referenced datasetncmlElem - parent element - usually the aggregation element of the ncmljava.io.IOException - on read errorpublic static NetcdfDataset.Builder readNcml(java.io.Reader r, java.lang.String ncmlLocation, CancelTask cancelTask) throws java.io.IOException
NetcdfDatasets.openNcmlDataset(Reader, String, CancelTask)r - the Reader containing the NcML documentncmlLocation - the URL location string of the NcML document, used to resolve relative path of the referenced
dataset,
or may be just a unique name for caching purposes.cancelTask - allow user to cancel the task; may be nulljava.io.IOException - on read error, or bad referencedDatasetUri URIpublic static NetcdfDataset.Builder readNcml(java.lang.String ncmlLocation, java.lang.String referencedDatasetUri, CancelTask cancelTask) throws java.io.IOException
ncmlLocation - the URL location string of the NcML documentreferencedDatasetUri - if null (usual case) get this from NcML, otherwise use URI as the location of the
referenced dataset.cancelTask - allow user to cancel the task; may be nulljava.io.IOException - on read error, or bad referencedDatasetUri URIpublic static java.lang.String getLocationFromNcml(java.lang.String ncml)
ncml - the NcML as a stringpublic static Array readAttributeValues(org.jdom2.Element s) throws java.lang.IllegalArgumentException
s - JDOM element to parsejava.lang.IllegalArgumentException - if string values not parsable to specified data type