Select to view content in your preferred language

3-dimensional distance from multiple points to closest polyline

3072
12
06-21-2013 08:44 AM
MatthewWestbrook
Emerging Contributor
I am trying to calculate distance over terrain using the following components:

-point shape values (with x, y, z data)
-polylines (only x, y data)
-DEM from CanadaGeoBase

The polyline was manually created.  I will need to extract elevation data from the DEM to every pixel along the poly-line.  Without the Z data on the polyline, the distance I calculate will only be 2-dimensional and, therefore, an under-representation of actual distance from point to line as the data is in mountainous terrain.

Does anyone have any suggestions that don't involve map algebra or model building?  I was told that there should be a simple tool to use, but I have been unable to find it as of yet.

Thank you in advance!
0 Kudos
12 Replies
EricRice
Esri Regular Contributor
Run Add Surface Information with your DEM and polylines. It will return the surface length of the line.  The sampling distance parameter defaults to the surface resolution which is what you're asking for so just leave that parameter alone.

Best,
Eric
0 Kudos
MatthewWestbrook
Emerging Contributor
Thanks for the response! This seems to be a good start.

I used "add surface information" tool to interpolate z-values to the polylines that I created manually from my DEM.  This worked fine.

Next, I ran the "near 3D" tool to calculate 3D distance using a point shapefile as my input feature class and my polylines as the near feature class.

When I opened the attribute table for my inpute feature, new attributes were added, but the fields were populated with all "0" values.

Thoughts?
0 Kudos
MatthewWestbrook
Emerging Contributor
Run Add Surface Information with your DEM and polylines. It will return the surface length of the line.  The sampling distance parameter defaults to the surface resolution which is what you're asking for so just leave that parameter alone.

Best,
Eric


Thanks for the response! This seems to be a good start.

I used "add surface information" tool to interpolate z-values to the polylines that I created manually from my DEM. This worked fine.

Next, I ran the "near 3D" tool to calculate 3D distance using a point shapefile as my input feature class and my polylines as the near feature class.

When I opened the attribute table for my inpute feature, new attributes were added, but the fields were populated with all "0" values.

Thoughts?
0 Kudos
EricRice
Esri Regular Contributor
Add Surface Information doesn't make your polylines into 3d polylines.  Near 3d requires your inputs to be 3D.  Near 3D is also not going to tell you the surface distance between points and polylines - only 3d distance.  I think I misinterpreted your question at first.

Perhaps some screenshots of your data overlaying each other so I can understand better.

Best,
Eric
0 Kudos
MatthewWestbrook
Emerging Contributor
Add Surface Information doesn't make your polylines into 3d polylines.  Near 3d requires your inputs to be 3D.  Near 3D is also not going to tell you the surface distance between points and polylines - only 3d distance.  I think I misinterpreted your question at first.

Perhaps some screenshots of your data overlaying each other so I can understand better.

Best,
Eric


Thanks, Eric.

I've attached screenshots of the data.  The end goal is to acquire 3D distance (straight line distance) from my points on the interior of alpine meadows to treeline creating meadow border.  I can't use 2D distance as the real 3D distance is greater.  I will be interested in actual topographical surface area (3D surface area), but I am only interested in straight line distances from points to treeline.

The "add surface information" tool added attributes to the polylines (see attached), but I need Z information for the polylines at much higher frequency than the attibute provided (i.e., more than one Z value per polyline created).

Hope this helps clarify what I am asking!

Matt
0 Kudos
EricRice
Esri Regular Contributor

The "add surface information" tool added attributes to the polylines (see attached), but I need Z information for the polylines at much higher frequency than the attibute provided (i.e., more than one Z value per polyline created).

Earlier in thread:
The polyline was manually created.  I will need to extract elevation  data from the DEM to every pixel along the poly-line.  Without the Z  data on the polyline, the distance I calculate will only be  2-dimensional and, therefore, an under-representation of actual distance  from point to line as the data is in mountainous terrain.

Matt


I'm fairly confident I get what you're looking for, but just for sake of it I bolded what was confusing to me and why I pointed you to the Add Surface Information tool.  However, it is now clear that the mountainous terrain you speak of is not really part of the equation for you since you just want 3d straight line distances rather than the distance along the surface from the point to the treeline. Surface distance does not equal 3D distance.

As for the comment on "more than one Z value per polyline", you should see that you have a Min and Max Z per record so you already have more than one Z per polyline.  Your polyline is already 3d so you should just delete those attributes you got from Add Surface Information.  With respect to the comment, "The polyline was manually created" - meaning you defined the Z for each vertice while in edit mode?  I don't want to get too far off track here - just need clarity.

With the data you have, you first need to make the points into pointz by converting it to 3d using the attribute you have for elevation.  If you have a 2d version of the treeline I would go back to that and run Interpolate Shape using the DEM and again let the tool use the raster resolution to determine sampling. i.e. the tool densifies the line at the resolution of the DEM and assigns the Z internally into the Shape field.  Once you have a PointZ and a PolylineZ (which you already have, but I lack details on its origination) you can run the Near 3D tool to get the 3d distance from a point to the closest location from the treeline layer.  The reason you got 0's is because you input a 2d feature class (the points) into a tool that is expecting it to be Z aware. The math just doesn't work without a Z. The answer you got was essentially "Null", but I'm guessing you're working with shapefiles and .dbf tables don't support the concept of Null so it converted to zero.

-Eric
0 Kudos
MatthewWestbrook
Emerging Contributor
Eric-

When I say that the polylines were manually created, I mean that they were created  by tracing tree boundary.  I did not add any Z data to the polylines.

Just now, I ran "interpolate shape" as to add Z data to my polylines from my DEM.  I left the defaults the same as to apply Z data at the resolution of the underlying DEM.  A new shapefile was created in my data frame with the name that I designated.  When I open the attribute table for this new polyline shapefile, the same attributes are listed as were listed in the input feature (FID, shape*, and Id).

I also ran the "feature to 3D by attribute" on my point shapefiles.  I used GPS height to denote elevation in meters.  Again, a new shapefile was created in my data frame with the name that I designated.  When I open the attribute table for this new point shapefile, the same attributes are listed as were listed in the input feature.

As for the comment "more than one Z value per line":  these Z values ("Z-min", "Z-max", "Z-mean") were added after running the rool "add surface information" which was apparently not an appropriate tool to run in order to create 3D polylines.

Thank you for your help and patience.  I truly appreciate it.

Matt
0 Kudos
EricRice
Esri Regular Contributor
Did you run Near 3D and get expected values?

Best,
Eric
0 Kudos
MatthewWestbrook
Emerging Contributor
I should have included that information!

Assuming that the data are in meters (which are the units of the map document and we are operating in UTM, no, I did not get expected values in the attribute columns for 3D distance.

The values were all small fractions, e.g. 0.0023.  Maybe the distance is in km?

M
0 Kudos