Category: Information

Use Turf to perform GIS functions in a web browser

Turf's merge function joins invisible buffers around each Divvy station into a single, super buffer.

Turf’s merge function joins invisible buffers around each Divvy station into a single, super buffer –all client-side, in your web browser.

I’m leading the development of a website for Slow Roll Chicago that shows the distribution of bike lane infrastructure in Chicago relative to key and specific demographics to demonstrate if the investment has been equitable.

We’re using GitHub to store code, publish meeting notes, and host discussions with the issues tracker. Communication is done almost entirely in GitHub issues. I chose GitHub over Slack and Google Groups because:

  1. All of our research and code should be public and open source so it’s clear how we made our assumptions and came to our conclusions (“show your work”).
  2. Using git, GitHub, and version control is a desirable skill and more people should learn it; this project will help people apply that skill.
  3. There are no emails involved. I deplore using email for group communication.*

The website focuses on using empirical research, maps, geographic analysis to tell the story of bike lane distribution and requires processing this data using GIS functions. Normally the data would be transformed in a desktop GIS software like QGIS and then converted to a format that can be used in Leaflet, an open source web mapping library.

Relying on desktop software, though, slows down development of new ways to slice and dice geographic data, which, in our map, includes bike lanes, wards, Census tracts, Divvy stations, and grocery stores (so far). One would have to generate a new dataset if our goals or needs changed .

I’ve built maps for images and the web that way enough in the past and I wanted to move away from that method for this project and we’re using Turf.js to replicate many GIS functions – but in the browser.

Yep, Turf makes it possible to merge, buffer, contain, calculate distance, transform, dissolve, and perform dozens of other functions all within the browser, “on the fly”, without any software.

After dilly-dallying in Turf for several weeks, our group started making progress this month. We have now pushed to our in-progress website a map with three features made possible by Turf:

  1. Buffer and dissolving buffers to show the Divvy station walk shed, the distance a reasonable person would walk from their home or office to check out a Divvy station. A buffer of 0.25 miles (two Chicago blocks) is created around each of the 300 Divvy stations, hidden from display, and then merged (dissolved in traditional GIS parlance) into a single buffer. The single buffer –called a “super buffer” in our source code – is used for another feature. Currently the projection is messed up and you see ellipsoid shapes instead of circles.
  2. Counting grocery stores in the Divvy station walk shed. We use the “feature collection” function to convert the super buffer into an object that the “within” function can use to compare to a GeoJSON object of grocery stores. This process is similar to the “select by location” function in GIS software. Right now this number is printed only to the console as we look for the best way to display stats like this to the user. A future version of the map could allow the user to change the 0.25 miles distance to an arbitrary distance they prefer.
  3. Find the nearest Divvy station from any place on the map. Using Turf’s “nearest” function and the Context Menu plugin for Leaflet, the user can right-click anywhere on the map and choose “Find nearby Divvy stations”. The “nearest” function compares the place where the user clicked against the GeoJSON object of Divvy stations to select the nearest one. The problem of locating 2+ nearby Divvy stations remains. The original issue asked to find the number of Divvy stations near the point; we’ll likely accomplish this by drawing an invisible, temporary buffer around the point and then using “within” to count the number of stations inside that buffer and then destroy the buffer.
Right-click the map and select "Find nearby Divvy stations" and Turf will locate the nearest Divvy station.

Right-click the map and select “Find nearby Divvy stations” and Turf will locate the nearest Divvy station.

* I send one email to new people who join us at Open Gov Hack Night on Tuesdays at the Mart to send them a link to our GitHub repository, and to invite them to a Dropbox folder to share large files for those who don’t learn to use git for file management.

Streetsblog Chicago deserves to come back

John and Steven dining at a restaurant table

John and I at Taqueria La Zacatecana in Avondale, where we first hashed out the details of what would become Grid Chicago that later transitioned into Streetsblog Chicago.

I haven’t talked about this here, but two months ago this weekend I got the message that Streetsblog Chicago wouldn’t continue because we didn’t raise enough money in the last fundraising round.

