CenterOfGravityAccumulator
From Fmepedia
| This page contains a Custom Transformer created by an fmepedia user. See the attached files list at the foot of this page for the zip file containing this custom transformer. |
Created by: Mark Ireland
Similar to the CenterOfGravityReplacer - this transformer finds the centre of gravity for a whole set of point features. The center of gravity is the mean X and Y coordinates of the set of points. The mean is calculated as...
X=∑Xi...n / n and Y=∑Yi...n / n
The weight setting allows an attribute to be selected by which to weight the individual points; for example if each point represents a city, the city population may be used as a weight to find the population-weighted centre. The weighted mean is calculated as...
X=∑X*Wi...n / ∑Wi...n and Y=∑Y*Wi...n / ∑Wi...n
If there is no weight to be applied, the weight setting should be left at 0.
The first example (workspace included in download) demonstrates the centre of gravity of all Washington State counties. The counties are first converted to point features using the regular CenterOfGravityReplacer. The weighted means relate to the mean population for 1990 and 2000. The weighted centre is obviously dragged west of the non-weighted centre by the large urban centres of Seattle and Tacoma. Also notice that the weighted centre has moved approximately 2km west in those 10 years; presumably because Seattle is growing relatively larger. Another 10 years of the same and the centre will move out of Kittitas County and into King County.
This second example (workspace not included) demonstrates the centre of gravity for FME Sales in the US, on a state-by-state basis. Each state capital counts as the point features for analysis; in this example they are weighted by the number of sales in that state. The data apparently shows that FME is more well known in the west (perhaps not surprising given Safe's location). The data was written to Google Earth KML format.
