Lab – week 10: Self-assessment by 2 Dec. 2016

Name:______

In this lab, you will create a chloropleth map of homicides in New York and then create a web map using CartoDB.

Directions: Accomplish each task and write how you did it.

Part 1: Creating the chloropleth map using QGIS Task How you did it: Open QGIS and load nyc_homicides and nyc_counties from your PostGIS database. DatabaseDB Managerright-click tablesAdd to Canvas Save each layer as a shapefile on your local machine and replace the PostGIS tables in your QGIS Project with these new shapefiles*

Create a polygon layer called ‘grid3k.shp’ containing a 3x3km grid of rectangles covering same the geographic envelope as nyc_counties

Create a new shapefile called ‘grid3k_clip.shp’ by clipping the grid3k.shp to the nyc_counties layer.

Create a new shapefile called grid3k_clip_homicides.shp having a new field called ‘homicides’ that contains the count of homicides within each polygon.

In QGIS, make a chloropleth (graduated Color Scheme: color) map showing a gradient of homicides. Experiment with color and Classification scheme: classification schemes. Which ones did you choose? # of Classes:

Take a screenshot of your map and paste it Screenshot: into the cell to the right

*we do this to speed processing time— many QGIS tools slow WAY down when PostGIS layers are included as inputs. Part 2: Recreating the analysis using CartoDB instead of QGIS Task How you did it: Import the grid3k_clip and nyc_homicides layers into CartoDB. Hint: If you’re importing shapefiles, you only need the .shp, .shx, .prj and .dbf files in your .zip folder.

In CartoDB, write an SQL statement that SQL: counts the # of homicides in each polygon of grid3k_clip. Hint: use the_geom_webmercator as your geometry field.

Part 3: Making a webmap using CartoDB Task How you did it: Now make a chloropleth map from this query showing a gradient of homicides.

Experiment with color ramps and the Color Ramp: ‘Buckets’ ‘Quantification’ drop-downs. Which ones did you choose? Quantification scheme:

# of Buckets: Take a screenshot of your map and paste it Screenshot: into the cell to the right

Create a ‘visualization’ of your map Attach

Questions: 1) What are the differences between ‘Equal Interval’, ‘Natural Breaks (Jenks)’ and ‘Quantile’ classification schemes?

2) Did you prefer QGIS or CartoDB for this analysis? List some advantages and disadvantages of each.