I didn’t talk about it here because I was busy with dealing with shutting that down, working with my partner John Greenfield to come up with a transition plan (to resurrect the site) and because I have myriad side projects that quickly and easily captured my newly-available attention. I eased right into developing those more and into involving myself in new jobs on a freelance basis.

Our readers dutifully expressed their support for my and John’s work at Streetsblog Chicago – providing an alternative voice for transportation and land use policy discussion.

The most heartening and unexpected expressions have come from the very agencies on which we report and criticize.

Our reporting was thoughtful and necessary they said, even though, and this has been unanimous, they sometimes disagreed with our perspective.

I believe their appreciation of our work has always been there but there was never a good moment, or a necessity, for them to make it known.

It’s heartening to know that our writing – advocating for safer streets, funding allocation that promoted efficient and active transportation, converting street space from moving cars quickly to moving people – was making its way in the corridors of the bureaucracies and street managers and place makers and bus operators.

I think what we did with Streetsblog Chicago was necessary, too, and I waited and worked to make it happen since 2007. I bided my time with this blog until meeting editor-in-chief Ben Fried in 2010. The conditions weren’t right then, and a friend at a 2011 Star Trek watching party (don’t ask) in Logan Square put me and John together after which we made the next best thing: Grid Chicago.

I want to keep writing Streetsblog Chicago and we need your help. John and I are raising $75,000 to resume publishing at very-close-to-before rate of five to seven original posts per week. Donate now.

We’ve already raised $36,905 and the Chicago Community Trust will give us $25,000 when we reach $50,000. The catch is that we must get there by April 8. Otherwise we’ll return all of the donations.

Since the January 8 hiatus we held a fundraiser in the pedway, which Moxie founder Daniel Ronan organized. We’ll be holding another fundraiser in Revolution Brewing’s taproom on Kedzie on Wednesday, March 26, at our donor appreciation party: Everyone is welcome but those who donate $100 on or before the party will get John’s book “Bars Across America” and their first round on the house.

I’m also putting together a tour of developments around Chicago near transit stations that have taken advantage of a city ordinance reducing their parking minimum. Save the date, Saturday, April 4.

The CTA must remove the Clark Junction bottleneck to modernize the Red Line

CTA Belmont bypass rendering

A CTA rendering shows what a bypass track for Brown Line trains north of the Belmont station might look like, alongside a new residential building on Wilton Street.

Ed. note: This is a guest post from Chicagoan Jacob Peters.

“Keep the RPM Project on Track – Uncouple the [Belmont Bypass] Roller Coaster” is the tagline for a new website called “Coalition to Stop the Belmont Flyover”.

Capacity is constrained at the Chicago Transit Authority’s Clark Junction track interchange (at approximately 3300 N Clark Street) which means that fewer Red Line trains can run than could be run if there wasn’t this conflict. In the same way there are opportunity costs in business, there are opportunity delays that are caused by this constraint on rail capacity.

For example, if there was no conflict at Clark Junction, then five more trains an hour could pass through the Red Line subway. This would increase Red Line capacity by 25 percent during rush hour, and fewer passengers would be left waiting for a train to arrive with space for them to board.

The way the website advocates against eliminating the bottleneck is hypocritical to the tagline of “keeping the Red Purple Modernization project” on track. That project, which would completely replace all track, viaducts, and embankments north of X station, and rebuild most stations (as well as widening and extending platforms) is largely based on a future service pattern that would run more and longer trains in the busiest transit corridor of Chicago.

This capacity increase would reduce their average commutes by a few minutes. Since the trains wouldn’t have to be spread out in order to maintain gaps in service for the Brown Line trains that need to cross the Red Line at Clark Junction, average wait times between trains would drop all along the Red Line at rush hour, further reducing commute times.

Lastly, when either the Brown, Purple or Red Lines are experiencing delays, and trains get bunched together, these delays ripple through the other lines. This happens because when a queue of delayed Brown Line trains are making their way through Clark Junction, Red Line trains must be held in order to let the delayed trains through the junction in an attempt to keep things moderately on schedule. If there was a bypass of this junction for northbound Brown Line trains, then a delay on either line would not affect the other. This would result in fewer days in which your commute is delayed.

