Lab 2

Summarizing land cover and LiDAR surfaces by parcel at a fine scale

Due Feb. 1

1. Again map a drive to \\zoofiles\gradgis. Open Arc Catalog and in it copy the entire Randalstown directory from within NR245 directory. This lab will involve large datasets so I recommend that you copy the data to the temp drive and do your work from there. At the end of the lab, copy the entire directory from the temp directory back to your Zoo account.
2. First we will summarize building heights by building, just to get an idea of how LiDAR data works. The intuitive thing to do is subtract the lidar_bare_r layer from the lidar_first_r layer using raster map algebra. However, there are tiny errors in the data that will result in a bunch of artificial “pits” or pixels with values less than zero. To deal with this we’ll use the raster “conditional” function to essentially set any resulting pixels that would have been less than zero to zero. Con uses the following syntax: CON(if statement, then do statement, else do statement). To access it, open Arc Toolbox and click on Spatial Analyst Tools>>Map Algebra>>Raster Calculator. Make sure to specify the output path to your working directory and call it lidar_diff_r. Your CON function should like something like this:

1. We’ll use this new layer to estimate building height. Load up the buildings_R layer from the Randalstown geodatabase and then use zonal statistics to summarize height by building. However, just like with last lab, you’ll need to create a join field, so open the attribute table, create a new field called “join1” and use the field calculator to set it equal to ObjectID. In toolbox click Spatial Analyst Tools>>Zonal>Zonal statistics as table. Make buildings_R as zone dataset, join1 as the zone field, and choose lidar_diff_r as the value raster. Save the output in your Randalstown folder and call it “bldg.” Open the attribute table for buildings_R and create a new integer field called “height.” Then do a tabular join to join the resulting table to buildings_R. Use the field calculator to set it equal to “bldg.MAX.” Now you can remove joins on that layer. NOTE THAT IF IN THIS ZONAL STATISTICS FUNCTION OR ANY IN THE FUTURE THE TOOL DOES NOT SUCCESSFULLY EXECUTE, JUST GO TO FILE>>NEW AND RE-ADD THE TWO LAYERS YOU NEED FOR THE ZONAL STATISTICS. IT SHOULD WORK THEN

1. Now open Arc Scene and load up buildings_R, Land_Cov_R, and lidar_bare_r. Double click on the Land_Cov_R item in the TOC and go to the base heights tab. Click on the radio button that says ”floating on a custom surface”and choose “lidar_bare_r”. Then go to the rendering tab and check “shade areal features”. The click OK. Then click View>>properties and select a vertical exaggeration of 2. Go to the Illumination tab and change sun altitude to 40 degrees and contrast to 60. Click OK. Now double click on buildings_r in the TOC and under “base heights” click the radio button for “”floating on a custom surface” choosing lidar_bare_R (which it probably already has listed in the text box). Then click the extrusion tab and check the “extrude features in layer check box”. In the Extrusion value window below, click the calculator icon to the right and click on “height.” Under rendering tab check the “shade areal features” box.” In symbology, choose a color that contrasts with the background. Click OK. take a screencapture of what you see in 3D perspective. Note that lidar_bare_r is never checked in the Table of Contents.
2. Now we will estimate the height of the tree canopy. First we’ll create a raster layer giving the height of trees only. This time we’ll use a command call SetNull that does something similar to CON, but specifically when you want to return a null value for some of the pixels. In this case we want to set all pixels without a Land cover code of 2 (trees) to null, so they don’t appear at all. Open the raster calculator and write SetNull([land_cov_r]  <> 2, [lidar_diff_r]). Note that <> means “not equal to.” What this means is, if land cover is not type 2 (trees), then the pixel value is set to null, otherwise to lidar_diff. Call the output Lidar_trees_r. Make a hillshade of the Lidar_tree_r layer in spatial analyst and in the TOC, move the hillshade right below the trees layer. Set the symbology of the lidar_tree_r layer to green graduated color and transparency (under display tab) to 25%. Now, the trees should like nice and textured. Display the textured trees overlaid on parcels and buildings and screencapture the result.
3. Now summarize tree cover percentage and height by parcel. Let’s start by making a raster 1/0 layer showing tree pixels only. In raster calculator type [land_cov_R] == 2. You won’t need this any more after this so you don’t have to make this calculation layer permanent. But you will use it now for zonal statistics. Name the raster calculator output "tree." Then gGo to spatial analyst>>zonal statistics and choose parcels_R as the zone dataset join1 as the zone field, tree as the value raster, check the “join output table box”, uncheck the chart box, and save the output table in your Randalstown folder as tree. Join the resulting table to the parcels_R layer. Open the attribute table for the parcel layer from the TOC then, create a new field set to Double called P_tree . Right click on the P_tree field heading and click the field calculator. Set the new field equal to “tree.MEAN.” Then right click and hit joins>>remove all joins. Next we’ll summarize the tree height by parcel. Again use zonal statistics, only this time choose “lidar_trees_r” as the input raster. Call the output table treeht.dbf. Make two new fields (set to double), one called mean_ht and one called max_ht. Use the field calculator and…you guessed it…calculate the mean_ht field to be equal to treeht.MEAN and the max_ht field to be equal to treeht.MAX. Again, remove all joins. Remove the temporary “trees” 1/0 layer.