These steps show how to convert 2-dimensional (2D) points into 3-dimensional (3D) ones, and how to use those points to convert 2D lines into 3D lines, given the existence of an elevation (Z) attribute within the point layer. The points and lines should have a meaningful, connective, spatial relationship. Examples include sewer manholes and sewer lines; water valves, hydrants, and water lines; street lights and underground power feed lines.
For best results:
Tools and dialogs require input and output values. Values colored in orange reference the tutorial data. In practice, choose your own feature classes, field names, and constants. Values colored in blue are output values; you choose the name of what is created. Blue feature classes are not included in the .zip file. I try to use ArcToolbox throughout, so that the Geoprocessing Results window contains all steps as they were taken. Tools that modify or create new data work off of the selected features, if any, or all features if there is no selection, so keep that in mind.
These steps were tested with ArcGIS Desktop 10.6.1, but may work in other versions as well. A downloadable .zip file contains a 10.6.1 map document with fake data in a file geodatabase to work through as a tutorial. In 10.6.1, I noticed that wizards worked all of the time, while ArcToolbox only worked most of the time. When the ArcMap UI offers a way of doing something that a Toolbox also provides, use the UI in 10.6.1.
First, create a map document containing the layers you are interested in converting, as well as a few layers for reference. Save at every meaningful point along the way.
Second, create 3D points from 2D points. This tool can be run with any level of Desktop, but requires 3D Analyst.
Examine the output attribute table. The SHAPE field should show "Point Z". The properties of your feature class should show "Coordinates include Z values. Used to store 3D data" as checked. All of the fields from the original 2D feature class should be intact, including names, types, aliases, widths, and domains.
Third, create a new 2D point layer whose geometry and attributes represent the vertices of the 2D lines. For example, a line with four vertices in your 2D layer will result in four point features in your output layer. Each feature will have the attributes of the line it came from. This tool can only be run with an Advanced Desktop license, but does not require 3D Analyst.
Examine the output attribute table. There will be more features in this feature class than the original, because each feature is a point representing the vertex of the original geometry. An important field in the output is ORIG_FID. This corresponds to the OBJECTID in the original 2D layer.
Fourth, find out which vertices correspond to the 3D points. You might have 3D points match 0, 1, or more 2D vertices, and you might have 2D vertices which match 0, 1, or more 3D points. If a line's vertex matches up with more than one feature with different elevations, choose how ArcToolbox will resolve the elevation in the step marked with a * below.
Examine the output attribute table. Although the SHAPE is a "Point Z", the actual Z values in the feature geometry are 0. Next, find which vertices will not have a proper elevation.
Examine the input attribute table. The selected features represent vertices from your 2D lines that didn't coincide with any 3D points OR coincided with points of unknown altitude. You'll notice that the elevation field for these points is <Null> which means "Unknown".
Fifth, you must make a decision as to how the original shapes will be transformed to 3D when the elevations of these vertices are missing. Here are viable options I present to you:
Option A: Assume a flat, constant elevation value where the elevation is unknown. Edges of your resulting 3D lines will dip or rise to this constant elevation. This will help you find anomalies if you choose a very low or very high value. However, it will make your data look weird in 3D. If your data is relatively flat, this could be a good option. If you go this route, proceed to "Steps for Option A".
Option B: Assign a Z value per vertex that is the average of the other Z values in the same line. Edges of your resulting 3D lines will dip or rise moderately. However, this will give a false picture of your data in 3D space while not drawing attention to the anomalies. If you go this route, proceed to "Steps for Option B".
Option C: Do nothing and allow 3D vertices to have a 0 or NULL value. You might also choose this option if all of your vertices coincided with points of known elevation. If you go this route, proceed to "Continue".
Steps for Option A
Select all the vertices where the elevation is unknown and calculate a fixed value for those.
Steps for Option B
Find all the vertices where the elevation is known, and calculate an average elevation per feature.
Join the results of the average elevation table to the vertices table by feature ID. Copy the elevation attribute over to the vertices where the vertex elevation is unknown. But before the join is performed, index important fields.
Sixth, now that the line vertices know their elevations, they can be converted to 3D points, and then stitched together into 3D lines with attributes from the original 2D lines.
Now, you can delete intermediate data if you so desire. You do so at your own risk. The temporary feature classes and tables are MY_2D_VERTICES, MY_2D_VERTEX_POINTS, MY_AVG_LINE_Z, and MY_3D_VERTICES. In the future, you might be able to delete your 2D feature classes when you and your organization have migrated to using the 3D data in all applications, maps, and services.
MY_3D_POINTS and MY_3D_LINES are your final results. Add them to ArcScene to look at them in 3D. ArcScene should be installed since you have the 3D Analyst extension. Or, add them to ArcGIS Pro with a 3D extension.
If you chose Option A, some vertices of some lines will be at the fixed elevation you chose. Some lines will be entirely at that elevation. You should work to collect truer data at those spots to have better 3D data.
If you chose Option B, some lines will unexpectedly slope up or down to an average elevation for the feature. Some lines will be at elevation 0 or NULL. You should work to collect truer data at those spots to have better 3D data.
Senior GIS Programmer/Analyst
City Manager's Office/Information Technology Division
City of Orem, Utah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.