Future capacity needs and current delay reduction is what the Belmont Bypass attempts to address. There may be other ways to achieve this with other alternatives, but the bypass would be far and away the cheapest and could be implemented soonest. Unless you plan to propose alternative means of resolving these conflicts, and funding mechanisms to make them possible, you are not really advocating to keep the RPM on track. Because without untying Clark Junction there is no true modernization.

Runoff election

The RedEye published on Monday an overview of the transit platforms from the two mayoral candidates that have made it into a runoff. (Mayor Rahm Emanuel didn’t receive a sufficient number of votes, 50 percent +1, in the February 24 election.) Chuy Garcia released his transportation and infrastructure platform about two days before the election.

Garcia paints a beautiful transportation issues platform, but when faced with a truly transformative project he is unwilling to uphold his call for “reliable transportation”. I want to vote for him again, but if he keeps on watering down projects to a point of inefficacy then how are you going to convince anyone to expand transportation funding? How can I trust him to bring about the change is needed on other important issues if on the issue that he received a masters in, he is unwilling to apply best practices?

Emanuel and Garcia should avoid grandstanding on issues of transportation because opposing a necessary transportation investment for political reasons is to let down the electorate that you are campaigning to serve. For both traversing Ashland Avenue by transit and riding Brown, Red, and Purple Line trains through Clark Junction, there is no way to move more people reliably through these areas without infrastructure improvements. Garcia shouldn’t oppose projects without explaining his alternate plan to address the same issues and achieve similar benefits – otherwise there isn’t leadership.

Alternatives

There are few alternatives. First, you could study how to use the existing CTA land around the Belmont stop more efficiently and eliminate track conflicts. It would need to be studied whether a new northbound Brown Line track and platform just to the east and a few feet higher than the current track it shares with the Purple Line could allow for the Brown Line to get high early enough to bridge over the Red Line closer to School.

This option would spare the buildings on the commercial thoroughfare of Clark, and focus demolition on residential streets.  I am not sure if it is possible given how the Belmont station was reconstructed in 2009, but I don’t have a record of it being studied or laid out why it is not an option. Seeing as the anti-bypass group is claiming that the destruction on Clark would turn it into a “permanent under-El wasteland” I would think they would want to prove whether this is possible or not.

Secondly, any alternatives analysis process [which the CTA hasn’t conducted] would include studying a subway alternative for this portion of the Red Line. In the RPM’s subway alternative there was no need for the bypass. The CTA considered a subway from Loyola station to Belmont station, but never studied each section of the potential subway separately. I truly believe that a subway with a portal at Clark Street and a portal just north of Irving Park Road would eliminate the property acquisition, station constraint, and construction phasing issues to outweigh the increased cost of going underground, without needing to consider a two-track alternative.

There was a neighborhood proposal from the 1980s for a subway between Belmont Avenue and Irving Park Road which would act somewhat as a “flyunder”, so to speak. It would include a new Wrigley Field Station that could be built to handle more than the existing constrained Addison Red Line station, including a Purple Line stop in order to match the Purple Line limited service that stops at Sheridan that’s provided on select game days.

The “flyunder” could allow the CTA to forego the large amounts of property acquisition that would be required in order to straighten out the kinks in the elevated north of Belmont, and to smooth out the curve at Sheridan. The CTA could then sell land currently under the tracks for development. In order to see if this is now feasible given the way Belmont was rebuilt, the CTA would have to study whether a bilevel tunnel from Clark Junction to Irving Park would be possible under Clark Street, and parallel to Seminary Avenue.

There is also the alternative of proposing that eliminating the realignment of the Red Line, included in the Belmont Bypass literature, would be a way to eliminate the amount of buildings affected in the scope of the bypass.  But I think that is somewhat tied into the discussion about the other two alternatives. The point is that the elevated bypass is a simple (although in the CTA’s current process, clumsy) solution to the question of how do you eliminate the Clark Junction bottleneck and the unreliability in the system that it creates.

This is why we need more people editing OpenStreetMap

