39

image Calculate Centroid of Area

There are some complex formulae and the engineering approaches that are well suited to handling regular shapes that can be simplified.

For a postal region, the irregular shape can be divided into a low-resolution grid and the average worked out in X and Y using a numerical method. We can grid this as shown in Figure 39.

Figure 39 Gridded polygon

image

First we can consider the horizontal. The top row has cells 5, 6, and 7 filled. The total is 18 and the average is 6. We add all the horizontal coordinates together and divide ...

Get Developing Quality Metadata now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.