Code Monkey home page Code Monkey logo

chicagocrime's Introduction

ChicagoCrime

predictive modeling for crime rates in Chicago wards

Convert from "Community Area" to "Ward"

Definitions for "community areas" in Chicago can be downloaded as GIS shapefiles. The shapefile file data/chicomm.shp comes from http://www.lib.uchicago.edu/e/collections/maps/chicomm.zip

Some discussion of how to convert from shapefiles to more general purpose polygons is given in http://www.quora.com/How-can-I-convert-a-shapefile-to-a-lat-long-polygon-array-for-use-in-Google-Maps

Download, build, and install the GDAL and OGR utilities from http://www.gdal.org/ogr2ogr.html

./configure ; make; sudo make install

Download, build, and install the GEOS utilities from http://download.osgeo.org/

./configure ; make; sudo make install

Install the lxml package from http://lxml.de/ and the shapely package from https://pypi.python.org/pypi/Shapely based on instructions in http://osxastrotricks.wordpress.com/2010/07/19/install-python-shapely/

Next, we convert the shapefile to KML, then parse the KML to construct Shapely polygons as "LinearRings", based on http://toblerity.github.io/shapely/manual.html#linearrings

ogr2ogr -f "KML" foo.kml data/chicomm.shp
./src/py/shape.py foo.kml

chicagocrime's People

Contributors

ceteri avatar girish-a1 avatar girishsk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.