Select to view content in your preferred language

Distance between a shapefile point and  a raster cells

531
2
11-10-2012 01:06 PM
ZaidDagbanbia
Deactivated User
Hello,

I am having a problem of writing a python script to calculate a distance between a shapefile and the individual cells of a raster file. i converted the raster file to points by using raster to points and then loop through but it takes so much time. i am wondering if there is any alternative.
Tags (2)
0 Kudos
2 Replies
ArkadiuszMatoszka
Frequent Contributor
Hi,
You may try to count it having raster extension, and cell size (from arcpy.Raster() class attributes) you can calculate center of any cell in raster (multiply cell size by numbers of rows and cols and add to coords of lower left corner) . With that calculating distance between point and raster cell should be piece of cake.

Regards
Arek
0 Kudos
KristenPeck
New Contributor
Hi,

I know this thread was opened a while ago now, but did you resolve this problem? I have the same issue, where I am trying to calculate the minimum distance from each point location in a shapefile to the nearest raster cell with a certain value. I realize I could make a point file of the raster first, but there must be a way to do this in ArcGIS or GME without converting the file first? I should note I am not a big user of Python.

Thanks for any response!

Kristen
0 Kudos