Midterm Presentation: Chicago Hipster Neighborhood

midterm chicago hipster neighborhood

Advertisements

Chicago Neighborhood Analysis Indicators

Class classification

1. Working class

2.Service Class

3. Creative Class (creative class diagram)

Compared Neighborhood

  • Wicker Park (Creative-hipster subgroup)
  • Pilsen (Working class neighborhood)
  • Englewood (Service Class Neighborhood)
  • Lakeview/Lincoln Park (Established Creative Class Neighborhood)
  • Logan Square (Potential Creative Class Neighborhood)

Chicago Neighborhood Indicators (chicago neighborhood analysis)

Household:

  • size
  • ethnic diversity
  • education level (>bachelor)
  • income
  • job

Existing building fabric:

  • typology
  • rent cost
  • house value
  • ownership
  • density

Transport and infrastructure:

  • distance to public transportation
  • traffic flow
  • parking availability
  • bicycle lane

local context:

  • restaurant
  • bar
  • coffee shop
  • grocery shop
  • farmers market

zoning:

  • residential
  • office
  • commercial

public facility/service:

  • public school
  • safety
  • health

green space:

  • recreational park
  • playground
  • dog park

Comparison Diagram

 chicago neighborhood comparison diagram

calculating bicycle lane percentage over neighborhood

with

rawdata as
(
–join the table, #of bike route in a neigh, total length of bike route in a neigh
select n.pri_neigh,
count(s.f_street) as totalroutes,
sum(st_length(s.geom)) as length,
sum(n.shape_area) as neigh_area
from jur_neighborhoods as n
left join cty_bikeroutes as s
on st_within(st_transform(s.geom,3435),n.geom)
group by pri_neigh
limit 100
)
–divide total lenght of bike route by neigh area
select pri_neigh,
sum(totalroutes),
sum(length),
(r.length/r.neigh_area)*100 as percentage
from rawdata as r
group by percentage, pri_neigh
order by percentage
;

Result

bicycle percentage table

Linking Point Data to Polygon Data Using QGIS and PostGIS SQL

This post explains two ways to use spatial joins between tables that have point and polygon geom fields. The first approach uses built in tools in QGIS to quickly make basic joins for initial analysis. The second approach uses PostGIS SQL queries with the potential to do far more sophisticated joins and data analysis.

QGIS Vector/Geometry Tools:

Screen Shot 2014-01-26 at 9.47.30 PM

QGIS provides a number of tools for analyzing and rebuilding vector layers in the “Vector” tab. This includes the “Geometry Tools/Multipart to Singleparts” command, which breaks a multipolygon into individual polygon elements. The “Analysis Tools/Points In Polygons” command is shown above. When a polygon layer and a points layer are selected, it will produce a new shapefile with the polygons + a new field that is a count of the number of points in each polygon. Here is a detailed walkthrough for this tool.

PostgreSQL Queries:

These queries use an INNER JOIN on rows where the result of the “st_within()” postgis function == TRUE. This function returns TRUE if the first geometry (“pts.geom”) is completely within the second geometry (“blocks.geom”).

This code will create a new table with all the fields from the point table for all of the points that fall within one of the polygons, and add an additional field that shows an ID for the polygon in which that point falls:

SELECT pts.*, blocks.gid as blockID
FROM “Detroit_BP1995_point” AS pts
INNER JOIN “Detroit_CityMap3_region_individualPoly” AS blocks
ON st_within(pts.geom, blocks.geom) AS result

This code joins the point table created by the SQL above to the original polygon table, generating a new polygon table with a count of points within each polygon. This allows for more sophisticated calculations, for instance, normalizing counts against the size of each polygon, etc. (This SQL needs some more work):

SELECT blockID, number_of_permits, total_cost, average_cost, geom FROM(
SELECT pts.blockID, COUNT(blockID) AS number_of_permits, SUM(“COSTBP”) AS total_cost, AVG(“COSTBP”) AS average_cost
FROM detroitTest04b as pts
LEFT JOIN “Detroit_CityMap3_region_individualPoly” as blocks
ON blocks.gid = pts.blockID
GROUP BY blockID) AS results
LEFT JOIN “Detroit_CityMap3_region_individualPoly” as blocks
ON results.blockID = blocks.gid