Unmapped homes in the Irving Park community area

These homes were built after the City of Chicago’s building footprints dataset was created (2010?). Ian Dees imported the dataset in 2012. Many of the buildings that you can now see on Bing Maps have not been present on Bing’s satellite imagery since at least 2012.

1. OpenStreetMap is the world’s most complete free map, to which anyone can contribute their “ground truth” data (the location of wells and convenience stores, road names, and whether Lula Café at 2537 N Kedzie Boulevard in Logan Square has outdoor seating).

2. OpenStreetMap is used by thousands of non-profit and non-governmental organizations, corporations, apps, and people daily to locate themselves, locate others, get directions, and find places.

3. Nearly every map is out of date the moment it is published, including online, “current” maps like Google Maps, Bing Maps, their competitors, and OpenStreetMap.

4. Bing Maps provides its satellite imagery to OpenStreetMap editors – you and me – so that we can trace (copy) things on the planet to be things on the map. Google Maps doesn’t allow tracing (copying).

5. Bing updated its satellite imagery for Chicago (and probably a lot of other places) within the last six weeks…and there are hundreds of objects that aren’t yet mapped in OpenStreetMap. In Chicago most of these buildings are newly constructed houses.

Those hundreds of houses now need to be added to OpenStreetMap, with addresses, to complete the buildings collection in Chicago, and to expand the gazetteer (an address book) of places in Chicago.

I’m glad you want to help me do it! Here are two helpful things you can do:

  1. Start tracing the buildings yourself (here’s how new mappers can get started), or
  2. Leave notes at buildings which aren’t yet mapped so that map editors like myself know where to look to trace buildings.

Update: There’s a bonus third thing you can do, and that’s come to the next MaptimeCHI event on Thursday, February 26th, at the Chicago Community Trust (225 N Michigan, 22nd floor). RSVP for Anatomy of a Web Map. The Trust will also provide food and beverages. I’ll be there to teach new mappers and assist generally.

Adding notes is extremely helpful

You can contribute without editing by adding notes describing new things, or identifying problems with existing things. Click the “Add a note” button on OpenStreetMap.org.

Study recommends designing bike paths for bikes, not for sharing

running and bicycling on the lakefront trail

Some parts of the Chicago Lakefront Trail have a 2-foot wide side path designed for pedestrians but the study reviewed very cases where bicyclists crashed with pedestrians. It’s unknown if this side path results in fewer crashes than the parts of the Lakefront Trail without it. Photo: Eric Allix Rogers

The Active Transportation Alliance posted a link on Facebook to a new study [PDF] in the Open BMJ from December 2014, a free peer-reviewed “version” of the British Medical Journal, and said it “conclusively shows separated space reduces crashes and the severity of injuries when crashes occur”.

The posting was in the context that bicyclists and pedestrians using the Lakefront Trail should have separate paths. I agree, but there’s a problem in how they stated the study’s support for separation.

I wouldn’t say that the study “conclusively” shows that bicyclists would fare better on paths without pedestrians. The study reviewed fewer than 700 crashes in two Canadian cities. Only 11% of those crashes occurred on multi-use trails and only 5.9% of the crashes were with a pedestrian or animal (the two were grouped) – this sample size is too low from which to draw that kind of conclusion.

The study didn’t report the association (correlation) between crash severity and pedestrians. The authors didn’t even recommend that bicyclists and pedestrians have separate paths, but instead wrote “These results suggest an urgent need to provide bike facilities…that are designed [emphasis added] specifically for bicycling rather than for sharing with pedestrians”.

While I don’t discount the possibility that separating bicyclists and pedestrians in off-street corridors will reduce the number of crashes and injuries when those two user groups collide, it’s imprudent to call this study “conclusive” when linking it to the measure of crashes between bicyclists and pedestrians.

The study’s primary conclusion was that bicyclists crash more often when there are high slopes, fast moving cars, or no bike lanes and the authors recommended that bike infrastructure be built for bicycling. That’s a solid recommendation and I recommended that you sign Active Trans’s petition advocating for separate facilities in the North Lake Shore Drive reconstruction project.