# Finding coordinates of raster centroid? [duplicate]

How do I find the coordinates of the centre / centroid of a raster?

I have tried Zonal Geometry but this does not give me the coordinates.

I need to find the centroids of two rasters and create points and measure the distance and bearings between them. i.e. distance and direction between two raster centroids.

I am using ArcGIS Desktop 10.2.

• Have look at gis.stackexchange.com/questions/15020/… – SIslam Jan 23 '15 at 18:34
• The centroid coordinates are the zonal means of the two coordinate grids. This approach is a powerful generalization of your problem because (1) it is direct, avoiding conversion to a different data format; (2) it produces--in two simple, very quickly executed steps--centroids of every polygon in any given raster; and (3) it is easily modified to give weighted centroids, such as population-weighted centers. A worked example (using spherical geometry!) is given at gis.stackexchange.com/a/83241, where the 3D centroid of all land masses on the Earth is computed. – whuber Jan 23 '15 at 20:31

Run the Raster to Polygon conversion tool, then run the Feature to Point tool on the result. This should give you centroid point features for the rasters.

This step-by-step solution works (and it is not so complicated that it seems to be...):

First, convert yor raster into polygons by

``````ArcToolbox -> Conversion Tools -> From Raster -> Raster To Polygon.
``````

Once new polygons created, identify their coordinates of centroids by Add Geometry Attributes - it creates new culomns in your polygon attribute table with X,Y coordinates of centroid of each polygon.

``````ArcToolbox -> Data Management Tools -> Features -> Add Geometry Attributed
``````

Now you have X,Y coordinated of every centroid in attribute table of your polygon. You have to save this attribute table as separate file:

``````Open attribute table, select all rows and export table (to .txt if you want):
``````

``````Now you have to import this attribute .txt table to directly use XY coordinates to produce a XY points:
``````

``````From these points, export data as .shp:
``````

and run the Point Distance Tool to measure distances for paires of points (distance 1->9 = distance 9->1)

``````ArcToolbox -> Analysis Tools -> Proximity -> Point Distance
``````

It produces your distance table. You can verify your results by Measure Tool