Page 50 of 171

Even the grocery stores are bike-friendly in Portland

Kenda tube vending machine

Swipe your bank card and get a new inner tube, next to a repair stand to help you change it.

Mike Cobb sent me this photo of a vending machine outside the Green Zebra Grocery in Portland, Oregon, that sells Kenda brand bicycle inner tubes. These vending machines are more common in Germany and the Netherlands although I only spotted one in Berlin.

Fahrrad schläuche

A tube vending machine, Fahrrad schläuche in German, outside a bike shop in Berlin.

He says they have a repair stand under shelter, air pump, tethered tools, and all-weather electricity outlets, too.

“Yeah, I’ll shop there every time I’m within a 1/2 mile,” he said. Mike is busy planning Disaster Relief Trials around the country this year and we’re working to make one happen in Chicago. But we need a title sponsor who has thousands of dollars to donate.

Seattle DRT: did it! (photo by Fred Bretsch, FEMA Region 10)

Mike in Seattle after winning DRT there. Photo by Fred Bretsch, FEMA Region 10.

Finding interesting data in the building permits dataset

I had several great conversations with fellow #chihacknight visitors at the 1871 tech hub (222 W Merchandise Mart Plaza) about how to reveal more information about what’s being built in Chicago. I had introduced Licensed Chicago Contractors at the previous week’s hack night and tonight I showed site changes I made like how much faster it is now that I use DataTables’s server-side processing function.

Some of the discussions resulted in suggestions to try new tools and methods that would make processing the data more efficient, or more revealing. What are the ways I can aggregate the data, or connect to similar data from other sources?

One of the new features I announced I’ll be adding is statistics on building activity by neighborhood. I started testing some queries to see the results, and to find the query that outputs that information in a way that’ll pique users’ interests.

I calculated the aggregate estimated costs of all building permit activity for the past 90 days in select neighborhoods. All of the data was automatically generated using a simple MySQL query, but one that will get faster after switching to Postgres. (I eliminated any project whose estimated cost was less than $1,000 because there are many project types that are $0 to several hundred dollars.)

  • Logan Square: 77 projects, totaling $16,295,997.50 at a $211,636.33 average cost
  • West Loop: 30 projects, totaling $27,646,899.00 at a $921,563.30 average cost
  • Andersonville: 6 projects, totaling $358,770.00 at a $59,795.00 average cost
  • Bronzeville: 34 projects, totaling $17,050,662.00 at a $501,490.06 average cost
  • Hyde Park: 20 projects, totaling $13,492,265.00 at a $674,613.25 average cost
  • Humboldt Park: 35 projects, totaling $41,917,988.00 at a $1,197,656.80 average cost

How does Humboldt Park double the other neighborhoods’ average? I think it’s pretty simple: this $40 million Salvation Army residence that’s going to be built at 825 N Christiana Avenue.

The results for Bronzeville were higher than I expected because this is a distressed neighborhood that has lost of lot of population and has seen little development in the past several years. This isn’t to say the neighborhood is poor – I saw a report last fall that highlighted how the purchasing power of Bronzeville residents was quite high relative to neighboring communities.

Ronnie Harris showed me the report when I participated in the Center for Neighborhood Technology’s civic app competition and hackathon. We, along with Josh Engel, designed Build It! Bronzeville, although my participation was really pushing them to develop Josh’s game idea more and construct a paper version of it. Our team won the competition and Ronnie and Josh have kept working on it (I saw them at last week’s hack night).

Projects that pushed up Bronzeville’s average included several multi-family homes at around $1.4 million each on the blocks of 4700 and 4800 S Calumet Avenue.

Code discussion

I can’t test for the “Loop” right now in the way I have my data structured because a LIKE ‘%loop%’ query of the database will include “West Loop” records.

I need to change how the building permit data is stored – in my database – a little so that my site’s PHP codebase and MySQL queries can sift through the data faster. For example, I’m storing several key-value pairs as a JSON-encoded string in a TEXT field. One #chihacknight developer suggested I switch from MySQL to PostgreSQL because Postgres has native JSON-parsing functions.

I looked up how to use Postgres’s JSON functions and realized that, yes, I probably should do that, but that I also need to change the array structure of the data I’m encoding to JSON. In other words, with a tiny change now, I can be better prepared for the eventual migration to Postgres.

