| 1 | = Createimage.py = |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | == Help output == |
| 6 | |
| 7 | usage: createimage.py [-h] [--input <path>] [--output <path>] |
| 8 | [--outputtype <keyword>] [--projection <proj string>] |
| 9 | [--bands <integer> <integer> <integer>] |
| 10 | [--datatype <keyword>] [--matchonly <keyword>] |
| 11 | [--strict] [--mosaic] [--vectors <path>] |
| 12 | [--vectortables <str> [<str> ...]] |
| 13 | [--lidarcolumn <integer>] [--resolution <integer>] |
| 14 | |
| 15 | optional arguments: |
| 16 | -h, --help show this help message and exit |
| 17 | --input <path>, -i <path> |
| 18 | Input filename (GDAL supported filetype, LAS file) or |
| 19 | directory containing suitable files. |
| 20 | --output <path>, -o <path> |
| 21 | Output filename or directory to write the files too. |
| 22 | --outputtype <keyword>, -t <keyword> |
| 23 | String definition for the output image type - follows |
| 24 | gdal conventions. e.g. "GTiff", "JPEG" etc. |
| 25 | --projection <proj string>, -p <proj string> |
| 26 | PROJ4 string describing the projection of the input |
| 27 | data |
| 28 | --bands <integer> <integer> <integer>, -b <integer> <integer> <integer> |
| 29 | 3 bands to use for image creation. |
| 30 | --datatype <keyword>, -d <keyword> |
| 31 | String definition for the output data type - follows |
| 32 | gdal conventions. e.g. "Byte", "Int16" etc. |
| 33 | --matchonly <keyword>, -m <keyword> |
| 34 | Only use matching filenames for given regex, e.g. |
| 35 | ^e.*$ only files starting with e |
| 36 | --strict For strict adhering to importing to correct |
| 37 | projection. |
| 38 | --mosaic To concatenate all input files into a single mosaiced |
| 39 | image |
| 40 | --vectors <path>, -v <path> |
| 41 | Input vector filename (OGR supported filetype) or |
| 42 | directory containing suitable vector files. |
| 43 | --vectortables <str> [<str> ...], -V <str> [<str> ...] |
| 44 | String descriptor of table name(s) to use from the |
| 45 | vector file. |
| 46 | --lidarcolumn <integer>, -l <integer> |
| 47 | Column to use from ARSF-style ASCII lidar files for |
| 48 | import - default is 4 = intensity. Import from LAS |
| 49 | files use this too. |
| 50 | --resolution <integer>, -r <integer> |
| 51 | Resolution of GRASS location to set for output image. |
| 52 | |
| 53 | |
| 54 | == Examples == |
| 55 | |
| 56 | The following are a few examples that the script can be used to process. |
| 57 | |
| 58 | Create 3 band RGB quicklooks (JPEGS) from a directory of raw hyperspectral data: |
| 59 | |
| 60 | {{{ |
| 61 | createimage.py --input hyperspectral/fenix/ --output myjpegs/ |
| 62 | }}} |
| 63 | |
| 64 | Create specified 3 band Tiff images from mapped hyperspectral data: |
| 65 | |
| 66 | {{{ |
| 67 | createimage.py --input processing/hyperspectral/flightlines/georeferencing/mapped/ --output mytiffs/ --outputtype GTiff --bands 100 80 60 |
| 68 | }}} |
| 69 | |
| 70 | |
| 71 | Mosaic mapped Fenix BIL images together and create a 3 band quicklook: |
| 72 | |
| 73 | {{{ |
| 74 | createimage.py --input processing/hyperspectral/flightlines/georeferencing/mapped/ --output myjpegs/ --mosaic --matchonly ^f.*bil$ |
| 75 | }}} |
| 76 | |
| 77 | Do the same overlaying vectors: |
| 78 | |
| 79 | {{{ |
| 80 | createimage.py --input processing/hyperspectral/flightlines/georeferencing/mapped/ --output myjpegs/ --mosaic --matchonly ^f.*bil$ --vectors ../vector_data/ |
| 81 | }}} |
| 82 | |
| 83 | Mosaic LiDAR lines and overlay vectors using only the BoundaryArea vector table |
| 84 | |
| 85 | {{{ |
| 86 | createimage.py --input ascii/ --output quicklooks/ --projection UKBNG --vectors myvectordirectory/ --mosaic --vectortables BoundaryArea |
| 87 | }}} |
| 88 | |