I have multiple polygons (destinations) and an elevation raster. For each raster cell in my study area, I need to calculate the distance to the nearest destination polygon. If I use the 'as crow flies' distances, that's easy (I can convert my polygons to raster, and then use the Raster\Analysis\Proximity in QGIS or raster - euclidean distance in ArcGIS).

In my application I need to get a 3D distance on the terrain surface. So, an "as crow flies" distance of 10 km would be bigger if there is a big hill or deep valley between them.

Is there any ArcGIS function similar to the "raster proximity" or "raster euclidean distance" that takes into account elevation change?

I'm looking for something like least cost path distance, but not just for two points but for every grid cell.

2 Answers 2


I'm not 100% clear on whether you need straight line distance accounting for elevation change along the way or if you want to allow the least-cost path to vary from a straight line. For the latter Linkage Mapper or Thomas Etherington's Landscape Genetics Toolbox - http://arcscripts.esri.com/details.asp?dbid=16852 - are good options.

I'm working on a tool that looks at straight line distance between polygons and then calculates distance among sample points using this network. If you've got the highest level of ArcGIS (Advanced license) then you should be able to run this model. If you want to make your own version here are the general steps:

  1. Use the Generate Near Table tool to get the distance between a polygon and every other polygon

  2. Use the XY to line tool to create shortest line segments connecting patches.

  3. Extract out the terrain using 3D analyst.

You should then be able to compare the straight line distance assuming no terrain to straight line distance accounting for ups and downs.


You might consider this Arc extension:


I've used it to successfully determine least-cost paths for wildlife between their vector polygon home ranges over a resistance-to-travel raster. Seems to me that your "up and down" topography might be a stand-in for resistance.

If you decide to go with this solution, it seems to give more reliable results when all the data is in a UTM/meter coordinate system. Not sure why, but there you have it...

  • I'd second the use of Linkage Mapper, but would add that it sounds as if the original poster should use slope rather than elevation as his/her cost surface.
    – Tom Dilts
    Commented Aug 11, 2021 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.