Package org.esa.snap.core.dataio.dimap
Class DimapProductHelpers
java.lang.Object
org.esa.snap.core.dataio.dimap.DimapProductHelpers
This class defines some static methods used to create and access BEAM DIMAP XML documents.
- Version:
- $Revision$ $Date$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConverts a given BEAMunitinto a DIMAP conform unit.static StringConverts a given DIMAPunitinto a BEAM conform unit.static ColorcreateColor(org.jdom2.Element colorElem) static FileFilterCreates aFileFilterfor BEAM-DIMAP files.static org.jdom2.DocumentcreateDom(InputStream inputStream) Creates a parsedDocumentfrom the giveninputStream.static GeoCoding[]createGeoCoding(org.jdom2.Document dom, Product product) static ProductcreateProduct(org.jdom2.Document dom, String defaultProductType, Dimension regionRasterSize) Creates a in-memory data product represenation from the given DOM (BEAM-DIMAP format).static StringgetBandDataFiles(org.jdom2.Document dom, Product product, File inputDir) Extract aStringobject from the given dom which points to the data for the band with the given name.static org.opengis.referencing.crs.CoordinateReferenceSystemgetCRS(org.jdom2.Document dom) static StringgetTiePointDataFile(org.jdom2.Document dom, String tiePointGridName) Extract aStringobject from the given dom which points to the data for the tie point grid with the given name.static intgetTiePointDataType(org.jdom2.Element rootElement, String tiePointGridName) static voidprintColorTag(int indent, Color color, XmlWriter pw) static voidprintColorTag(int indent, String tag, Color color, XmlWriter pw)
-
Constructor Details
-
DimapProductHelpers
public DimapProductHelpers()
-
-
Method Details
-
createProduct
public static Product createProduct(org.jdom2.Document dom, String defaultProductType, Dimension regionRasterSize) Creates a in-memory data product represenation from the given DOM (BEAM-DIMAP format).- Parameters:
dom- the DOM in BEAM-DIMAP formatdefaultProductType- the product typeregionRasterSize- the region size to be displayed- Returns:
- an in-memory data product represenation
-
getBandDataFiles
public static Map<Band,File> getBandDataFiles(org.jdom2.Document dom, Product product, File inputDir) throws IllegalArgumentException Extract aStringobject from the given dom which points to the data for the band with the given name.- Parameters:
dom- the JDOM in BEAM-DIMAP formatproduct- the product to retrieve the data files forinputDir- the directory where to search for the data files- Returns:
- a
Mapobject which contains all the band data references from the given jDom.
Returns an emptyMapif the jDom does not contain band data files - Throws:
IllegalArgumentException- if one of the parameters is null.
-
getTiePointDataFile
public static String getTiePointDataFile(org.jdom2.Document dom, String tiePointGridName) throws IllegalArgumentException Extract aStringobject from the given dom which points to the data for the tie point grid with the given name.- Parameters:
dom- the DOM in BEAM-DIMAP formattiePointGridName- the name of the tie point grid- Returns:
- the
Stringobject which points to the data for the tie point grid. - Throws:
IllegalArgumentException- if the parameter dom is null or the parameter tiePointGridName is null or empty
-
printColorTag
-
printColorTag
-
createColor
-
createGeoCoding
public static GeoCoding[] createGeoCoding(org.jdom2.Document dom, Product product) throws IOException - Throws:
IOException
-
getTiePointDataType
-
createDimapFileFilter
Creates aFileFilterfor BEAM-DIMAP files.- Returns:
- a FileFilter for use with a
JFileChooser
-
createDom
Creates a parsedDocumentfrom the giveninputStream.- Parameters:
inputStream- the stream to be parsed- Returns:
- a parsed inputStream
-
convertBeamUnitToDimapUnit
Converts a given BEAMunitinto a DIMAP conform unit.- Parameters:
unit- a BEAM unit- Returns:
- the converted unit
- See Also:
-
convertDimapUnitToBeamUnit
Converts a given DIMAPunitinto a BEAM conform unit.- Parameters:
unit- a DIMAP unit- Returns:
- the converted unit
- See Also:
-
getCRS
public static org.opengis.referencing.crs.CoordinateReferenceSystem getCRS(org.jdom2.Document dom) -
escapeXml
-