int tsmParseCreateParams ( char *image_name, TsmTileParams *tile, TsmTspecParams *tspec ) Try to extract info about an input image
Try to extract info about an input image.This function can be used to try and extract as much information about an image that is available in the image file itself, or in any standard associated files. The information that is extracted is written directly into the provided TsmTileParams and/or TsmTspecParams structures (which can then be passed to the tsmCreateTspec or tsmCreate*Tiles functions). This can be used to make life easier for the client by reducing the amount of work they need to do.
The actual information that can be extract is obviously dependent on how much information is provided by a particular file format:
- LAS : LAS files are raw data and contain no descriptions of these data. Such descriptions are contained in the DDR file. The DDR file is a binary file, so the folks at EDC (USGS Eros Data Center) produce an ASCII version of this file with a ".prt" extension. tsmParseCreateParams will therefore try to find a .prt file associated with the specified image. If found, it will try to parse this and set all relevant fields. Currently, this includes the width and height of the image, the number of components per pixel (bands), and the UTM lower-left coordinate and zone number. The function will fail if the .prt file defines the projection type as anything other than UTM, or of the .prt file does not exist.
- PGM / PPM : The image formats contain a short header at the start of the file that define the pixel width and height for the image. This information is extracted, and also the number of components per pixel is set to 1 for PGM files (as these are grayscale).
- TIFF / GEOTIFF : TIFF images contain all of the information that we need to know about the image raster, e.g. width, height, number of components, etc. In addition, if a GeoTIFF file is used, then we can extract the georeference information.
N.B. you should call tsmInitTileParams and tsmInitTspecParams for the tile and tspec structures, respectively, before calling this function.