Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working with Arcgis 10.1 and Python 2.7.2

How can I calculate the distance to multiple locations from each cell of my raster?

  • I tried euclidean distance but it only provides the distance to the closest location. I need to know the second closest, third closest and so on until the 150th closest.

  • I tried generating a near table but I'm working with high resolution data. The lowest I could go for this dataset are 1,9 million cells. A near table would generare 150 times 1,9 million rows. Looping through these rows takes up a tremendous amount of time.

    Here is an example (scratch of course) of what I'm trying to accomplish.

enter image description here

Red dots are locations, grid represents (49) cells, green lines are to show the distance.

I thought maybe something with an alternated euclidean distance function or an addition of euclidean distances to each single location. I tried combining euclidean rasters, but it didn't work.

Can anyone help me or point me in the right direction? A solution in python would be appreciated but I'm glad for any idea , workaround, anything...

share|improve this question
How many "locations" are involved? Just 150 or are there many more than that? – whuber Aug 13 '13 at 15:22

Try using a Model to solve this

Model Builder - Iterators - Iterate Feature Selection - this will allow you to go through each of your Locations one at a time and create individualized Euclidean Distance grids. Make sure you utilize in-line variable substitution so you are not writing over anything

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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