Current Multi-Size API (as of 02.10.2015)
...
getImageToModelTransform(GeoCoding)
: CallsGeoCoding.getImageToMapTransform
to check if it is affine, if so, returns it, otherwise returns identity (1). 22 usagesgetModelCrs(GeoCoding)
: CallsGeoCoding.getImageToMapTransform
to check if it is affine, if so, returnsGeoCoding.mapCrs
, otherwiseGeoCoding.imageCrs
. 22 usagesgetMultiLevelModel(RasterDataNode)
: Used to derive a multi-level image model from a raster data node's source image, otherwise callscreateMultiLevelModel
.(2) 26 usagescreateMultiLevelModel(ProductNode)
: Used to create a default multi-level image model. CallsgetImageToModelTransform
, usesProduct.numResolutionsMax
.(2) 9 usagesgetPreferredTileSize(Product)
Gets the preferred tile size of a product or computes a new one. 16 usages
(1) Returning the identity transformation by default is probably wrong in many cases, because then images of any size would return the same transformation into a common model CRS!
...
RasterDataNode API
- A raster data node may return its own
geoCoding
. Either the geo-coding is- the one explicitly set by
RasterDataNode.setGeoCoding(gc)
, or - derived from it's parent product's
Product.sceneGeoCoding
, but only if is has been explicitly set (1), or null.
- the one explicitly set by
- A raster data node must return a tile size RasterDataNode.its own affine i2m-transform (see above)
getImageToModelTransform()
that is used by it's source image or that will be used for any source image as long as it hasn't been created so far. Either the i2m-transform is- retrieved from a source image, or if no such yet exists,
- the one explicitly set by
RasterDataNode.setImageToModelTransform(i2m)
, or - derived from its own
geoCoding
and the parent product'sProduct.modelCrs
, or if this is not possible (2) - an
IllegalStateException
is thrown
- A raster data node must return a
tileSize
that is used by it's source image or that will be used for any source image as long as it hasn't been created so far. Either the tile size is- retrieved from a source image, or if no such yet exists,
- the one explicitely explicitly set by
RasterDataNode.setTileSize(tw,th)
, or - the value of
Product.preferredTileSize
(1) Avoid infinite recursion, see reference raster data node
(2) The transformation from RasterDataNode.geoCoding.imageCrs
to the parent product's Product.modelCrs
must be defined and must be affine.
Facts and Consequences
- Every product instance must have a model CRS. As a consequence, in order to save products in DIMAP- or -NetCDF format, they must be made persistable.
- A scene geo-coding implies a valid scene raster size.
- A model CRS may be derived from the scene geo-coding, see implementation of
ImageManager.getModelCrs(gc)
- A model CRS may be derived from a valid scene image only, if no scene geo-coding is specified.
- All i2m-transforms are affine (linear) transformations.
- The
Product.
addBand(name, ...)
andaddMask(name, ...)
methods must throw anIllegalStateException
if no valid reference raster size is defined. - Note that it is still confusing to API users that we
- use the terms image, raster, pixel, sample in an inconsistent manner in property/method names in
RasterDataNode
and alsoTile
(GPF); - have map, geo and image CRS in the GeoCoding API, but a model CRS in the Product API (four CRS!). Luckily, API users usually don't deal with that too much.
- use the terms image, raster, pixel, sample in an inconsistent manner in property/method names in
...