Going to worship at The Beer Temple takes too long

Minor suggestion to improve Elston-California-Belmont

A map of Belmont, Elston, California with lines and labels that show how I get to The Beer Temple and where I think the city should add car parking.

The Beer Temple opened two blocks from my house in Avondale last year, at 3185 N Elston Ave, on the six-way intersection of Belmont Avenue, Elston Avenue, and California Avenue. This intersection is beastly.

And it’s timed wrong. Since I live southwest of the great craft and imported beer store and it’s on the northwest corner of Elston (a diagonal street) and California, I have to cross twice. I make the first crossing, east-west across California at my street, and then walk north to the second crossing, north-south across Elston.

I cross at my street across California because there’s no light to wait for, and the crossing isn’t diagonal like my other option at Elston (which would mean I walk north, then diagonally south and east). Once I get to Elston, though, I’m screwed because the walk signal is about 15 seconds long but the wait for the next walk signal is about 90 seconds long.

It’s so long because the green for Elston is held for Elston traffic, but also held green for eastbound Belmont traffic that makes a right turn onto southeast-bound Elston. Instead of the walk signal being green for two phases of the cycle (for two of the three streets), it’s green for only one cycle: California’s.

This is because this six-way intersection is the less common type, the type with an island in the middle. It’s got the island because the three streets cross each other at different points and don’t share a common cross point. I’ve got to wait for two phases because Elston needs to stay green for Belmont traffic because you can’t have drivers waiting in the island area – too many cars may stack up and block cross traffic during another phase.

(At many intersections I would just cross whenever there’s a gap between fast-moving cars, but with six-way intersections you don’t always know from where a car will be speeding towards you.)

I get that, but that makes it suck for walking in this area. This design also makes it suck for people biking and driving to turn left from certain streets to other streets because they can’t make the left turn and keep on going. They make the left turn and then have to stop and wait for a second phase to keep going.

I’ve racked my mind for ideas on how to improve this intersection just mildly, in such a way that few would oppose (because that’s really the threshold you can’t cross to have a nice outcome in Chicago).

My idea? Add car parking in front of Dragon Lady Lounge in the “non-identified lane” there. It’s used as a travel lane, or a right-turn lane, depending on who’s driving and how they choose to maneuver their vehicle. It’s not needed for either because of the way traffic moves southbound on Elston past Dragon Lady Lounge and that Elston only has one travel lane in each direction on either side of this big intersection.

The parking would have the obvious benefit of putting customers closer to their destination, but would have the less obvious benefits of protecting people on the sidewalk, buffering noise and speeding vehicles from sidewalk users, and slow traffic past Dragon Lady Lounge when people are parking.

Using open data: Showing what projects licensed Chicago contractors are working on

The New City developer recently received permits for over $50 million of construction work across from the Lincoln Park REI.

The New City developer recently received permits for nearly $50 million of construction work across from the Lincoln Park REI.

I wrote in my last post that I found “pain” in the process of finding a licensed contractor in the city (the pain of finding one who can install in the public way remains unmedicated).

I wanted to provide more than a list (and a map) and EveryBlock has already answered “What’s going on across the street from my house?”. I wanted to add value by helping people answer the question, “What contractor should I choose?”

Several other sites help you do this, like BuildZoom, Angie’s List, and the Better Business Bureau, by showing you customer reviews or complaints. I needed something different from mimicking a review site (a lot of the businesses are also on Yelp) so I decided to answer the question, “What projects have these companies done?”

That’s where the City of Chicago’s open data portal comes in: it has a dataset for Building Permits.

Check out 180 Properties, LLC from Skokie, Illinois. They’ve had two permits issued within the last three months. One project, at 3705 N Hoyne Avenue, is for interior renovation: “Remove/replace cabinets, countertops, flooring, patch & repair drywall”. The estimated cost for the project is $80,000. Sound like the kind of contractor you’re looking for? Call them up or keep researching.

You can even see who else is working on this project. Burnham Nationwide is listed as an expeditor on this project which means they’re likely acting as the intermediary between the Chicago Department of Buildings and the companies actually doing the work. Burnham will do site plans, drawings, occupancy, and ensure everything is in order. The property owner is also listed in the permit information.

