Guchuan Liu, GIS Analyst
Tommy L. Coleman, Professor and Director of HSCaRS


Gravity Center Analysis Using ArcView and Avenue



Center for Hydrology, Soil Climatology, and Remote Sensing
PO Box 1208, Alabama A&M University
Normal, Alabama 35762
Tel: (205) 851-5469
Fax: (205) 851-5429
E-mail: AAMGXL01@ASNAAM.AAMU.EDU



ABSTRACT

The concept of gravity center in spatial analysis is borrowed from Newton's famous law of gravitation. Based on Newton's law of gravitation, the center of gravity is identified as the point where the equilibrium of the body can be reached (see Figure 1). In spatial analysis, a gravity center of a region is the location where the maximum accessibility can be reached. The maximum accessibility means the gravity center has the total minimal distance to all other locations. Finding the gravity center can optimize the process of site selection, which can help one find the relatively best site for urban or commercial development. In ArcInfo, the command ACCESSIBILITY and INTERACTION can be used for gravity model analysis. However, the procedure is complicated and not very easy for average GIS users. In this study, ArcView has been used for gravity center analysis, as ArcView is more easy to use and its Windows interface is more user-friendly than ArcInfo. Within ArcView environment, by using Avenue, a programming tool for ArcView, a procedure has been established for gravity center analysis. Using this procedure, gravity center analysis can be done in a relatively efficient and reliable manner. In this paper, the methodology, the procedure, as well as the Avenue script, have been presented for ArcView and Avenue users.


INTRODUCTION

The concept of the center of gravity can be found both in physics and geometry. In physics, the center of gravity is the point where the equilibrium of the body can be reached. In other words, the center of gravity is the balance point of a body (see Figure 1 (a)). If a body is homogeneous, that is, made of the same material throughout, and of simple geometric shape, such as a rectangular stick or a disk, a square plate or a sphere, the center of gravity lies at the geometrical center of the body. In geometry, moments are used to find the center of gravity of a physical object. As an illustration, consider a seesaw with boys of weights W1 and W2 on it. The two boys will balance each other provided the sum of their moments is zero, that is, W1X1 + W2X2 = 0. If they balance each other, the balance point O is called the center of gravity of the physical system made up of two boys (see Figure 1, (b)).
Figure 1
Figure 1. The illustration of the concept of gravity center.

The following theorem can been found in a geometry textbook and it gives the equation to find out the location of the center of gravity of a physical system. As we borrow the concept of gravity center from Newton's law of gravitation, We will borrow the equation in the following theorem for our gravity center calculation in next section.

Theorem: Consider a physical system made up of n particles of weights w1, w2, ..., wn located at the respective points (X1, Y1), (X2, Y2), ..., (Xn, Yn). If Mx and My are the moments of the system and w is the accumulation of wi , then the center of gravity of this system is the point (X, Y) given by

 Illustration

From this theorem, an interesting conclusion can be derived, that is the center of gravity has the total minimum moments to all particles within the system. If we apply this character to spatial analysis problems in a region, the point at the gravity center will have total minimum distance to all other points within the region. So this point will have maximum accessibility compared to all other points. That is the reason the gravity modeling is utilized in site selection. Another application is we can use the center of gravity as the virtual concentrating point as it is more close to a real world situation than the geometrical centers. So, in spatial analysis, we can assume that the weight of the system is concentrated theoretically at the center of gravity.

In the real world, the concept of the center of gravity can be applied in many situations. For example, if we want to select the site for a shopping center, we would like it to be near the center of gravity of customers. If we want to select a site for a airport, we probably would like to locate it at the center of gravity of the region that the airport will serve. In these two cases, the selected sites may have total minimum distance to all their customers.

When we use a geographical information system or a mapping system to analyze concentrating points or potential sites for urban development, finding out the center of gravity is necessary. In this study, we have incorporated the theorem of the center of gravity in the ArcView environment. Using ArcView development tool Avenue, we developed the model which enables one to identify the center of gravity.



METHODOLOGY

To apply the theorem of the center of gravity in a geographical information system, ArcView has been selected as it is a popular desktop GIS package in the market and has been widely used in business analysis. ArcView has its own developing tool, Avenue, which uses the latest object-oriented technology. Using Avenue, we have developed the models for searching the center of gravity automatically. With customization tools in ArcView, these models can be added to ArcView as if they are part of it.

