Constructor and Description |
---|
ProductUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addElementToHistory(Product product,
MetadataElement elem)
Adds a given elem to the history of the given product.
|
static GeneralPath |
areaToPath(Area negativeArea,
double deltaX) |
static boolean |
areRastersEqualInSize(int width,
int height,
RasterDataNode... rasters)
This method checks whether the given rasters all have the same given width and height.
|
static boolean |
areRastersEqualInSize(Product product,
String... rasterNames)
This method checks whether the rasters given by their names all have the same width and height.
|
static boolean |
areRastersEqualInSize(RasterDataNode... rasters)
This method checks whether the given rasters all have the same width and height.
|
static ArrayList<GeneralPath> |
assemblePathList(GeoPos[] geoPoints) |
static boolean |
canGetPixelPos(Product product)
Returns whether or not a product can return a pixel position from a given geographical position.
|
static boolean |
canGetPixelPos(RasterDataNode raster)
Returns whether or not a raster can return a pixel position from a given geographical position.
|
static double[] |
computeMinMaxY(PixelPos[] pixelPositions)
Computes the minimum and maximum y value of the given
PixelPos array. |
static PixelPos[] |
computeSourcePixelCoordinates(GeoCoding sourceGeoCoding,
int sourceWidth,
int sourceHeight,
GeoCoding destGeoCoding,
Rectangle destArea) |
static Band |
copyBand(String sourceBandName,
Product sourceProduct,
Product targetProduct,
boolean copySourceImage)
Copies the named band from the source product to the target product.
|
static Band |
copyBand(String sourceBandName,
Product sourceProduct,
String targetBandName,
Product targetProduct,
boolean copySourceImage)
Copies the named band from the source product to the target product.
|
static void |
copyBandsForGeomTransform(Product sourceProduct,
Product targetProduct,
boolean includeTiePointGrids,
double defaultNoDataValue,
Map<Band,RasterDataNode> targetToSourceMap)
Adds raster data nodes of a source product as bands to the given target product.
|
static void |
copyBandsForGeomTransform(Product sourceProduct,
Product targetProduct,
double defaultNoDataValue,
Map<Band,RasterDataNode> addedRasterDataNodes)
Copies only the bands from source to target.
|
static void |
copyFlagBands(Product sourceProduct,
Product targetProduct,
boolean copySourceImage)
Copies all bands which contain a flag-coding from the source product to the target product.
|
static FlagCoding |
copyFlagCoding(FlagCoding sourceFlagCoding,
Product target)
Copies the given source flag coding to the target product.
|
static void |
copyFlagCodings(Product source,
Product target)
Copies the flag codings from the source product to the target.
|
static void |
copyGeoCoding(Product sourceProduct,
Product targetProduct)
Copies the geo-coding from the source product to target product.
|
static void |
copyGeoCoding(RasterDataNode sourceRaster,
RasterDataNode targetRaster)
Deeply copies the geo-coding from the source raster data node to the target raster data node.
|
static void |
copyImageGeometry(RasterDataNode sourceRaster,
RasterDataNode targetRaster,
boolean deepCopy)
Copies the geo-coding and image-to-model transformation from the source raster data node to
the target raster data node.
|
static IndexCoding |
copyIndexCoding(IndexCoding sourceIndexCoding,
Product target)
Copies the given source index coding to the target product
If it exists already, the method simply returns the existing instance.
|
static void |
copyIndexCodings(Product source,
Product target)
Copies the index codings from the source product to the target.
|
static void |
copyMasks(Product sourceProduct,
Product targetProduct)
Copies the
Mask s from the source product to the target product. |
static void |
copyMetadata(MetadataElement source,
MetadataElement target)
Copies all metadata elements and attributes of the source element to the target element.
|
static void |
copyMetadata(Product source,
Product target)
Copies all metadata elements and attributes of the source product to the target product.
|
static void |
copyOverlayMasks(Product sourceProduct,
Product targetProduct)
Copies the overlay
Mask s from the source product's raster data nodes to
the target product's raster data nodes. |
static void |
copyPreferredTileSize(Product sourceProduct,
Product targetProduct)
Copies the source product's preferred tile size (if any) to the target product.
|
static void |
copyProductNodes(Product sourceProduct,
Product targetProduct)
Copies all properties from source product to the target product.
|
static void |
copyRasterDataNodeProperties(RasterDataNode sourceRaster,
RasterDataNode targetRaster)
Copies all properties from source band to the target band.
|
static void |
copySpectralBandProperties(Band sourceBand,
Band targetBand)
Copies the spectral properties from source band to target band.
|
static TiePointGrid |
copyTiePointGrid(String gridName,
Product sourceProduct,
Product targetProduct)
Copies the named tie-point grid from the source product to the target product.
|
static void |
copyTiePointGrids(Product sourceProduct,
Product targetProduct)
Copies all tie point grids from one product to another.
|
static void |
copyVectorData(Product sourceProduct,
Product targetProduct) |
static BufferedImage |
createColorIndexedImage(RasterDataNode rasterDataNode,
ProgressMonitor pm)
Creates a greyscale image from the given
. |
static BufferedImage |
createDensityPlotImage(RasterDataNode raster1,
float sampleMin1,
float sampleMax1,
RasterDataNode raster2,
float sampleMin2,
float sampleMax2,
Mask roiMask,
int width,
int height,
Color background,
BufferedImage image,
ProgressMonitor pm)
Creates a density plot image from two raster data nodes.
|
static GeoPos[] |
createGeoBoundary(Product product,
int step)
Creates the geographical boundary of the given product and returns it as a list of geographical coordinates.
|
static GeoPos[] |
createGeoBoundary(Product product,
Rectangle region,
int step)
Creates the geographical boundary of the given region within the given product and returns it as a list of
geographical coordinates.
|
static GeoPos[] |
createGeoBoundary(Product product,
Rectangle region,
int step,
boolean usePixelCenter)
Creates the geographical boundary of the given region within the given product and returns it as a list of
geographical coordinates.
|
static GeoPos[] |
createGeoBoundary(RasterDataNode raster,
Rectangle region,
int step)
Creates the geographical boundary of the given region within the given raster and returns it as a list of
geographical coordinates.
|
static GeneralPath[] |
createGeoBoundaryPaths(Product product)
Converts the geographic boundary entire product into one, two or three shape objects.
|
static GeneralPath[] |
createGeoBoundaryPaths(Product product,
Rectangle region,
int step)
Converts the geographic boundary of the region within the given product into one, two or three shape objects.
|
static GeneralPath[] |
createGeoBoundaryPaths(Product product,
Rectangle region,
int step,
boolean usePixelCenter)
Converts the geographic boundary of the region within the given product into one, two or three shape objects.
|
static GeoTIFFMetadata |
createGeoTIFFMetadata(GeoCoding geoCoding,
int width,
int height) |
static GeoTIFFMetadata |
createGeoTIFFMetadata(Product product) |
static ImageInfo |
createImageInfo(RasterDataNode[] rasters,
boolean assignMissingImageInfos,
ProgressMonitor pm)
Creates image creation information.
|
static PixelPos[] |
createPixelBoundary(Product product,
Rectangle rect,
int step)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static PixelPos[] |
createPixelBoundary(Product product,
Rectangle rect,
int step,
boolean usePixelCenter)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static PixelPos[] |
createPixelBoundary(RasterDataNode raster,
Rectangle rect,
int step)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static PixelPos[] |
createRectBoundary(Rectangle rect,
int step)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static PixelPos[] |
createRectBoundary(Rectangle rect,
int step,
boolean usePixelCenter)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static BufferedImage |
createRgbImage(RasterDataNode[] rasters,
ImageInfo imageInfo,
ProgressMonitor pm)
Creates a RGB image from the given array of
s. |
static void |
denormalizeGeoPolygon(GeoPos[] polygon)
Denormalizes the longitude values which have been normalized using the
normalizeGeoPolygon(GeoPos[]) method. |
static void |
denormalizeGeoPos(GeoPos geoPos)
Denormalizes the longitude value of the given geographical position.
|
static String |
findSuitableQuicklookBandName(Product product)
Finds the name of a band in the given product which is suitable to product a good quicklook.
|
static double |
getAngleSum(GeoPos[] polygon) |
static GeoPos |
getCenterGeoPos(Product product) |
static double |
getGeophysicalSampleAsDouble(RasterDataNode raster,
int pixelX,
int pixelY,
int level)
Gets the geophysical pixel value for the given raster at the given pixel coordinates
for the given image pyramid level.
|
static long |
getGeophysicalSampleAsLong(RasterDataNode raster,
int pixelX,
int pixelY,
int level)
Gets the geophysical pixel value for the given raster at the given pixel coordinates
for the given image pyramid level.
|
static int |
getRotationDirection(GeoPos[] polygon) |
static ProductData.UTC |
getScanLineTime(Product product,
double y) |
static int |
normalizeGeoPolygon(GeoPos[] polygon)
Normalizes the given geographical polygon so that maximum longitude differences between two points are 180
degrees.
|
static BufferedImage |
overlayMasks(RasterDataNode raster,
BufferedImage overlayBIm,
ProgressMonitor pm)
Draws all the masks contained overlay mask group of the given raster to the ovelayBIm image.
|
static String[] |
removeInvalidExpressions(Product product)
Validates all the expressions contained in the given (output) product.
|
public static ImageInfo createImageInfo(RasterDataNode[] rasters, boolean assignMissingImageInfos, ProgressMonitor pm) throws IOException
rasters
- The raster data nodes.assignMissingImageInfos
- if true
, it is ensured that to all RasterDataNode
s a valid ImageInfo
will be assigned.pm
- The progress monitor.IOException
- if an I/O error occurspublic static BufferedImage createRgbImage(RasterDataNode[] rasters, ImageInfo imageInfo, ProgressMonitor pm) throws IOException
RasterDataNode
s.
The given array rasters
containing one or three raster data nodes. If three rasters are given
RGB image is created, if only one raster is provided a gray scale image created.rasters
- an array of one or three raster nodes.imageInfo
- the image info provides the information how to create the imagepm
- a monitor to inform the user about progressIOException
- if the given raster data is not loaded and reload causes an I/O errorRasterDataNode.setImageInfo(ImageInfo)
public static BufferedImage createColorIndexedImage(RasterDataNode rasterDataNode, ProgressMonitor pm) throws IOException
RasterDataNode
.
The method uses the given raster data node's image information (an instance of
) to create the image.ImageInfo
rasterDataNode
- the raster data node, must not be null
pm
- a monitor to inform the user about progressIOException
- if the given raster data is not loaded and reload causes an I/O errorRasterDataNode.getImageInfo()
public static GeoPos[] createGeoBoundary(Product product, int step)
product
- the input product, must not be nullstep
- the step given in pixelsIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullpublic static GeoPos[] createGeoBoundary(Product product, Rectangle region, int step)
This method delegates to createGeoBoundary(Product, Rectangle, int, boolean)
and the additional boolean parameter usePixelCenter
is true
.
product
- the input product, must not be nullregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreatePixelBoundary(RasterDataNode, java.awt.Rectangle, int)
public static GeoPos[] createGeoBoundary(Product product, Rectangle region, int step, boolean usePixelCenter)
product
- the input product, must not be nullregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsusePixelCenter
- true
if the pixel center should be used to create the boundaryIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreatePixelBoundary(Product, java.awt.Rectangle, int, boolean)
public static GeoPos[] createGeoBoundary(RasterDataNode raster, Rectangle region, int step)
raster
- the input raster, must not be nullregion
- the region rectangle in raster pixel coordinates, can be null for entire rasterstep
- the step given in pixelsIllegalArgumentException
- if raster is null or if the raster has no GeoCoding
is nullcreatePixelBoundary(RasterDataNode, java.awt.Rectangle, int)
public static GeneralPath[] createGeoBoundaryPaths(Product product)
The geographic boundary of the given product are returned as shapes comprising (longitude,latitude) pairs.
product
- the input productIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, int)
public static GeneralPath[] createGeoBoundaryPaths(Product product, Rectangle region, int step)
This method delegates to createGeoBoundaryPaths(Product, Rectangle, int, boolean)
and the additional parameter usePixelCenter
is true
.
The geographic boundary of the given product are returned as shapes comprising (longitude,latitude) pairs.
product
- the input productregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, java.awt.Rectangle, int)
public static GeneralPath[] createGeoBoundaryPaths(Product product, Rectangle region, int step, boolean usePixelCenter)
The geographic boundary of the given product are returned as shapes comprising (longitude,latitude) pairs.
product
- the input productregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsusePixelCenter
- true
if the pixel center should be used to create the pathesIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, java.awt.Rectangle, int, boolean)
public static PixelPos[] createPixelBoundary(Product product, Rectangle rect, int step)
rect
is 100 x 50 pixels and step
is 10 the returned array will countain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a product boundary expressed in geographical co-ordinates.
This method delegates to createPixelBoundary(Product, Rectangle, int, boolean)
and the additional boolean parameter usePixelCenter
is true
.
product
- the productrect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arraypublic static PixelPos[] createPixelBoundary(Product product, Rectangle rect, int step, boolean usePixelCenter)
rect
is 100 x 50 pixels and step
is 10 the returned array will countain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a product boundary expressed in geographical co-ordinates.
product
- the productrect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arrayusePixelCenter
- true
if the pixel center should be used to create the boundarypublic static PixelPos[] createPixelBoundary(RasterDataNode raster, Rectangle rect, int step)
rect
is 100 x 50 pixels and step
is 10 the returned array will countain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a raster boundary expressed in geographical co-ordinates.
raster
- the rasterrect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arraypublic static PixelPos[] createRectBoundary(Rectangle rect, int step)
rect
is 100 x 50 pixels and step
is 10 the returned array will countain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a product boundary expressed in geographical co-ordinates.
This method delegates to createRectBoundary(Rectangle, int, boolean)
and the additional boolean parameter usePixelCenter
is true
.
rect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arraypublic static PixelPos[] createRectBoundary(Rectangle rect, int step, boolean usePixelCenter)
rect
is 100 x 50 pixels and step
is 10 the returned array will countain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a product boundary expressed in geographical co-ordinates.
rect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arrayusePixelCenter
- true
if the pixel center should be usedpublic static void copyFlagCodings(Product source, Product target)
source
- the source producttarget
- the target productpublic static FlagCoding copyFlagCoding(FlagCoding sourceFlagCoding, Product target)
sourceFlagCoding
- the source flag codingtarget
- the target productpublic static void copyIndexCodings(Product source, Product target)
source
- the source producttarget
- the target productpublic static IndexCoding copyIndexCoding(IndexCoding sourceIndexCoding, Product target)
sourceIndexCoding
- the source index codingtarget
- the target productpublic static void copyMasks(Product sourceProduct, Product targetProduct)
Mask
s from the source product to the target product.
The method does not copy any image geo-coding/geometry information.
Use the copyImageGeometry(RasterDataNode, RasterDataNode, boolean)
to do so.
IMPORTANT NOTE: This method should only be used, if it is known that all masks in the source product will also be valid in the target product. This method does not copy overlay masks from the source bands to the target bands. Also note that a source mask is not copied to the target product, when there already is a mask in the target product with the same name as the source mask.
sourceProduct
- the source producttargetProduct
- the target productpublic static void copyOverlayMasks(Product sourceProduct, Product targetProduct)
Mask
s from the source product's raster data nodes to
the target product's raster data nodes.
IMPORTANT NOTE: This method should only be used, if it is known that all masks in the source product will also be valid in the target product. This method does not copy overlay masks, which are not contained in the target product's mask group.
sourceProduct
- the source producttargetProduct
- the target productpublic static void copyFlagBands(Product sourceProduct, Product targetProduct, boolean copySourceImage)
sourceProduct
- the source producttargetProduct
- the target productcopySourceImage
- whether the source image of the source band should be copied.public static TiePointGrid copyTiePointGrid(String gridName, Product sourceProduct, Product targetProduct)
The method does not copy any image geo-coding/geometry information.
Use the copyImageGeometry(RasterDataNode, RasterDataNode, boolean)
to do so.
gridName
- the name of the tie-point grid to be copied.sourceProduct
- the source producttargetProduct
- the target productnull
if the sourceProduct does not contain a tie-point grid with the given name.public static Band copyBand(String sourceBandName, Product sourceProduct, Product targetProduct, boolean copySourceImage)
The method does not copy any image geo-coding/geometry information.
Use the copyImageGeometry(RasterDataNode, RasterDataNode, boolean)
to do so.
sourceBandName
- the name of the band to be copied.sourceProduct
- the source product.targetProduct
- the target product.copySourceImage
- whether the source image of the source band should be copied.null
if the sourceProduct does not contain a band with the given name.public static Band copyBand(String sourceBandName, Product sourceProduct, String targetBandName, Product targetProduct, boolean copySourceImage)
The method does not copy any image geo-coding/geometry information.
Use the copyImageGeometry(RasterDataNode, RasterDataNode, boolean)
to do so.
sourceBandName
- the name of the band to be copied.sourceProduct
- the source product.targetBandName
- the name of the band copied.targetProduct
- the target product.copySourceImage
- whether the source image of the source band should be copied.null
if the sourceProduct does not contain a band with the given name.public static void copyRasterDataNodeProperties(RasterDataNode sourceRaster, RasterDataNode targetRaster)
sourceRaster
- the source bandtargetRaster
- the target bandcopySpectralBandProperties(Band, Band)
public static void copySpectralBandProperties(Band sourceBand, Band targetBand)
sourceBand
- the source bandtargetBand
- the target bandcopyRasterDataNodeProperties(RasterDataNode, RasterDataNode)
public static void copyProductNodes(Product sourceProduct, Product targetProduct)
sourceProduct
- the source producttargetProduct
- the target productpublic static void copyGeoCoding(Product sourceProduct, Product targetProduct)
sourceProduct
- the source producttargetProduct
- the target productIllegalArgumentException
- if one of the params is null
.public static void copyGeoCoding(RasterDataNode sourceRaster, RasterDataNode targetRaster)
sourceRaster
- the source raster data nodetargetRaster
- the target raster data nodeIllegalArgumentException
- if one of the params is null
.public static void copyImageGeometry(RasterDataNode sourceRaster, RasterDataNode targetRaster, boolean deepCopy)
sourceRaster
- the source raster data nodetargetRaster
- the target raster data nodedeepCopy
- if true
copyGeoCoding(RasterDataNode, RasterDataNode)
is called, otherwise
the target reference is set.public static void copyTiePointGrids(Product sourceProduct, Product targetProduct)
sourceProduct
- the source producttargetProduct
- the target productpublic static boolean canGetPixelPos(Product product)
product
- the product to be checkedtrue
if the given product can return a pixel positionpublic static boolean canGetPixelPos(RasterDataNode raster)
raster
- the raster to be checkedtrue
if the given raster can return a pixel positionpublic static BufferedImage createDensityPlotImage(RasterDataNode raster1, float sampleMin1, float sampleMax1, RasterDataNode raster2, float sampleMin2, float sampleMax2, Mask roiMask, int width, int height, Color background, BufferedImage image, ProgressMonitor pm) throws IOException
raster1
- the first raster data nodesampleMin1
- the minimum sample value to be considered in the first rastersampleMax1
- the maximum sample value to be considered in the first rasterraster2
- the second raster data nodesampleMin2
- the minimum sample value to be considered in the second rastersampleMax2
- the maximum sample value to be considered in the second rasterroiMask
- an optional mask to be used as a ROI for the computationwidth
- the width of the output imageheight
- the height of the output imagebackground
- the background color of the output imageimage
- an image to be used as output image, if null
a new image is createdpm
- the progress monitorIOException
- when an error occurred.public static BufferedImage overlayMasks(RasterDataNode raster, BufferedImage overlayBIm, ProgressMonitor pm)
raster
- the raster data node which contains all the activated bitmask definitionsoverlayBIm
- the source image which is used as base image for all the overlays.pm
- a monitor to inform the user about progressRasterDataNode.getOverlayMaskGroup()
public static int normalizeGeoPolygon(GeoPos[] polygon)
polygon
- a geographical, closed polygondenormalizeGeoPolygon(GeoPos[])
public static void denormalizeGeoPolygon(GeoPos[] polygon)
normalizeGeoPolygon(GeoPos[])
method. The
method operates only on the longitude values of the given polygon.polygon
- a geographical, closed polygonpublic static void denormalizeGeoPos(GeoPos geoPos)
public static int getRotationDirection(GeoPos[] polygon)
public static double getAngleSum(GeoPos[] polygon)
public static void copyMetadata(Product source, Product target)
source
- the source product.target
- the target product.NullPointerException
- if the source or the target product is null
.public static void copyMetadata(MetadataElement source, MetadataElement target)
source
- the source element.target
- the target element.NullPointerException
- if the source or the target element is null
.public static void copyPreferredTileSize(Product sourceProduct, Product targetProduct)
sourceProduct
- The source product.targetProduct
- The target product.public static GeoTIFFMetadata createGeoTIFFMetadata(Product product)
public static GeoTIFFMetadata createGeoTIFFMetadata(GeoCoding geoCoding, int width, int height)
public static GeneralPath areaToPath(Area negativeArea, double deltaX)
public static void addElementToHistory(Product product, MetadataElement elem)
product
- the product to add the history element.elem
- the element to add to the products history. If null
nothing will be added.public static String[] removeInvalidExpressions(Product product)
product
- the (output) product to be cleaned uppublic static String findSuitableQuicklookBandName(Product product)
product
- the product to be searchedpublic static PixelPos[] computeSourcePixelCoordinates(GeoCoding sourceGeoCoding, int sourceWidth, int sourceHeight, GeoCoding destGeoCoding, Rectangle destArea)
public static double[] computeMinMaxY(PixelPos[] pixelPositions)
PixelPos
array.pixelPositions
- the PixelPos
arrayPixelPos
array in the
order:null
if no minimum or maximum can be retrieved because there given array is
empty.IllegalArgumentException
- if the given pixelPositions are null
.public static void copyBandsForGeomTransform(Product sourceProduct, Product targetProduct, double defaultNoDataValue, Map<Band,RasterDataNode> addedRasterDataNodes)
public static void copyBandsForGeomTransform(Product sourceProduct, Product targetProduct, boolean includeTiePointGrids, double defaultNoDataValue, Map<Band,RasterDataNode> targetToSourceMap)
If
sourceBand.scalingApplied
is true,
this method will always create the related target band with the raw data type ProductData.TYPE_FLOAT32
,
regardless which raw data type the source band has.
In this case, targetBand.scalingFactor
will always be 1.0, targetBand.scalingOffset
will always be 0.0 and
targetBand.log10Scaled
will be taken from the source band.
This ensures that source pixel resampling methods operating on floating point
data can be stored without loss in accuracy in the target band.
Furthermore, the
targetBands.noDataValueSet
and targetBands.noDataValueUsed
properties will always be true for all added target bands. The targetBands.geophysicalNoDataValue
,
will be either the one from the source band, if any, or otherwise the one passed into this method.
sourceProduct
- the source product as the source for the band specifications. Must be not
null
.targetProduct
- the destination product to receive the bands created. Must be not null
.includeTiePointGrids
- if true
, tie-point grids of source product will be included as bands in target productdefaultNoDataValue
- the default, geophysical no-data value to be used if no no-data value is used by the source band.targetToSourceMap
- a mapping from a target band to a source raster data node, can be null
public static ArrayList<GeneralPath> assemblePathList(GeoPos[] geoPoints)
public static ProductData.UTC getScanLineTime(Product product, double y)
public static double getGeophysicalSampleAsDouble(RasterDataNode raster, int pixelX, int pixelY, int level)
raster
- The raster.pixelX
- The pixel X coordinate within the image at the given image pyramid level.pixelY
- The pixel Y coordinate within the image at the given image pyramid level.level
- The image pyramid level.public static long getGeophysicalSampleAsLong(RasterDataNode raster, int pixelX, int pixelY, int level)
raster
- The raster.pixelX
- The pixel X coordinate within the image at the given image pyramid level.pixelY
- The pixel Y coordinate within the image at the given image pyramid level.level
- The image pyramid level.public static boolean areRastersEqualInSize(RasterDataNode... rasters)
rasters
- The rasters to be checked.true
, if all rasters are equal in size.public static boolean areRastersEqualInSize(int width, int height, RasterDataNode... rasters)
width
- The width that all rasters must have.height
- The height that all rasters must have.rasters
- The rasters to be checked.true
, if all rasters are equal in size.public static boolean areRastersEqualInSize(Product product, String... rasterNames) throws IllegalArgumentException
product
- The product which contains the rasters.rasterNames
- The names of the rasters to be checked.true
, if all rasters are equal in size.IllegalArgumentException
Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.