Sunteți pe pagina 1din 3

GEOG 496

2018/10/01 (Due on 2018/10/08 by 23:59:59, 0 point after due)

Assignment 5: GeoPandas

Instructions:
General
1. Use Jupyter Notebook
2. Create a new Python3 file, named “a05_yourlastname.ipynb” (e.g., a05_nara.ipynb)
3. Write your name, RedID, date using comments on the top the file
4. Whenever necessary, use comments to annotate your codes as much as you can. Comments
will be evaluated. Before writing the answer for a specific question, comment the question
number.
e.g.)
#Q1
Your script here

5. Answer the following questions.


6. Save your file and submit it to Blackboard.

Recap: Python module installation on a PC in SAL.


1. If you haven’t done yet, install modules, numpy, sheply, pandas, and geopandas into your PC in
SAL by opening a windows command prompt (press the Windows button & ‘R’, and then type
cmd on the popped up window to open Command Prompt) and type the following three commands
separately.

C:\Apps\Anaconda3\Scripts\Activate

C:\Apps\Anaconda3\Scripts\conda.exe install numpy


C:\Apps\Anaconda3\Scripts\conda.exe install pandas
C:\Apps\Anaconda3\Scripts\conda.exe install geopandas
C:\Apps\Anaconda3\Scripts\conda.exe install shapely

Questions
(1) Create a GeoDataFrame object containing point geometries by using the “GAS_STATIONS.csv” file
available on Blackboard (Course Documents -> Data -> Assignment 4).
Create a SRA GeoDataFrame containing polygon geometries by using the “acs_sra_2013_wgs84_v2”
shapefile available on Blackboard (Course Documents -> Data -> Assignment 4).
Visualize two GeoDataFrames using Folium.

(2) Print spatial reference systems for each GeoDataFrame.

(3) Re-project each GeoDataFrame to an appropriate StatePlane coordinates (SPC) system. Print spatial
reference systems and visualize for both after reprojection. Search an appropriate SPC system at:
http://spatialreference.org/

Page 1
GEOG 496
2018/10/01 (Due on 2018/10/08 by 23:59:59, 0 point after due)

(4) Count the number of gas stations per SRA and calculate the gas station density. Add those two columns
to the SRA GeoDataFrame object (i.e., the number of gas stations per SRA, the gas station density per
SRA). Use non-spatial join.

(5) Find 5 SRAs with a lower gas station density where the population density is greater than 500/km2

(6) Use the “Identity” operation to add the ASIAN population to gas station data.

(7) Create a 10km buffer around gas stations and visualize them on a map.

(8) Find areas, which do not overlap with the gas station buffer (Q6) and show on a map.

(9) Calculate distances from SDSU to all gas stations.

(10) Calculate distances from SDSU to SRAs.

(11) Create a function to generate a randomly distributed points within a specified range. The number
of points to be generated and the range should be input parameters. Use the function to generate
random 100 points within SRAs. Plot all points.

(12) Find all points that are within “San Diego” and “La Mesa”. Plot both SRAs and Points within two
cities.

(13) Identify geometric centroids of SRAs and plot them.

(14) Using Geoplot, create a cartogram based on SRAs and your choice of one attribute field to distort
geometries by its value.

(15) Using Geoplot, create a kernel density map of Gas Stations and visualize it.

* SRA-Polygon: Population counts on each column are aggregated at San Diego Sub-Regional Areas
using American Community Survey (ACS) 5-year estimates 2013.

SRA SRA code


NAME Name of SRA
TOTPOP Total population
MALE Total male population
FEMALE Total female population
WHITE Total non-hispanic white population
BLACK Total non-Hispanic black population
ASIAN Total Asian/Pacific Islander population
HISP Total Hispanic population
AGE4 Total population age 0 to 4
AGE14 Total population age 5 to 14

Page 2
GEOG 496
2018/10/01 (Due on 2018/10/08 by 23:59:59, 0 point after due)
AGE24 Total population age 15 to 24
AGE44 Total population age 24 to 44
AGE64 Total population age 45 to 64
AGE65 Total population age 65 and over

Page 3

S-ar putea să vă placă și