To translate a geometry theorem of the center of gravity into a geographical model for ArcView, we should first know the way ArcView uses spatial files and how the Avenue handles spatial objects. In ArcView, both the ArcInfo coverage and the ArcView shape file can be used as a spatial data source, their visual representation in ArcView are defined as Feature Themes. Associated with the Feature Theme is the Feature Table (Ftab). A Ftab includes a special field named "Shape". The Shape field is part of the Ftab when it is created. The Shape field contains a Shape object that defines the geometry of the feature, such as a point or a polygon. To obtain the coordinates needed for searching the center of gravity, we should be aware that only the shape field stores geographic feature about coordinates.

To search the center of gravity, there are two kinds of feature themes which can be used directly. They are the point theme and polygon theme. The point theme represent point locations, such as cities in a nation or banks in a region. The polygon theme represents boundaries and regions, such as the state boundary map of the U.S. and the county boundary maps of Alabama. For other kinds of themes, the procedure may be more complicated. In this study, we only used the point and polygon themes.

Figure 2
Figure 2. The procedure for searching the center of gravity.

Next, we need to define the way to get (Xi, Yi) from the point or polygon themes. In the theorem introduced before, (Xi, Yi) represented the locations of n particles in a physical system. In point theme, the points in the region can be treated like the particles in a physical system. So we can use the coordinates for each corresponding point as (Xi, Yi). For the polygon theme, we can assume each polygon is homogeneous and its weight is concentrated in its centriod. This assumption is necessary, as in ArcView, it is more easy to get the centroid than other points. As long as the polygon theme has enough polygons, such as more than ten polygons, the accuracy still can be guaranteed based on this assumption. If the polygon theme has just a few polygons, some adjustments must be made.

As for the Wi, the weight for each respective point or polygon, we can get it from a attribute file. If we want to search the center of gravity for population, we should use population data as Wi. If we want to find the possible site for a shopping center, we may use the number of customers in each subregion as Wi.

After we obtained the (Xi, Yi, Wi), we can use the formula introduced in the previous section to calculate the location of the center of gravity (X, Y). Then use a point symbol to visualize it on point or polygon maps.



RESULTS AND DISCUSSIONS

In order to use the procedures just discussed, several population gravity centers at county level in Madison County, as well as at the state level in Alabama have been identified using various census data (See Figure 3 and Figure 4).

Figure 3 shows the gravity centers for the 1980 and 1990 population and major shopping centers in Madison County. Census data at census tract level has been used to calculate the population gravity centers. Comparing the gravity center for 1980 with the gravity center for 1990, there has been a little shifted to west. This reflects the fact that there are more residential development in western part of Madison County in the 1980's. The reason for this shift may lie in the increased commercial installations in the area. By pinpointing major commercial installations on the same map, one can see that they are very close to the population gravity center.

Figure 3
Figure 3. The gravity center of population in Madison County, Alabama, and the major commercial installations.

In Figure 4., the gravity center model has been used to analyze population distribution in Alabama based on two major racial group: white and African Americans based on 1990 census data. It is found that the gravity center for both groups are not located in the geographical center of Alabama. The one for the white population is shifted somewhat south of the state's geographical center, while the one for the African American population is shifted north of the state's geographical center. The distance between these two gravity centers is about 50 miles. By overlaying this map with the income level map, it was found that the gravity center for the African American population is more close to the areas with more low income families. If we can collect some historical data, such as population in different racial group in 1940, 1960, and 1980, using the gravity center analysis model, we would be able to study movement of the racial groups in those historic years. By doing so, we can find out if the different racial groups are more mixed geologically in Alabama those previous years.

Figure 4
Figure 4. The gravity center of population by races in Alabama.



CONCLUSION

This paper has explained the concept of gravity center in the sense of physics and how this concept can be used in spatial analysis. Using ArcView and Avenue, a relatively simple and straight forward procedure has been established for no GIS professionals. Using examples at the county level and state level in Alabama, the real world utilization of gravity center analysis has been presented, which shows it is a very useful tool to address some spatial analysis problem. In order to help those who would like to incorporate the gravity center model in their project, the Avenue script is presented in Appendix one.



APPENDIX ONE: The script for searching the center of gravity

' Headline: Search gravity center on ArcView shape (polygon or point)files
MsgBox.Info("A active polygon or point theme is needed for this program",
"Gravity Center Analysis")
theView = av.GetActiveDoc
theGraphics = theView.GetGraphics

' must be global to work in Calc exp below
_theProjection = theView.GetProjection
project_flag = _theProjection.IsNil.Not 'true if projected

theTheme = theView.GetActiveThemes.Get(0)

' Check if polygon or point theme
subName = theTheme.GetSrcName.GetSubName
if ((subName = "polygon").not and (subName = "point").not) then
MsgBox.Info ("Active theme must be a polygon or point theme","")
exit
end

' get the theme table and current edit state
theFTab = theTheme.GetFTab

