[GIS] How to find the centroid of each patch in a raster

arcgis-10.2arcgis-desktopcentroidsfragstats

I am trying to get the centroid of a several areas in a large raster data set.

The output needs to be raster format, with one pixel representing the center of each patch, in the same resolution as the input raster. I tried using the feature to point tool and then converting the point output to raster, but this takes an incredibly long time to process, meaning this task may take me several days as I have several rasters I need to do this for.

I was hoping to find a quicker way that doesn't involve switching between rasters and features. Essentially, I'd like to do the equivalent of 'feature to point' but with a raster.

Does anybody know a way to do this? I am relatively new to ArcGIS so don't know how to use Python unfortunately!

I'm using ArcGIS 10.2 Advanced license

Best Answer

You can't create centroids directly from rasters, you must first convert them into vector (polygons) and then gain the centroid from the polygons.

You should only convert classified raster to polygon as continuous datasets aren't allowed by the tool; rasters comprising of many rapidly changing values may not be converted due to shapefile size restrictions or take a very long time. From the sounds of it you have classified your raster so it should be suitable.

To convert the raster to a polygon feature class use Raster to Polygon, at your discretion simplify or not, it would be quicker not to simplify but wouldn't change the output too much.

Now, extract the centroids from the polygons using Feature to Point with the CENTROID option (there should be no multipart polygons to confuse the issue).

To further refine the points into rounded (cell) coordinates you can convert point to raster using a snap raster and cell size of the original raster then convert that raster into points. You will possibly loose whatever attribution was present in the original polygons but a simple Spatial Join will get that information back for you.

Related Question