-
IMGASCII: Export from IMG raster files to ASCII format
Direct access to online help: IMGASCII
Access the application from the menu: "File | Export | IMG -> TXT (ASCII)"
Presentation and options
This application generates an ASCII text file from a MiraMon raster format file: img+i.rel in version 4 or img+doc in previous versions.
The format of the file produced by this program may be:
Values only:
The sequence of values corresponding to each pixel in the input raster, written from the pixels read from left to right and from top to bottom.
Coordinates and values:
The sequence: X_coordinate Y_coordinate value carriage_return corresponding to each pixel center in the input raster. The order is the same as for option 1.
It is also possible to define at the start of the file a small header with the extent and the pixel size or a header with all the information contained in the documentation file i.rel or doc.
When the raster contains real values it is possible to specify the number of decimal places to be written using the parameter /N_DEC_VAL=. For the case where the coordinates are to be exported it is also possible to define, using the parameter /N_DEC_POS=, the number of decimal places to be used when writing the coordinates. If necessary, when these parameters are defined, the program will use the number of decimal places defined by the DigitsDecimals= key of the [MiraMon] section of the MiraMon.par configuration file.
NOTE: To import the ASCII format generated as a sequence of values (option 1), use the ASCIIIMG application. However, to import the format that includes coordinates (option 2), use the BDGeomet application, which generates a point file that must then be rasterized using the TiraVec application.

Dialog box of the application

Syntax
Syntax:
- IMGASCII 1 InputFile OutputFile [/N_DEC_VAL] [/N_DEC_POS] [/CAPCALERA] [/NODATA_FORCAT] [/SEPARADOR_COMA] [/SEPARA_TABULADOR] [/ASPECTE_MATRIU] [/ASPECTE_COLUMNA_UNICA] [/AFEGIR_COLUMNA]
- IMGASCII 2 InputFile OutputFile [/N_DEC_VAL] [/N_DEC_POS] [/CAPCALERA] [/NODATA_FORCAT] [/SEPARA_TABULADOR]
Options:
- 1:
[Values ...]
- 2:
[X_Coordinate Y_Coordinate Raster_value ...]
Parameters:
- InputFile
(Input File -
Input parameter): Is the IMG file to be exported.
- OutputFile
(Output file -
Output parameter): Is the output ASCII file. If an extension is desired this must be specified.
Modifiers:
/SEPARADOR_COMA
(Comma decimal separator)
Replaces the decimal point with a comma in the values written (useful, for example, for Spanish versions of SPSS). It does not apply to the header. (Input parameter) /ASPECTE_MATRIU
(Matrix layout)
Values are written in rows (separated by line breaks) and columns (separated by a space or a tab), mimicking the raster matrix. By default (without /ASPECTE_MATRIU or /ASPECTE_COLUMNA_UNICA) all values are written in a single row separated by a space. Not compatible with /ASPECTE_COLUMNA_UNICA or /AFEGIR_COLUMNA. (Input parameter) /ASPECTE_COLUMNA_UNICA
(Single-column layout)
Values are written in a single column (one value per line) instead of a single row separated by spaces. Not compatible with /ASPECTE_MATRIU. (Input parameter) /AFEGIR_COLUMNA
(Append column)
If the output file already exists, a new column with the values of this raster is appended to it. Columns are separated by a space or, if /SEPARA_TABULADOR is given, by a tab. /ASPECTE_COLUMNA_UNICA must also be given, and it is only compatible with /CAPCALERA=0. (Input parameter) /N_DEC_VAL= (Decimal places) Defines the number of decimal places for the raster values when these are real data. The default value is defined by the DigitsDecimals= key of the [MiraMon] section of the MiraMon.par configuration file. (Input parameter) /N_DEC_POS= (Coordinates decimal places) Defines the number of decimal places for the coordinates when this needs to be defined. The default value is defined by the DigitsDecimals= key of the [MiraMon] section of the MiraMon.par configuration file. (Input parameter) /CAPCALERA= (Header) - 0 if no header is exported (default).
- 1 if the extent of the input raster (bounding box and pixel size) is exported to the output file.
- 2 if all documentation from the input raster is exported.
- 3 allows IMG rasters to be exported to the ASCII format compatible with ArcView, ArcCatalog, and ArcMap.
(Input parameter) /NODATA_FORCAT= (Forced NODATA) Value written to cells without data instead of the NoData value of the input raster; for example, -9999 when -3.4E+38 is not supported by the target software. The value is written literally and the requested number of decimal places is not applied; if decimals are wanted, write them (for example /NODATA_FORCAT=-1.0). Only applies if the input raster has a NoData value defined. (Input parameter) /SEPARA_TABULADOR (Tab separator) Separates the columns of the output file with a tab instead of a space, where applicable. (Input parameter)
