Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ParkYou!

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for NYC PyLadies NYC PyLadies
March 24, 2014
59

 ParkYou!

Presented by Tanya M. at the following event: http://www.meetup.com/NYC-PyLadies/events/165790242/

Avatar for NYC PyLadies

NYC PyLadies

March 24, 2014

Transcript

  1. Motivations…. 1. Parking tickets. 2. Wanting to work on an

    app. 3. Whoa, what’s this? http://smoothparking.com/
  2. Data - where do I get it? Scraping (using scrapy)

    http://a841-dotvweb01.nyc.gov/ParkingRegs/ViewController/LocationValidation.aspx NYC Open Data • shapefile http://www.nyc.gov/html/dot/html/about/datafeeds.shtml#ParkingReg • locations (CSV) https://data.cityofnewyork.us/Transportation/Parking-Regulation-Sign- Locations/zibd-yb3i • street segments (CSV) https://nycopendata.socrata.com/Transportation/Parking- Regulations-Street-Segments/9yzr-h7jq • 385,988 points
  3. Transforming Data GDAL http://www.gdal.org/ • translating library for geospatial formats

    PyShp - Python Shapefile Library - http://code.google.com/p/pyshp/ • shapefiles contain GIS information in a geospatial vector format • store geographic points and attributes/properties GeoJSON + JSON format for geographic collections ( geometries and features) + nested collections
  4. GeoJSON example { "type": "FeatureCollection", "features": [ { "type": "Feature",

    "geometry": { "type": "Point", "coordinates": [102.0, 0.6] }, "properties": { "prop0": "value0" } }, { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] ] }, ….}
  5. Database? MongoDB https://www.mongodb.org/ Why? • WebScale, yeah! • geospatial indexing

    • geospatial querying geo_within_center – simplified geo_within the flat circle radius of a point eg: loc.objects(point__geo_within_center=[(-125.0, 35.0), 1])
  6. Choosing libraries 1. Flask - Python Microframework http://flask.pocoo.org/ a. Jinja2

    - Templating language for Python http://jinja.pocoo.org/docs/ 2. Mongoengine - Python ORM for MongoDB http://mongoengine-odm.readthedocs.org/en/latest/index.html 3. Google Maps JavaScript API v3 https://developers.google. com/maps/documentation/javascript/tutorial
  7. Challenges 1. Rendering maps with accurate signage 2. Making a

    responsive interface a. limiting processing/data retrieval to area in the viewport b. Pre-computing c. Understanding Mongo performance