Version 2 (modified by mark1, 10 years ago) (diff)

--

Createimage.py

This page documents some usage cases for the createimage.py script. This uses the grass_library.py and GDAL library to do image format transformations, mosaicing and overlaying of vectors, and bring all the functions into line with each other. It is used in the routine and operational ARSF processing scripts and libraries. It can be imported as a library if desired.

Help output

usage: createimage.py [-h] [--input <path>] [--output <path>]

[--outputtype <keyword>] [--projection <proj string>] [--bands <integer> <integer> <integer>] [--datatype <keyword>] [--matchonly <keyword>] [--strict] [--mosaic] [--vectors <path>] [--vectortables <str> [<str> ...]] [--lidarcolumn <integer>] [--resolution <integer>]

optional arguments:

-h, --help show this help message and exit --input <path>, -i <path>

Input filename (GDAL supported filetype, LAS file) or directory containing suitable files.

--output <path>, -o <path>

Output filename or directory to write the files too.

--outputtype <keyword>, -t <keyword>

String definition for the output image type - follows gdal conventions. e.g. "GTiff", "JPEG" etc.

--projection <proj string>, -p <proj string>

PROJ4 string describing the projection of the input data

--bands <integer> <integer> <integer>, -b <integer> <integer> <integer>

3 bands to use for image creation.

--datatype <keyword>, -d <keyword>

String definition for the output data type - follows gdal conventions. e.g. "Byte", "Int16" etc.

--matchonly <keyword>, -m <keyword>

Only use matching filenames for given regex, e.g. ^e.*$ only files starting with e

--strict For strict adhering to importing to correct

projection.

--mosaic To concatenate all input files into a single mosaiced

image

--vectors <path>, -v <path>

Input vector filename (OGR supported filetype) or directory containing suitable vector files.

--vectortables <str> [<str> ...], -V <str> [<str> ...]

String descriptor of table name(s) to use from the vector file.

--lidarcolumn <integer>, -l <integer>

Column to use from ARSF-style ASCII lidar files for import - default is 4 = intensity. Import from LAS files use this too.

--resolution <integer>, -r <integer>

Resolution of GRASS location to set for output image.

Examples

The following are a few examples that the script can be used to process.

Create 3 band RGB quicklooks (JPEGS) from a directory of raw hyperspectral data:

createimage.py --input hyperspectral/fenix/ --output myjpegs/

Create specified 3 band Tiff images from mapped hyperspectral data:

createimage.py --input processing/hyperspectral/flightlines/georeferencing/mapped/ --output  mytiffs/ --outputtype GTiff --bands 100 80 60

Mosaic mapped Fenix BIL images together and create a 3 band quicklook:

createimage.py --input processing/hyperspectral/flightlines/georeferencing/mapped/ --output myjpegs/ --mosaic --matchonly ^f.*bil$

Do the same overlaying vectors:

createimage.py --input processing/hyperspectral/flightlines/georeferencing/mapped/ --output myjpegs/ --mosaic --matchonly ^f.*bil$ --vectors ../vector_data/

Mosaic LiDAR lines and overlay vectors using only the BoundaryArea vector table

createimage.py --input ascii/ --output quicklooks/ --projection UKBNG --vectors myvectordirectory/ --mosaic --vectortables BoundaryArea