FortranGIS
Version2.5
|
This Fortran interface to gdal allows also to perform advanced operations such as retrieving metadata, i.e. a set of key/value pairs which are sometimes embedded in datasets understood by gdal.
The main function for this purpose is GDALGetMetadata, which returns a char**
object; this object should be handled in Fortran by means of the fortranc::c_ptr_ptr derived type, like in the following code snippet:
The object conversion gdalmajorobjecth_new(ds)
is required because GDALGetMetadata requires a generic gdal object of type gdalmajorobjecth which can be either a dataset, a rasterband or a driver object.
The second argument to GDALGetMetadata, CHAR(0)
, indicates an empty string i.e. the default metadata domain.
In order to unpack the meta
object we can use the corresponding methods described in the fortranc module:
RPC stands for rational polynomial coefficients, it is an additional information which can be embedded in raster datasets in order to allow a generic and accurate georeferencing of the dataset.
In order to extract RPC information from a dataset, the procedure is similar to the metadata extraction procedure:
in this case we ask GDALGetMetadata to retrieve the RPC domain rather than the default domain. The result is passed to the GDALExtractRPCInfo function, which, on success, fills the info
object with the relevant RPC fields, thus we can access them as info%line_off
, info%line_num_coeff
(:), etc.
Sample geotiff datasets containing RPC information can be downloaded from the web site of Japanese Aerospace Exploration Agency: http://www.alos-restec.jp/en/staticpages/index.php/service-sampledata-08.