# How does ArcGIS Desktop calculate INSIDE point for Feature to Point?

Let me back up and say that from what I understand there are two common ways to calculate the centroid of a polygon in ArcGIS Desktop:

1. Using Calculate Geometry on fields within the attribute table of the feature class.
2. Using `Data Management -> Features -> Feature to Point` from the toolbox.

These both give the same result - the geometric centroid of the polygon. However, there is no guarantee that point lies inside the polygon.

The Feature to Point tool has an inside checkbox option, that according to the documentation:

Uses a location contained by an input feature as its output point location.

What I would like to know is how is this point calculated by ArcGIS Desktop and what is its "theoretical" meaning, if that makes sense.

• Given the general vagueness of ESRI's documentation, you likely have to reverse-engineer the procedure by testing. When I did this with AV 3.x 15 years ago, the algorithm was (1) find the geometric centroid and then (2) move it horizontally to the nearest point inside the polygon. – whuber Jun 17 '11 at 20:57
• @whuber - in this case the inside point can be different even if the centroid itself is inside the polygon, so that makes me think its a completely different calculation – mindless.panda Jun 17 '11 at 21:01
• This forum post on ESRI's site is interesting and does seem to indicate its a black box. – mindless.panda Jun 17 '11 at 21:10
• Using python in 9.3.1, I compared some possible ways to generate a 'centroid'. Can be seen here! in the ESRI forums. – SaultDon Jun 17 '11 at 21:24
• @mindless In the old algorithm, if the centroid was inside the polygon, of course it wasn't moved: it coincides with the nearest point inside the polygon. However, the forum post you found renders this issue moot: ESRI has changed the algorithm. I wouldn't infer it is "completely different," though. It might just be a refinement of the older one. It's not going to be easy to reverse-engineer, though. – whuber Jun 17 '11 at 21:28

## 2 Answers

The algorithms are proprietary but there are two basic concepts here. The centroid uses a center of gravity algorithm (there are many different ways to calculate this). The "inside" check box calculates a centroid but then moves the point inside if it falls outside as this is desirable in some cases.

At the ArcObjects level these approaches are defined as the Centroid and the Label Point. See the Centroid link for example images.

• While this doesn't tell us how the inside point is calculated it does tell us its synonymous with the label point. – mindless.panda Jun 24 '11 at 12:15

We have used ArcMap 10.3. Calculated (1) feature to point with inside option (2) feature to point without inside option (3) centroid by calculate geometry.

Points from (2) and (3) share location, sometimes these points are outside the polygon. (1) creates points inside polygons, as expected, mostly identical with points from (3) and (2). Sometimes points from (1) are different, even where points from (3) or (2) are inside the polygon(!): we can not detect a necessity to a spatial shift to receive an inside point.

Shifted points from (1) are not strictly shifted in W-E or N-S direction. Sometimes unnecessarily shifted points are located new to a position definitely not representing a point of gravity and are unexpected.

Scientific work needs to be reproducible. We can not find a documentation for the algorithm nor explain a shift, especially where it is not necessary. Thus the ESRI-feature centroid is not applicable.