Select to view content in your preferred language

Zonal Centroid question

1280
7
01-31-2011 09:42 AM
PatrickDeLuca
Emerging Contributor
Hello all,

I have a question regarding the Zonal Centroid tool.  In the Help it states the following:

"A centroid will be found for every zone. The cell of the output raster within which a centroid of a zone falls is set to the value of the zone. In general, the number of non-NoData cells in the output raster will be equal to the number of zones in the input raster. However, if two or more zonal centroids would fall within the same output cell, the value of the cell is set to the lowest zone value among those zones."

I take this to meant that if zone 1 and zone 5 happen to have the centroids in the same cell, the output cell would be coded as zone 1.  What happens to zone 5 though, does it just not exist in the output?  What if one needed the centroid of zone 5?

Thanks
Pat
0 Kudos
7 Replies
PatrickDeLuca
Emerging Contributor
Bill, thanks for the reply.  It came to me after I posted, that I could use the Zonal Geometry as Table tool and that should still give me a value for X and Y centroid for each zone even if they occupy the same cell. Still, why just choose the zone with the lower value?  Just because it came across that zone first?  I know that is the way that several functions work in SA, I just thought it an odd choice.  But as long as I can get the info from Zonal Geometry as Table tool, I am satisfied.
0 Kudos
PatrickDeLuca
Emerging Contributor
Bill, I know that a grid cell can only hold one value.  I would have thought that there would be either the interactive route or specification of a priority field or something like that as it exists in other tools.  As I said, I realized that I can use the ZONAL GEOMETRY AS TABLE tool to get the answer, so I am fine with that.  Thanks all the same.
0 Kudos
SteveLynch
Esri Regular Contributor
PolygonToRaster takes a priority field.
0 Kudos
YatingChen
Emerging Contributor
Hi, I have a raster in which each region represents a settlement. I want to get the deepest point of each region. But in zonal geometry, the thickness tool is to give each cell the max_thick value, though it uses the deepest point to calculate. How can I get the deepest point data from this tool?
0 Kudos
YatingChen
Emerging Contributor
Compare the original grid to the zonal minimum grid: the places of equality are the deepest within their regions.

Thank you Bill for your reply! I think I didn't make myself clear.
my original grid is a binary grid,only have value 0 or 1. And I want to get the morphological deepest point of the area with value 1.picture below shows the deepest point I want.
[ATTACH=CONFIG]12665[/ATTACH]
0 Kudos
YatingChen
Emerging Contributor
Thank you for the clarification: you seek the point furthest within the interior of each region.  (It's related to the old joke about how far can a person go into the woods.  Answer: halfway; after that, they are going out again.)

Perhaps surprisingly, my previous solution applies after some preparation:


  1. RegionGroup the grid to obtain zones.

  2. Compute the Euclidean Distance grid for the complementary region (presumably, the one indicated by zeros).

The values in the zonal maximum grid give, region by region, the "deepest" interior distance.  Comparing the zonal max to the euclidean distance, as I described earlier, produces a binary grid identifying all the deepest points in all the regions.


Thank you Bill!
Logically, this should work. But the result of Euclidean Distance doesn't have a attribute table. So that it is not allowed to be used to compute the zonal maximum grid. 
What is the result of regiongroup used for in the preparation?
0 Kudos
YatingChen
Emerging Contributor
Nor does it need one.  Every zonal calculation employs two grids: one, which must have an attribute table, designates the zones.  The other contains the values to be summarized by zone.  It does not need to have an attribute table (and often does not).  In this case the RegionGrouped grid plays the former role (and it will have an attribute table) and the Euclidean distance grid plays the latter role.  Your comment suggests you just need to get clear about which grid is which.


Thank you for your help, Bill! I have got the result I want
0 Kudos