PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Share a file Manage my documents Convert Recover PDF Search Help Contact



s trubetskoy adv gis lab8 .pdf



Original filename: s_trubetskoy_adv_gis_lab8.pdf
Title: adv_gis_lab8

This PDF 1.3 document has been generated by Pages / Mac OS X 10.11.4 Quartz PDFContext, and has been sent on pdf-archive.com on 01/06/2016 at 22:05, from IP address 128.135.x.x. The current document download page has been viewed 570 times.
File size: 189 KB (4 pages).
Privacy: public file




Download original PDF file









Document preview


Sasha Trubetskoy
Prof. Schuble
Adv. GIS

25 May, 2016

Lab 8

Proximity to McDonald’s in Virginia (cont.)
In this lab we created a cohesive spatial procedure in order to answer a given question. In
this case, the question was: How much of Virginia’s population lives within 5, 10 and 20 miles of a
McDonald’s restaurant? To find out, I needed McDonald’s locations, a general shape of Virginia,
and population data as precise as was available. The McDonald’s locations were taken from a
free dataset, courtesy of FastFoodMaps.com. The shape of Virginia and block-level census data
came from Data.gov TIGER/Line shapefiles. I constructed a model in Model Builder with
ArcCatalog, and then modified it slightly after exporting to a python script. The full python code
can be seen on the last pages.
The file from FastFoodMaps.com was a .csv, so the first thing I had to do was to project it.
This can be easily done with the Convert Coordinate Notation tool. The file included the
locations of all major fast food restaurant chains, including Burger King and Wendy’s, which I
was not interested in. In order to work only with the McDonald’s locations, I created an update
cursor which went through the rows of the converted coordinate points, and removed rows where
Field2 != “m”; a value of “m” there indicates that the restaurant is a McDonald’s.
Next I wanted to get rid of McDonald’s locations that were not close to Virginia, in order
to simplify a final map and to improve performance speed. I accomplished this by first taking a
buffer of Virginia, which theoretically only had to be 20 miles; I took a 30-mile buffer to be safe,
mitigating “on-the-line” exclusions. A simple clip of the McDonald’s locations by the Virginia
buffer removes extraneous locations.
The next task was to perform several buffers around the McDonald’s locations. Using a for
loop with a predefined range of [“5”, “10”, “20”], we created the necessary distance values Dist
for our Buffer tool. Adding the string “ Miles” to the Dist variable fixes the problem of units. The
function produced intervals at 5, 10, and 20 miles.

LAB 8

!1

The task of calculating population within the buffers was done using the precise TIGER
shapefile. The TIGER file contained population data for every census block in Virginia, which I
converted into a point using the Feature to Point tool. This point served as an approximation for
the entire block, though admittedly there is some inaccuracy due to small parts of census blocks
being neglected. However, I do not expect this inaccuracy to significantly affect the results.
Once the TIGER population points had been created, I spatially joined them to each
buffer. Within the options for the spatial join, the merge rule for the field “POP10” (which
represents the 2010 population for each census block) I set to “SUM”. Once all the points had
been merged to the buffers, looking at the attribute tables revealed the following figures:

Buffer distance

Population

Percent of VA total

5 miles

6,653,384

83.16%

10 miles

7,532,814

94.15%

20 miles

7,987,342

99.83%

8,001,024

100.00%

Virginia total

While the 20-mile figure was consistent with my expectations, I was not expecting that 4 of
5 Virginians were within 5 miles of a McDonald’s, as the crow flies. This is likely because I
measured Euclidean distance with this demonstration, while in reality accessibility and travel time
are determined by Manhattan distance. It may be an interesting future project to determine how
many people are within 5 Manhattan miles of a McDonald’s restaurant. The output of my

LAB 8

!2

project can be summarized in the map below.

!
The python script follows:
#
#
#
#
#
#
#

-*- coding: utf-8 -*--------------------------------------------------------------------------grapes.py
Created on: 2016-05-25 22:02:23.00000
(generated by ArcGIS/ModelBuilder)
Description:
---------------------------------------------------------------------------

# Set the necessary product code
# import arcinfo

# Import arcpy module
import arcpy

# Local variables:
va_blocks = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\va_blocks"
virginia_shape = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\virginia_shape"
ff_table = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\\ff_table"
virginia_shape_Buffer = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\
\lab7.gdb\\virginia_shape_Buffer"
ff_locs = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\\ff_locs"
va_mcd_locs = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\va_mcd_locs"

LAB 8

!3

va_mcd_locs_Buffer = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\va_mcd_locs_Buffer"
va_blocks_pts = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\va_blocks_pts"
va_mcd_buffer_join = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\va_mcd_buffer_join"
va_mcd_buffer_join_Statistic = "\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\
\lab7.gdb\\va_mcd_buffer_join_Statistic"
# Process: Convert Coordinate Notation
arcpy.ConvertCoordinateNotation_management(ff_table, ff_locs, "Field9", "Field8",
"DD_2", "DD_2", "", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',
6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',
0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000
10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision",
"GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',
6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]")
# Create update cursor for feature class
#
with arcpy.da.UpdateCursor(ff_locs,
["Field2"]) as cursor:
# Delete all rows that have a roads type of 4
#
for row in cursor:
if row[0] != "m":
cursor.deleteRow()
# Process: Buffer
arcpy.Buffer_analysis(virginia_shape, virginia_shape_Buffer, "30 Miles", "FULL",
"ROUND", "ALL", "")
# Process: Clip
arcpy.Clip_analysis("ff_locs", virginia_shape_Buffer, va_mcd_locs, "")
# Process: Feature To Point
arcpy.FeatureToPoint_management(va_blocks, va_blocks_pts, "CENTROID")
for i in ["5"]:
Dist = i + " Miles"
# Process: Buffer (2)
arcpy.Buffer_analysis(va_mcd_locs, va_mcd_locs_Buffer + i, Dist, "FULL",
"ROUND", "ALL", "")
# Process: Spatial Join
arcpy.SpatialJoin_analysis(va_mcd_locs_Buffer + i, va_blocks_pts,
va_mcd_buffer_join + i, "JOIN_ONE_TO_ONE", "KEEP_COMMON", "POP10 \"POP10\" true true
false 4 Long 0 0 ,Sum,#,\\\\psf\\Home\\Downloads\\GIS downloads\\Adv GIS\\lab7.gdb\
\va_blocks_pts,POP10,-1,-1", "INTERSECT", "", "")
# Process: Summary Statistics
arcpy.Statistics_analysis(va_mcd_buffer_join + i,
va_mcd_buffer_join_Statistic + i, "POP10 SUM", "")

LAB 8

!4


s_trubetskoy_adv_gis_lab8.pdf - page 1/4
s_trubetskoy_adv_gis_lab8.pdf - page 2/4
s_trubetskoy_adv_gis_lab8.pdf - page 3/4
s_trubetskoy_adv_gis_lab8.pdf - page 4/4

Related documents


s trubetskoy adv gis lab8
tower
338 342warren om
ops 571 week 2 quiz
discover why you ought to1312
the talent of leasing condo1513


Related keywords