Purpose:
Returns information about a Raster or Grid Table. (WMS, Tile Server, and Seamless Raster tables not supported).
Syntax:
RasterTableInfo( table_id, attribute )
table_id is a string representing a table name, a positive integer table number, or 0 (zero). The table must be a raster or grid table.
attribute is an integer code indicating which aspect of the raster table to return.
Return Value
String, SmallInt, Integer or Logical, depending on the attribute parameter specified.
The attribute parameter can be any value from the table below. Codes in the left column (for example, RASTER_TAB_INFO_IMAGE_NAME) are defined in MAPBASIC.DEF.
attribute code | ID | RasterTableInfo() returns |
---|---|---|
RASTER_TAB_INFO_IMAGE_NAME | 1 | String result, representing the image file name associated with this raster table. |
RASTER_TAB_INFO_WIDTH | 2 | Integer result, representing the width of the image, in pixels |
RASTER_TAB_INFO_HEIGHT | 3 | Integer result, representing the height of the image, in pixels |
RASTER_TAB_INFO_IMAGE_TYPE | 4 | SmallInt result, representing the type of image:
|
RASTER_TAB_INFO_BITS_PER_PIXEL | 5 | SmallInt result, representing the number of bits/pixel for the raster data |
RASTER_TAB_INFO_IMAGE_CLASS | 6 | SmallInt result, representing the image class:
|
RASTER_TAB_INFO_NUM_CONTROL_POINTS | 7 | SmallInt result, representing the number of control points. Use the ControlPointInfo() function to get specific control points. |
RASTER_TAB_INFO_BRIGHTNESS | 8 | SmallInt result, representing the brightness as a percentage (0-100%) |
RASTER_TAB_INFO_CONTRAST | 9 | SmallInt result, representing the contrast of the image as a percentage (0-100%) |
RASTER_TAB_INFO_GREYSCALE | 10 | Logical result, representing if the image display should display as greyscale instead of the default image mode |
RASTER_TAB_INFO_DISPLAY_TRANSPARENT | 11 | Logical result, representing if the image should display with a transparent color. If TRUE, RASTER_TAB_INFO_TRANSPARENT_COLOR represents the color that will be made transparent. |
RASTER_TAB_INFO_TRANSPARENT_COLOR | 12 | Integer result, represent the color of the transparent pixels, as BGR. |
RASTER_TAB_INFO_ALPHA | 13 | SmallInt result, representing the alpha factor for the translucency of the image (0-255) |
RASTER_TAB_INFO_HANDLERNAME | 14 | String result, representing the name of the raster and/or grid handler. This is only the handler name without a path. |
RASTER_TAB_INFO_LEGEND | 15 | Logical result, representing whether this image can support a legend. |
RASTER_TAB_INFO_LEGEND_XML | 16 | String result, representing the XML string for the raster legend. This is an empty string if there is no corresponding XML. |
RASTER_TAB_INFO_HANDLERFILLPATH | 17 | String result, representing the full path name of the raster and/or grid handler. |
Examples
This example returns the name of the raster and/or grid handler.
print RasterTableInfo("tablename", 14)
This example returns TRUE if the raster image can support a legend.
print RasterTableInfo("tablename", 15)