| 1 | == Creation of DEMs from LIDAR point clouds == |
| 2 | |
| 3 | This guide assumes you have a LIDAR dataset comprising a number of files containing LIDAR lines of the following format: |
| 4 | {{{ |
| 5 | 217755.001130 30563577.97 4513423.12 1293.23 178 30563577.96 4513423.12 1293.28 178 |
| 6 | time(gps?)(last pulse) ZZeasting northing height(m) pulse_time? (first pulse) ZZeasting northing height(m) pulse_time? |
| 7 | }}} |
| 8 | |
| 9 | 1. Merge files and strip off unnecessary UTM zone number by running trim_lidar.sh in the directory containing the lidar files: |
| 10 | Usage: trim_lidar.sh output_file |
| 11 | |
| 12 | 2. Generate a histogram for the lidar data to determine min/max reasonable data values by running lidar_histogram.py: |
| 13 | Usage: python lidar_histogram.py input_file |
| 14 | |
| 15 | This generates a 5x log histogram (ie it's a histogram of the base-10 log of the lidar values binned into 10m bins, multiplied by 5 to scale). If there are a small number of low or high values in the histogram then decide on a scaling cutoff. eg: |
| 16 | |
| 17 | {{{ |
| 18 | 20: |
| 19 | 40: ################# |
| 20 | 50: ############################# |
| 21 | 60: ############################# |
| 22 | 70: ############################## |
| 23 | 80: ############################## |
| 24 | 90: ############################### |
| 25 | 100: ############################### |
| 26 | 110: ############################### |
| 27 | 120: ################################ |
| 28 | 130: ################################ |
| 29 | 140: ############################### |
| 30 | 150: ############################# |
| 31 | 160: ############################ |
| 32 | 170: ############################ |
| 33 | 180: ########################### |
| 34 | 190: ########################### |
| 35 | 200: ########################## |
| 36 | 210: ####################### |
| 37 | 220: ################### |
| 38 | 230: ############## |
| 39 | 590: ##### |
| 40 | 600: ###### |
| 41 | 610: ###### |
| 42 | 620: #### |
| 43 | }}} |
| 44 | |
| 45 | In the given example, there are a very few values between 20-30m at the bottom end, and a big gap at the top end before a small number of values above 590m (nothing between 240m and 590m). So it would be sensible to pick 30m as a minimum cutoff and 250m as a maximum. |
| 46 | |
| 47 | 3. Open GRASS, select (or create) an appropriate UTM/WGS84 location and set the region appropriately for the dataset - easiest way is to look at the start of the trimmed lidar data file for the starting co-ordinates of the first line, set an approximate region from there, view the map in GRASS and then adjust the region appropriately. |
| 48 | |
| 49 | 4. Read in the trimmed lidar file using r.in.xyz: |
| 50 | {{{ |
| 51 | r.in.xyz input=<trimmed_lidar_file> output=<lidar_basemap> x=2 y=3 z=4 fs=" " zrange=<min_cutoff>,<max_cutoff> |
| 52 | }}} |
| 53 | |
| 54 | 5. Interpolate gaps in the map using r.fillnulls: |
| 55 | {{{ |
| 56 | r.fillnulls input=<lidar_basemap> output=<lidar_interp_map> |
| 57 | }}} |
| 58 | |
| 59 | 6. Generate an ASCII DEM as per [wiki:Processing/NextMapDEMs Creation of DEMs from NextMap data]: |
| 60 | {{{ |
| 61 | r.out.ascii input=<lidar_interp_map> output=lidar.dem null=0 |
| 62 | }}} |