# Center and Centroids

Three related operations in the Center template in the Transform pane, called circle, inner (area), and weight (area),  create points at the "center" of objects using similar but different methods:

• circle - the center of a minimum enclosing circle.

• inner (area) - for areas only, a merge into the center point of a minimum enclosing circle as adjusted to fall within the original area
• weight (area) - for areas only, a merge into the center of gravity point of the subject areas, as if they were cut out of cardboard.

Such points are often called centroids in GIS work.   The word centroid in this context simply means a point placed at the "center" of an object.   Centroids are used for many reasons but perhaps the most important is to convert geographic data in the form of areas or lines into the simpler form of points. At times we will want the data in a simpler form for export to other programs or to use analytic methods that work with points but which do not work with areas or lines.  A point is always its own centroid, so the Center template in all three forms simply copies points. The Center template can work with lines as well as with areas. When a centroid point is created it inherits the data fields of the object from which it was created. The illustrations above show centroids created for areas with the Centers template.

## weight (area) The weight (area) operation creates a point at the approximate center of balance of the area, that is, the balance point if the area were cut out of stiff cardboard.   The centroid point created by the weight (area) operation is shown above in yellow.  The weight (area) operation uses a fast algorithm that will usually, but not always, place the centroid point within the area. Unusual area shapes such as horseshoe shapes will cause the centroid point to be placed outside the area.

## circle The circle operation computes a minimum enclosing circle about each area and creates the centroid at the center of the circle. The illustration above shows the centroid point created by the circle operation in red.  The position of the circle centroid is different from the centroid computed by the weight (area) operation.   The circle operation may also place the centroid outside the area.

## inner (area)

We will often encounter areas where the centroid point computed using circle or weight (area) will be placed outside the area.   Consider, for example,  a map of the Southeastern United States. If we create centroids, shown as green dots, using the circle template we see that the centroid for Florida falls outside of the state. If we were too zoom far into the drawing we would see that the centroid created for Louisiana also falls outside that state, just across the border within Mississippi. We can use the inner (area) operation to create centroids, shown as yellow squares above, that are guaranteed to fall within their areas.

## Centroids and Lines

Because an enclosing circle can be computed for lines as well as for areas we can create centroids for lines using the circle template. This illustration shows four lines with their centroids, computed using circle. If we draw enclosing circles about each line, shown in red selection color, we can see how the locations of the centroids were determined.

Centers are most frequently created for areas. However, they are also a useful means of "converting" line objects into point data. For example, the above illustration shows lines in a hydrography layer where what appear to be continuous lines are in fact many lines that abut one another. Using the circle template we can create centroids for each individual line.

Why would we want to do that?  Suppose for each line segment we have the length of the line. We would like to know the total length of waterways per square kilometer in various regions of the map. We can approximate this by creating a grid where each box is one kilometer square and then creating centroids for each line segment. It is then an easy matter to add up the total "length" values for each centroid point that happens to be in each square kilometer grid box.

Transform Pane

Transform Reference

Transform - Geometry: Center

Example: Join Districts to Building Footprints - Given a map of a city with a drawing layer containing the footprints of buildings as polygonal areas, and a second drawing layer containing districts in the city as polygonal areas, we use the Join dialog to add a new attribute field to each building giving the district in which it is located.   We consider first the simple case where district boundaries always fall between buildings, so buildings are always only in one district.  Next, we deal with the case where buildings can straddle district boundaries, so parts of the same building can be in different districts.  In that case we use the Transform pane to quickly build centroids for building footprints, and then we use the centroids to guide the spatial join.