| 1 | === Q: How do I convert between LAS and ASCII file formats? === |
| 2 | |
| 3 | To convert between LAS and ASCII formats use the free `las2txt` and `txt2las` available as part of LAStools available to download from: https://github.com/LAStools/LAStools (note: download also contains paid for tools not required for conversion). Binaries are provided for Windows. For Linux and OS X you need to compile using the included 'Makefile' |
| 4 | |
| 5 | ==== LAS to ASCII ==== |
| 6 | |
| 7 | To export as 9 column ASCII files, as delivered by ARSF between 2011 and 2015 use the following command: |
| 8 | |
| 9 | {{{ |
| 10 | las2txt -parse txyzicrna -sep space -i in_las.las -o out_ascii.txt |
| 11 | }}} |
| 12 | |
| 13 | If you need to export in the 8 column format used by ARSF between 2009 and 2010 use the following command instead: |
| 14 | |
| 15 | {{{ |
| 16 | las2txt -parse txyzicrna -sep space -i in_las.las -o out_ascii.txt |
| 17 | }}} |
| 18 | |
| 19 | For more details on available options see the [https://github.com/LAStools/LAStools/blob/master/bin/las2txt_README.txt las2txt README] |
| 20 | |
| 21 | ==== ASCII to LAS ==== |
| 22 | |
| 23 | To convert the 9 column ASCII files as delivered by ARSF between 2011 and 2015 to LAS format use the following command: |
| 24 | |
| 25 | {{{ |
| 26 | txt2las -iparse txyzicrna -i in_ascii.txt -o out_las.las |
| 27 | }}} |
| 28 | |
| 29 | To convert the 8 column format used by ARSF between 2009 and 2010 use the following command instead: |
| 30 | |
| 31 | {{{ |
| 32 | txt2las -iparse txyzicra -i in_ascii.txt -o out_las.las |
| 33 | }}} |
| 34 | |
| 35 | To reduce the file size you can change the extension of the output file to '.laz' to save as LASzip files. These can be read by a number of packages and easily converted back to uncompressed LAS files using [https://github.com/LAStools/LAStools/blob/master/bin/laszip_README.txt laszip]. |
| 36 | |
| 37 | If you are accessing ARSF archive data LAStools are available on [http://jasmin.ac.uk/ JASMIN] and can be loaded using: |
| 38 | |
| 39 | {{{ |
| 40 | module load contrib/arsf/lastools/20150925 |
| 41 | }}} |
| 42 | |
| 43 | Allowing data to be converted to LAS/LAZ format before downloading. |
| 44 | |
| 45 | [wiki:FAQ Back to FAQ] |