ISCE delegates raster data handling to the Geospatial Data Abstraction Library (GDAL). Hence, it uses all the conventions defined by the GDAL data model to simplify the interface. You will find detailed documentation of all the methods available here: isce3::io::Raster.
In general, one only needs to include the isce3::io::Raster headerfile.
If one is looking to create Rasters as part of your workflow, include appropriate the main GDAL header file. This will provide access to pre-defined data types and enum variables.
If one is looking to use advanecd features from GDAL, you might need additional appropriate header files.
Raster imagery that already exists can be opened in Read-Only mode in a simple manner with just a string with the filename to be used.
All the GDAL environment variables and driver settings are respected. One should also be able to access remotely located resources using vsicurl / vsis3 etc. One can also use standard GDAL interfaces to access raster imagery within NETCDF and HDF5 by treating them as subdatasets (see here for details on NETCDF and HDF5). For a complete list of supported formats in your GDAL build , refer to output of
An existing GDAL-compatible raster can be opened in Update mode in ISCE as follows
The most general interface to creation of rasters is exposed via isce3::io::Raster(const std::string& fname, size_t width, size_t length, size_t numBands, GDALDataType dtype, const std::string& driverName).
See the full range of isce3::io::Raster constructors available for options. Note that you will need to include gdal.h to use GDAL type definitions.
NISAR mission will produce Level 1 and Level 2 products in HDF5 format. However, GDAL does not include HDF5 creation support. ISCE provides two different interfaces to work with HDF5 files. Since, GDAL does not include HDF5 creation support
ISCE includes an easy to use HDF5 interface using isce3::io namespace, that can be used to create/ manipulate HDF5 groups and datasets. The documentation for the following classes are useful to understand HDF5 manipulation at the C++ level:
The IH5 classes are extensively documented and we refer users to browse the documentation for alternate interfaces that might suit their use case. In general, the following set of rules are useful to remember:
Once access to HDF5 datasets has been setup using the IH5 interface discussed above, users can create an isce3::io::Raster object from it as shown below:
Rasters created using IH5 interface are equivalent to any other GDAL Dataset and same interface can be used to populate / read data from these Rasters. isce3::io::IDataSet::toGDAL generates a string that is interpreted by GDAL's custom IH5 driver, in a manner very similar to GDAL's inbuilt MEM driver.
Note that all pixels are indexed by the Top-Left corner (see Raster Overview). One can read the data into a buffer of a type different from the storage format, as GDAL will handle the type translation.
We use isce3::io::Raster::getValue to read a pixel value from Band 2 of the raster image in this example. If band number is not provided, it is assumed to be 1.
Similarly, isce3::io::Raster::setValue can be used to set a pixel value.
ISCE Raster object can currently interact with 3 types of containers - a raw buffer (no size checks), std::vector and std::valarray. One can use any of the 3 interfaces with the isce3::io::Raster::getLine and isce3::io::Raster::setLine methods.
Like single line I/O, one can use any of the 3 interfaces (pointer, vector, valarray) with the isce3::io::Raster::getBlock and isce3::io::Raster::setBlock methods. Note that all data is read in from or to a contiguous bufferin row major order. Currently, there is no interface to read/write from a blocked interface. If one wishes to do this see the section on advanced usage below to work with the GDAL Dataset pointer directly.
ISCE Raster class is a thin wrapper over GDAL's GDALDataset class. One can access the underlying pointer using the isce3::io::Raster::dataset method.