For people who want to explore construction activity the other way around, finding projects before contractors, I created a “Permits explorer” page. This page searches the Building Permits dataset to show the most recently issued permits for the most expensive projects. Right now a project to alter and renovate Chicago Vocational High School at 2100 E 87th Street has an estimated cost of $40 million. I didn’t realize how much the Department of Buildings is funded by permits until I saw the permit fees.

The permit fee for the school renovation would have been $372,598 fee but the dataset said the entirety was waived (likely because it’s a Chicago Public School). Other projects I reviewed had permit fees between $30,000 and $75,000.

Real estate speculators, development watchers, and editors of Curbed Chicago should find browsing permits useful. The list includes two projects associated with the New City development at Halsted Street and Clybourn Avenue, across from the Lincoln Park REI store. The two permits are held by 1515 N Halsted, LLC. The first is for a “3 story steel framed mixed-use retail, restuarant, assembly (movie theater) building” at 1500 N Clybourn Avenue (for an estimated cost of $26,403,193), and the second permit describes a 7 story parking garage at 710 W Schiller Street (for $21,518,012).

How it works

I used my programming magic – I prefer PHP – to query the Socrata Open Data API (or SODA) to look for the given contractor’s name in one of eight name fields (there are 16 name fields) and then return information about the most recent permits. The Building Permits dataset gives the project location, work description, and its estimated cost. I figured you could use the project’s estimated cost to gauge the kind of work the contractor does – is the contractor more familiar with big jobs, or little jobs?

This method isn’t the best. Ideally there’d be a relational database where the “Contractor ID” in the licensed contractors dataset would match a “Contractor ID” field in the permit dataset. But the licensed contractors dataset doesn’t have a unique ID field, and isn’t even on the data portal.

Instead, I’m finding contractor-to-project matches by finding the first two or three words of the contractor’s name at the beginning of eight of the 16 name fields in the permit field. SODA works quickly on the query and it passes the results back to PHP in no time.

In the future I’d like to pull in scores and reviews from Yelp and other sites that have APIs (Angies List and Better Business Bureau don’t), as well as try to determine the name of the building – if it has one – by querying OpenStreetMap Nominatim.

Outta left field: I recreated the city’s contractor listing website

The site looks good and works quickly on mobile devices.

LicensedChicagoContractors.com looks good and works quickly on mobile devices.

I’m working on a secret project to get something installed on the public way. The process to find out how to do it is as arduous as getting it done because you never finish learning the process. Every time you think you’ve figured something out, there’s something else.

To get the secret project installed I need a licensed contractor. Not only do a need a licensed contractor, but they must have the license to do work in the public way (versus doing work at your private property).

The Chicago Department of Buildings publishes a continually updated list of licensed contractors on its website but it’s annoying to use. There’s no search, no permanent links, and if you leave the window open long enough this weird session manager kicks in and stops you from browsing to the next page of results.

I asked my followers on Twitter the best way to scrape the data. The ever-amusing Dan O’Neill, who leads the Smart Chicago Collaborative (which hosts the Chicago Crash Browser), recommended just copying and pasting all 10 pages. That would work fine for the first time, but I might need to do it a second time when the data updates. Nick Bennett jumped in and used Selenium, a tool that automates web browsers. He said, “it’s inefficient but for a small job like that I figured why bother with something faster”.

I imported the data into a MySQL table and ran through some of my “standard” data cleaning methods (like trimming leading and trailing spaces, removing odd characters, and extracting good information into other columns, like phone numbers and ZIP codes).

With PHP – my favorite web language – I created a single page website that loads all 3,930 licensed general contractors extremely fast, loads the DataTables JavaScript library to enhance the table with search and sort. I used Bootstrap to make a responsive design meaning it adjusts to fit multiple screen sizes including smartphones and tablets.

I call it LicensedChicagoContractors.com.

The new website still doesn’t solve my problem of finding a company that can do work in the public way – I’m still working on this. The last online dataset I could find is on the city’s old http://egov.cityofchicago.org domain, and was cached by the Internet Archive’s Wayback Machine on January 25, 2010. Ideally this information – plumbers, public way, and general contractors – should be posted on the City’s data portal.