Massachusetts Institute of Technology - Department of Urban Studies and Planning
11.520: A Workshop on Geographic Information Systems |
11.188: Urban Planning and Social Science Laboratory |
Lab Exercise #6 - In-Class Notes: Vector Spatial Analysis
Overview
In this exercise you will use the spatial analysis
capabilities of ArcGIS to:
- Examine the location patterns of Cambridge stores by using the 'spatial
join' tools to tag store location data (bookstores, ice cream shops,
record stores) with the demographic characteristics of their neighborhood.
(This is a 'point-in-polygon' operation.)
- Create a 1 km buffer around Ames St.
- Estimate the number of young kids living near Ames Street by:
- Intersecting the Ames street buffer with the Cambridge blockgroup
data
- Apportioning kids in each blockgroup that is split
by the buffer in proportion to the block group area in the buffer
Lab #6 Issues:
- Buffering Ames St.: similar to previous buffering of Mass Ave; pay attention to setting map and display units (so you buffer at 1 km)
- Apportioning Cambridge kids to the parts of each block group that falls within the buffer
- Union and Intersect operations retain the old polygon areas
- You need to compute the new-polygon areas
- The Field/Calculate-geometry option (used in lecture) simplifies the area calculations
- but this lab shows you how to do it with VBA script
- Using VBA scripts to access the internal data model is a powerful key to building customized GIS apps
General ArcMap Tips:
- Folder, shapefile, and table names:
- Use only letters and number with NO spaces, special characters, etc.
- Start all names with a letter
- Save early and often
- Always have a recent unused copy of any MXD document (the ArcMap document
mymapfile.mxd)
- Every time you start an ArcMap session from a saved document, save it
right away into an mxd document with a new name (version2, ver3, ...)
Leftover from last Wednesday's lecture:
In last Wednesday's lecture, I illustrated the use of 'Field/Calculate-geometry' to find the XY centroids of blockgroup polygons in the
5-town area around Cambridge. We could have used VBA script to pull the XY values from the in-memory data model. In fact the lecture notes show how to do this.
- Here is the relevant portion of those lecture notes::
- Can't intersect the block group layer with the town boundaries because
of 'sliver' problems at the edges
- Create a 'point' layer of the centroids of all the blockgroups in the
area
- Select blockgroup in and around the 5 towns and save to a new shapefile
- add X,Y fields to the attribute table (as double precision numbers)
- Use this VBA script to enter the centroid X,Y values into the new
fields
Dim dblX As Double
Dim pArea As IArea
Set pArea = [Shape]
dblX = pArea.Centroid.X
- Once the X and Y values have been added, we can create a new point shapefile of these centroids using
Tools/Add-X-Y-data
- We ended the lecture at this point on Wednesday
- You need to export the attribute table with XYs and add it as a separate table in ArcMap before you can create the new point shapefile. Export only the XY points and identifiers to simplify the table.
Do you understand what the VBA script is doing? How and why is it different from the script used in this exercise?
Back to the 11.520
Home Page. Back to the CRN Home
Page.
Last modified 16 October 2010 by Joe Ferreira.