theFields = theFTab.GetFields
edit_state = theFTab.IsEditable

' make sure table is editable and that fields can be added

if (theFtab.CanEdit) then
theFTab.SetEditable (true)
if ((theFTab.CanAddFields).Not) then
MsgBox.Info ("Can't add fields to the table."+NL+"Check write permission.",
"Can't add X,Y coordinates")
exit
end
else
MsgBox.Info ("Can't modify the feature table."+NL+"Check write permission.",
"Can't add X,Y coordinates")
exit
end

' Check if fields named "X-coord",and "Y-coord" exist
x_exists =(theFTab.FindField("X-coord") = NIL).Not
y_exists =(theFTab.FindField("y-coord") = NIL).Not

if (x_exists or y_exists) then
if (MsgBox.YesNo("Overwrite existing fields?",
"X-coord, Y-coord fields already exist", true)) then
' if ok to overwrite, delete the fields as they may not be defined
' as required by this script (eg., created from another script).
if (x_exists) then
theFTab.Removefields({theFTab.FindField("X-coord")})
end
if (y_exists) then
theFTab.RemoveFields({theFTab.FindField("Y-coord")})
end
else
exit
end ' if (MsgBox..)
end ' if

x = Field.Make ("X-coord", #FIELD_DECIMAL, 18,5)
y = Field.Make ("Y-coord", #FIELD_DECIMAL, 18,5)
theFTab.AddFields({x,y})

' Get point coordinates or polygon centroid coordinates

if (project_flag) then
theFTab.Calculate("[Shape].ReturnCenter.ReturnProjected(_theProjection).GetX", x)
theFTab.Calculate("[Shape].ReturnCenter.ReturnProjected(_theProjection).GetY", y)
else
theFTab.Calculate("[Shape].ReturnCenter.GetX", x)
theFTab.Calculate("[Shape].ReturnCenter.GetY", y)
end ' if

' check if attribute column is in current shape attribute table, if not, need
' link another table which contains such column.
if(MsgBox.YesNo("do you need to join with another table for attribute column?",
"Join tables", true))then

' Select a field for joining with second table
lstChoices = {}
for each f in theFields
if (f.GetName <> "shape" ) then
lstChoices.Add(f)
end
end

toField = MsgBox.ListAsString(lstChoices,
"Select a field for joining", "table join")
if (toField = NIL) then
exit
end

' open second table for joining, this table should contain the numeric field
' needed for gravity center analysis
Fromfile = fileDialog.Show("*.dbf", "DBase files", "Please open a dbase file for joining")
FromVT = VTab.Make(FromFile, true, false)
FromTable = Table.Make(FromVT)
FromFieldsList= FromVT.GetFields
av.GetProject.AddDoc(FromTable)
FromTable.GetWin.Open

' select a FromField
FromField = MsgBox.ListAsString(FromFieldsList, "Select a field as fromField", "table join")
if (FromField = NIL) then
exit
end

' Join the two tables
TheFTab.Join(toField, FromVT, FromField)
end

' get a numeric field for gravity center analysis
NewFieldslist = theFTab.GetFields
aField = MsgBox.ListAsString(NewFieldslist, "Select a field for gravity center analysis", "gravity")
if (aField = NIL) then
exit
end

' initaize totalxc, totalyc, and totalg
totalxc = 0
totalyc = 0
totalg = 0

' get value from x-coord, y-coord, and afield, and set values for X2 and y2

for each i in theFTab
' Get the values from FTab of x-coord, y-coord and aField
xc=theFTab.ReturnValue (x, i)
yc=theFTab.ReturnValue (y, i)
g=theFTab.ReturnValue (aField, i)

totalxc =totalxc + (xc*g)
totalyc =totalyc + (yc*g)
totalg =totalg + g
end

' Add a point shape to the theme to present
' the gravity center for selected field
aPoint = Point.Make(totalxc/totalg, totalyc/totalg)
gPoint = GraphicShape.Make(aPoint)
theSymbol = gPoint.GetSymbol

theSymbol.SetColor(color.GetRed)
theSymbol.SetSize(8)
theGraphics.Add(gPoint)
theFTab.Removefields({theFTab.FindField("X-coord")})
theFTab.RemoveFields({theFTab.FindField("Y-coord")})

'Return editing state to pre-script running state
theFTab.SetEditable (edit_state)



Reference

1. Esri, Inc. 1994, Introducing ArcView. Redlands, California: Environmental Systems Research Institute, Inc.
2. Esri, Inc. 1994, Introducing Avenue. Redlands, California: Environmental System Research Institute, Inc.
3. Semat, Henry. 1958, Physics. New York: Rinehart & Company, Inc.