Return pixel position of minimum value for each zone?

740
3
Jump to solution
07-31-2013 09:45 AM
ChrisSnyder
Regular Contributor III
I have a streamlink raster and a "value" raster that has floating point values. I want to return the pixel position of the minimum value for each zone.... Sort of like a zonal minimum, but instead of applying the minimum value to the entire zone, I just want to return the pixel(s) that have the minimum value of each zone (and tag the rest as NoData or some other value). I don't even need to return the minimum value - just return the pixel that has the minimum value and assign it a value of 1. I have a working method for doing this, but it requires converting my raster to points and then a bunch of extra steps along the way - pretty sloppy and slow.

I am looking for an elgant raster-based solution that is fast, since I have to do this process many times over via a Python script.

A graphical representation of a hypothetical zone (x = nodata)
input:  3 5 6 2 3 4 6 7 9 output: x x x 1 x x x x x


Any ideas?
0 Kudos
1 Solution

Accepted Solutions
ChrisSnyder
Regular Contributor III
I got it:

Con(valueGrd == ZonalStatistics(strmLinkGrd, "VALUE", valueGrd, "MINIMUM", "DATA"), 1)

View solution in original post

0 Kudos
3 Replies
ChrisSnyder
Regular Contributor III
I got it:

Con(valueGrd == ZonalStatistics(strmLinkGrd, "VALUE", valueGrd, "MINIMUM", "DATA"), 1)
0 Kudos
SteveLynch
Esri Regular Contributor
0 Kudos
ChrisSnyder
Regular Contributor III
Thanks Steve - that's the same method I came up with too.
0 Kudos