Exercise 8: Creating and using a terrain dataset
A terrain dataset is a multiresolution TIN-based surface derived from measurements stored in one or more feature classes in a geodatabase.
In this exercise, you will use geoprocessing tools to load surface data into a geodatabase, construct a terrain dataset, and use the terrain inside ArcMap and ArcGlobe.
Loading surface feature data into a geodatabase
In this scenario, you have lidar points and photogrammetric breaklines stored in two separate ASCII text files. This data will be used to construct your terrain dataset. To accomplish this, you need to import them into feature classes that reside in a feature dataset. The terrain will be generated in the same location as the source data.
You've been provided with a file geodatabase with a feature dataset. It contains two polygon feature classes: one is for lakes, the other to delineate the study area. The initial step will be to import the two ASCII files into the feature dataset as feature classes: one feature class will delineate the photogrammetric breaklines, while the other feature class will contain the lidar points.
- Start ArcCatalog by clicking Start > All Programs > ArcGIS > ArcCatalog 10.
Click Customize > Extensions.
The Extensions dialog box opens.
- In the Catalog Tree, navigate to the Exercise8 folder and double-click terrain.gdb to open the geodatabase.
- Double-click the topography feature dataset.
- In the Catalog Tree, navigate to the 3D Analyst toolbox by expanding Toolboxes > System Toolboxes > 3D Analyst Tools.
- Expand the Conversion toolset, then From File tools, then double-click the ASCII 3D to Feature Class tool.
- In the ASCII 3D to Feature Class tool, make sure the Browse for drop-down list is set to Files.
- Click the Browse button next to the Input field, navigate to the Exercise8 folder, and choose the masspoints.xyz file as input.
- Make sure Input File Format is set to XYZ.
- Click the Browse button for the Output Feature Class and navigate to the topography feature dataset.
- If it is not done already, set the Output Feature Class Type to MULTIPOINT.
- Type inside the text box for Average Point Spacing and set the value to 10.
- Accept all other defaults and click OK to execute the geoprocessing tool.
- Double-click ASCII 3D to Feature Class to open the geoprocessing tool.
- Make sure the Browse for drop-down list is set to Files.
- Click the Browse button and choose the breaklines.lin file as input.
- Set the Input File Format to GENERATE.
- Click the Browse button for the Output Feature Class and browse to the topography feature dataset. Name the output feature class topo_break_lines.
- Set the Output Feature Class Type to POLYLINE.
- Click OK to execute the geoprocessing tool.
- Click to select the topo_break_lines feature class in the catalog tree.
- Click the Preview tab to view the breakline data.
- Make sure the Preview type is set to Geography. The preview should resemble the breakline data displayed in the above image.
Next, you'll convert the ASCII points from a simple text file in XYZ format into a multipoint feature class. These points only define surface geometry, and the attributes only contain x-, y-, and z-values. A multipoint feature class stores one point per line, and the coordinates are separated by spaces. Since there is no attribution associated with these points, dedicating a database row for each is wasteful and inefficient. Instead, you'll combine them into multipoints. A multipoint can store many points per shape or row, saving storage space and improving read-write performance.
Now you've loaded the mass points and breaklines from which a terrain dataset will be built. The lidar points came in XYZ format and the photogrammetric lines in 3-D GENERATE format. Both are ASCII formats for simple 3D data and are read using the same tool, ASCII 3D to Feature Class.
- If you need to process a large collection of lidar points, consider using the LAS format instead of XYZ. LAS is an industry-standard format for lidar data. It's more efficient because it's binary. It also has more information stored in the file about the data.
- There's a separate tool to import LAS format files, LAS to Multipoint, that's located in the same toolset as the ASCII 3D to Feature Class tool.
Building a terrain dataset from features
Next, you will use the New Terrain wizard in ArcCatalog to define and build a terrain dataset.
- In ArcCatalog, right-click the topography feature dataset, point to New, and select Terrain from the context menu.
- In the New Terrain dialog box, accept the default name for the terrain dataset.
- Click Select All to check all the feature classes that are in the feature dataset.
- Set the Approximate point spacing to 10.
- Click Next.
- Click the Advanced button to expand the list of columns.
- Set the Surface Feature Type (SFType) to hard line for the topo_water_poly feature class.
- Click Next to determine the terrain pyramid type.
Since the mass points and breaklines have z-values, which will be used to define the terrain surface, the height source for them is set to Shape. This means that z comes from the shape geometry.
The topo_clip_poly feature class contains a 2D polygon. It defines the horizontal extent of the surface and minimizes interpolation artifacts around the surface perimeter.
Clip polygons work best when they're smaller than the extent of the data that is being used to provide z-values. The water polygons are represented by 2D geometry but have the height attribute SPOT. Each polygon can have its own height, but that height is constant. For lakes, this is fine, since they're flat. With this data, there are no measurements inside the lake boundaries that contradict the lake SPOT values, so you can add the boundaries as breaklines; otherwise, they'd be added as replacement polygons to ensure that their areas get flattened.
Everything but the breaklines are used for the terrain's overview representation. The overview is a generalized representation of the terrain, similar to a vector-based thumbnail. The breaklines are too detailed for the overview, but all the other information is needed to produce a reasonable looking overview.
Defining the pyramid for the terrain dataset
Terrain pyramids are used to create multiresolution surfaces. They're similar to raster pyramids in concept (that is, coarser pyramids are used for display at smaller scales to improve display performance), but there are differences. The most significant are that they're composed of vector based measurements and they can be used for analysis as well as display.
Two types of pyramids can be used to build a terrain dataset: z-tolerance and window size.
Z-tolerance pyramiding thins points to produce surfaces that are within an approximate vertical accuracy relative to the full-resolution data.
The window size pyramid type thins points for each pyramid level by partitioning the data into equal areas (windows) and selecting just one or two points from each area as representatives. Selection is based on one of the following criteria: the minimum, maximum, mean, or both the minimum and maximum z-value.
- Click the radio button next to the Z-tolerance pyramid type.
- Click Next to define the terrain pyramid levels.
- Click Add four times. This populates the table for you to customize the properties.
- Manually reset the values for Z Tolerance and Maximum Scale by clicking the values inside each column. Use the values specified in the following graphic.
- Click the Resolution Bounds Setting button to open the Pyramid Resolution Bounds dialog box.
- Set the Max Z Tolerance for the topo_break_lines feature class to 1. Accept the defaults for all others.
- Click OK to dismiss the Pyramid Resolution Bounds dialog box.
- Click Next to reach the summary panel.
- Click Finish.
- You're now asked if you want to build the terrain. Click Yes to initiate the terrain build process.
Using these settings, the full-resolution data is used in map displays up to a scale of 1:2,500. Between display scales of 1:2,500 and 1:10,000, only the data necessary to achieve an approximate vertical tolerance of 1.0, relative to the full-resolution data, is used. Between 1:10,000 and 1:25,000, a tolerance of 2.5 is used. Between 1:25,000 and 1:50,000, a tolerance of 5 is used. For any scale smaller than that, a tolerance of 10 is used.
Tolerances and scales used to define a terrain pyramid need to be specified based on application requirements. One approach is to mimic the accuracy requirements of a contour map series. A generally accepted rule is that contours should be accurate to within one-half of their interval. For example, if a 1:24,000 scale map within your study area uses a 5-foot contour interval, then the vertical accuracy should be 2.5 units RMSE. Base the pyramid on the scales and contour intervals appropriate for a map series of the terrain.
While breakline vertices are used where needed through all pyramid levels, the actual line enforcement can be restricted to occur in a subset of these levels. For example, road curbsides need not be enforced as triangle edges in a terrain at scales smaller than 1:24,000. You control enforcement via the Pyramid Bounds dialog box.
Viewing a terrain in ArcMap
Now that you have created a terrain dataset, adding it as a layer in ArcMap can be used to conduct further visualization and analysis. You can turn it on and off in the table of contents. As well, it has a Layer Properties dialog box to control display parameters. The layer properties Symbology tab is identical to TIN layers.
- From ArcCatalog, click the Launch ArcMap button on the Standard toolbar to start the application.
- In the ArcMap - Getting Started dialog box, click Browse and set the default geodatabase path to D:\3DAnalyst\3D_Default.gdb.
- Click OK to close the Getting Started dialog box.
- Click the Catalog tab to open the Catalog window, navigate to topography_Terrain from the Exercise8 folder, drag it into the map view, then release the mouse button.
- Zoom in on the display.
- Zoom to the full extent of the layer by clicking the Full Extent button from the Tools toolbar.
- Double-click the terrain layer to open the Layer Properties dialog box and click the Display tab.
- Change the point limit from 800000 to 125000 and click OK to close the Layer Properties dialog box.
- From the map display, zoom in and out, then pan around.
Using the interactive surface analysis tools in ArcMap
Now you'll use the 3D Interactive tools to complete some surface analysis.
- Make sure the 3D Analyst extension is enabled in ArcMap by clicking Customize, then Extensions.
- Click Customize and Toolbars to add the 3D Analyst toolbar, if it is not already displayed. The terrain is displayed in the Layer list on the toolbar.
- Double-click the terrain layer to open the terrain Layer Properties dialog box and click the Analysis tab.
- Set the resolution threshold for the 3D Analyst tools to 1.000000 from the drop-down menu.
- Click OK.
- Zoom in on the terrain until the display scale is larger than 1:10,000.
- Click the Create Line of Sight button.
- Set the Observer offset to 5 and the Target offset to 2.
- Click on the south slope of the mountain in the upper-left part of the terrain (the observer point), drag the line to the lower-right part, then release the mouse button (the target point).
- Click the x in the upper right corner to close the Line of Sight dialog box and press DEL to delete the graphic from the view.
- Click the Interpolate Line button.
- Digitize the first point in the left center of the view, drag the line to the upper-right corner to create the second point, then drag toward to the lower-right corner. Double-click to create the last point and stop digitizing.
- Click the Profile Graph Tool button to graph the 3D line.
- Click the x in the upper right corner to close the Profile Graph Title dialog box and press DEL to delete the graphic from the view.
If you aren't zoomed in far enough, the tools on the toolbar are disabled. By default, they're only enabled when the terrain is displayed at full resolution. Based on how the terrain's pyramid was defined, this will occur at display scales of 1:2,500 or larger.
You can enable the tools at lower resolutions from the Analysis tab of the terrain's Layer Properties dialog box. When you enable the tools at LODs lower than full resolution, the accuracy is also decreased. Interactive tools always operate at the current display resolution. This is useful if the full-resolution terrain is oversampled for the requirements of the analysis.
Rasterize a terrain using a geoprocessing tool
Terrain datasets can be rasterized based on any extent, cell size, and vertical tolerance. You can choose between linear and natural neighbor interpolators. A natural neighbor interpolation method generally produces higher-quality results but at the expense of processing time. Rasterization is performed using the Terrain to Raster geoprocessing tool.
- From the Catalog window, expand Toolboxes, click System Toolboxes, then click the 3D Analyst Tools toolbox.
- Navigate to the Conversion toolset, then the From Terrain tools, and double-click the Terrain to Raster geoprocessing tool.
- Choose the topography_Terrain in the Input Terrain drop-down list.
- Set the other values to match the graphic below.
- Click OK to execute the geoprocessing tool
- Click Full Extent once the geoprocessing tool has completed to view the results. Turn off the topography_Terrain layers.
Generate a hillshade using a geoprocessing tool
To see the morphology of the derived raster surface, generate a hillshade image. A hillshade representation of a surface can greatly enhance the visualization of a surface for analysis or graphical display, especially when utilizing the transparency setting.
- From the Catalog window, expand Toolboxes and click System Toolboxes, then click the 3D Analyst Tools toolbox.
- Navigate to the Raster Surface toolset and double-click the Hillshade tool.
- Choose the terrain_grd in the Input raster drop-down list.
- Confirm that all other values match the graphic below.
- Click OK to execute the tool and examine the resulting hillshade layer.
Using a terrain as an elevation layer in ArcGlobe
Terrain datasets can be used in ArcGlobe as either elevation or draped layers, contributing to the definition of the globe surface.
- From ArcMap, click the Launch ArcGlobe button on the 3D Analyst toolbar to start the application.
- In the ArcGlobe - Getting Started window, make sure the default geodatabase path is set to D:\3DAnalyst\3D_Default.gdb.
- Click OK to close the Getting Started dialog box.
- Close ArcMap. It is no longer needed for the rest of the exercise.
- From the Catalog window, navigate to topography_Terrain from the Exercise8 folder, drag it into the 3D view of ArcGlobe, then release the pointer.
- If prompted, close the Geographic Coordinate Systems Warning message box.
- From the Catalog window, navigate to 3D_Default.gdb and click the geodatabase.
- In the panel underneath the Catalog's tree view, select the contents of the geodatabase by holding the SHIFT key. HillSha_terr1 and terrain_grd are selected.
- Drag both selected layers into the 3D view of ArcGlobe, then release the pointer.
- An Add Data Wizard dialog box appears for terrain_grd. Click Finish to use the rasterized terrain as an image source.
- A dialog box may appear requesting to build raster pyramids. Click Yes.
- An Add Data Wizard dialog box appears for HillSha_terr1. Click Finish to use hillshade raster as an image source.
- Click and drag the Imagery layer until a black line appears after the hillshade indicating the new location. Release the mouse once this line appears.
- Right-click the rasterized terrain and click Properties.
- Click the Symbology tab.
- Click the Display tab.
- Assign a transparency setting of 50%.
- Click OK to close the Layer Properties dialog box.
- Zoom in to the rasterized terrain and navigate around.
Optimizing display settings in ArcGlobe
For high-quality display, you can do several things. Go to the Cache tab on the terrain's Layer Properties dialog box and uncheck the option to compress to 16 bits. This will eliminate the possibility of the surface geometry looking stair-stepped when zoomed in very close.
You can also set both the draped layers to use bilinear renderers. These will draw a smoother picture. Also, the hillshade raster should not use any stretch. The default, using standard deviations, is not appropriate for this data.
As an alternative to viewing draped rasters derived from the terrain dataset, you can add the terrain directly as a draped layer.
To do this, right-click Globe layers from the table of contents, point to Add Data, click Add Draped Data, then choose the terrain.
In this exercise, you have been introduced to terrain dataset concepts. You used geoprocessing tools to load lidar points and photogrammetric breaklines into feature classes residing in a feature dataset. Then, with the surface data in a feature dataset, you constructed a terrain dataset using the terrain wizard in ArcCatalog. You then conducted some analysis on the terrain surface inside ArcMap and ArcGlobe.