Euclidean Distance From Specific Cells to Source Cells

2723
5
07-08-2016 09:18 AM
NareshPai
New Contributor

I have a land use raster and trying to find euclidean distance from specific classes only to source cells. The problem is that the Euclidean operation will find distance from every cell in the raster to the source cells which can be time consuming. The information I need is only for a smaller subset of the cells. Right now my option is to filter the distance values for the specific cells as a post-process step. But wondering if there is a way to constrain the euclidean distance process to specific cells only?

Tags (1)
0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

It appears you have everything jumbled in one raster.  Why not make an origin raster which identifies the locations from which you want to calculate distances from... just make sure your raster has 0 for the areas around the origin cells.

Run a Euclidean distance from those origins (exceptionally fast).  Then if you need to find out the Euclidean distance from destinations to these origins, you can either intersect (Con and a variety of other options) or extract values to points should you want to work in a both vector and raster world.

There are many other options available.  Don't be constrained by how your data are arranged at present.  You can often save a lot of work by tweaking it into a more useful format prior to analysis.

NareshPai
New Contributor

Thanks for your response. Trying to understand your solution...So in my case the "origin" cells are water. I need distance from only urban areas to water. If I create a raster with 1 for water and NoData for everything else, euclidean will calculate distance from every NoData cell to the water. Whereas my interest is only in urban NoData cells to water. Right now I am doing a Con on the output from euclidean raster to filter out euclidean distance for urban cells. Trying to see if euclidean operation can be constrained to only urban cells.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Water... class 1, zero elsewhere, calculate Euclidean distance from water that is the raster you want.

Urban is the other raster.  Con urban with eucdist raster

or

Represent urban as points, Extract Values to Points—Help | ArcGIS for Desktop (centroid is probably good enough or use the perimeter converted to points

DarrenWiens2
MVP Honored Contributor

I don't believe there is any way to directly mask the process to only calculate distances from source to target cells. Some alternatives, that I doubt will be faster are:

1.) convert water and urban to vector and run some incarnation of a Near analysis

2.) convert RasterToNumPyArray and use NumPy magic to filter and process

DanPatterson_Retired
MVP Emeritus

Darren may have a point,  It is far easier to do origin-destination calculations in numpy... I have covered at least once, , this incarnation is one example

Distance Calculations Revisited...