Category: States

Mapping guns in your town: is that okay?

This screenshot shows the pistol permit holders in Westchester County, New York. The highest density of permit holders appears to be at the border with Bronx County, also known as the northern edge of New York City. 

An ABC News story I read through the Yahoo! News website tells about The Journal News, covering Westchester (Yonkers, New Rochelle) and Rockland (New City, Pomona) counties in New York, posting the names and addresses, on a map, of gun permit owners. The map contains:

…the addresses of all pistol permit holders in Westchester and Rockland counties. Each dot represents an individual permit holder licensed to own a handgun — a pistol or revolver. The data does not include owners of long guns — rifles or shotguns — which can be purchased without a permit. Being included in this map does not mean the individual at a specific location owns a weapon, just that they are licensed to do so. [Notice that some dots are outside the county.]

This article is interesting to me for two reasons:

1. The article has hyperlinks to the (alleged?) Facebook profiles of two people who commented on The Journal News’s website. I predict this will only become more common. I don’t have a Facebook profile to link to.

2. The rationale to make a map seems reasonable: so people know where there are potentially guns in their neighborhood. It seems reasonable that people want to know where there are potential sources of danger and harm near them.

The names and addresses were obtained through “routine” (their words, not mine, but it is pretty routine and normal) Freedom of Information Act (FOIA) requests. The quantity and types of guns are not considered to be public record, although this may not be true, according to the ABC News article.

How I created a map of Illinois Amtrak routes in TileMill in less than 30 minutes

This interactive map was created for a Grid Chicago article to show the cities and Amtrak routes mentioned. Click and drag it around or hover your mouse on the red train station markers. 

Want to create a map like that and publish it on your own website? It’s easy. I’ll show you how to do it in less than 30 minutes. First, download the following files:

All shapefiles are from the United States Department of Transportation, Bureau of Transportation Statistics’s National Transportation Atlas 2012 edition except for Illinois places, which comes from the Census Bureau’s TIGER project.

At the end of this tutorial, you’ll have a good introduction on how to find geographic data, build a map with TileMill, style the map, and publish it for the public. Your map will not look like mine as this tutorial doesn’t describe how to add labels or use the hover/info feature.

Tutorial to make Amtrak Illinois map

  1. Unzip the four ZIP files you downloaded and move their contents into a folder, like /Documents/GIS/Amtrak Illinois/shapefiles. This is your project folder.
  2. Install TileMill and open it.
  3. Set up a project. In the Projects pane, click “New Project”. In the filename field, title it “amtrak_illinois”. Ensure that the checkbox next to “Default data” is checked – this shows a world map and helps you get your bearings (but it’s not absolutely necessary).
  4. Get familiar with TileMill’s layout. Your new project will open with the map on the left side and your Carto style code on the right side. There are four buttons aligning the left edge of your map. From top to bottom they are: Templates, Font list, Carto guide, and Layers.
  5. Add a layer. We’re going to add the four shapefile layers you downloaded. Click the “Layers” button and then click “Add layer”. In the ID field, type in “amtrak_routes”. For Datasource, browse to your project folder and find “amtrak.shp” – this file has the Amtrak route lines. Then click “Done”. Click “Save & Style”.
  6. Style that layer. When you click “Save & Style” after adding a layer, your attention will be called to the Carto style code on the right side of TileMill. A section of code with the “amtrak_routes” #selector will have been inserted with some default colors and styles. If you know CSS, you will be familiar with how to change the Amtrak routes line styles. Change the “line-color” to “#000”. After “line-color”, add a new line and insert “line-opacity: 0.5;”. This will add some transparency to the line. Press the “Save” button above the code.
  7. Add remaining layers. Repeat Step 5 and add 3 more layers: “amtrk_sta.shp” (ID field: “amtrak_stations”), “state.shp” (ID field: “states”), and “tl_2012_17_place.shp” (ID field: “illinois_cities”).
  8. Hide bus stations. The Amtrak stations layer shows bus and ferry stations as part of Amtrak’s Thruway connections. You probably don’t want to show these. In your Carto style code, rename the #selector from “#amtrak_stations” to “#amtrak_stations[STNTYPE=’RAIL’]”. That makes the following style code only apply to stations with the “rail” type. Since there’s no style definition for things that aren’t of that type, they won’t appear.

Screenshot of my map.

Prepare your map for uploading

TileMill has many exporting options. You can save it as MBTiles and publish the map for free using MapBox (TileMill’s parent), or you can export it as image files (but it won’t be interactive), or you can display the map using the Leaflet JavaScript map library (which I use for the Chicago Bike Map app). This tutorial will explain how to export MBTiles and upload to MapBox, the server I’m using to display the map at the top of this page.

  1. Change project settings. To upload to MapBox, you’ll have to export your project as MBTiles, a proprietary format. Click the “Export” button above your Carto style code and click “MBTiles”. You’ll be asked to provide a name, description, attribution, and version. Input appropriate text for all but version.
  2. Adjust the zoom levels. Adjust the number of zoom levels you want (the more you have the longer it takes to export and upload your project, and you might exceed MapBox’s free 50 MB account limit). My map has zoom levels 8-11.
  3. Adjust the bounds. You’ll then want to draw your bounds: how much of the map’s geographic extents you want to export. Zoom to a level where you can see the entire state of Illinois in your map. Hold down the Shift key and drag a box around the state, plus a buffer (so viewers don’t fall of your map when they pan to the edges).
  4. Export your map. Click Export and watch the progress! On a four-year-old MacBook it took less than one minute to export the project.
  5. Bring the export to your project folder. When export finishes, click the “Save” button and browse to your project folder. Click the file browser’s save button.
  6. Upload to MapBox. Login to MapBox’s website and click “Upload Layer”. Browse to your project folder, select the .mbtiles folder, and click “Upload file”. Upon a successful upload, your map will display.
  7. Embed it in your website. Click the “Share” button in the upper left corner of your map and copy the embed code. Paste this into the HTML source code of a webpage (or in a WordPress post) and save that (I’m not going to provide instructions on how to do that).

Now you know how to find geographic data, build a custom map using the TileMill application, begin to understand how to style it, and embed your map for the public on a website or blog.

N.B. I was originally going to use QGIS to build a map and then publish a static image before I realized that TileMill + MapBox (the website) can build a map but publish an interactive feature instead of a static image. I’m happy I went that route. However, I did use QGIS to verify the data and even create a new shapefile of just a few of the key train stations on the Lincoln Service (the centerpiece of my Grid Chicago article).

Brief history of suburbs and sprawl, according to Taras Grescoe’s “Straphanger”

The Metra station in Riverside, Illinois, a version 1.0 streetcar suburb designed by Frederick Law Olmsted and Calvert Vaux. 

I’m reading another book a publisher sent to me. It seems pretty biased, and it’s biased in the direction I already feel, so it’s really easy reading. But it seems that people like me are its only audience and that it assumes I’m already pro-cities, anti-suburbs and maybe even anti-car. Definitely not a book that’s going to espouse the benefits of transit to those who don’t use it, don’t want to use it, or are on the fence for either situation.

If I could get my father or brother to read this book, that would be an accomplishment just short of a miracle.

The book is Straphanger: Saving our cities and ourselves from the automobile, by Taras Grescoe. I really like the section I just finished reading, a “condensed history of sprawl”. I had recently “argued” with my father about the development of the subdivision he lives in, east of Phoenix. He posited that suburbs were the result of consumer desires. Grescoe writes to the contrary. Here we go:

The origin of the Anglo-American suburb has been traced to Clapham, five miles south of London, where, in the 1790s, Evangelical Christians eager to remove their families from the evils of the city began living in what had formerly been their weekend villas, and commuting to the City by private carriage. In the United States, [author Kenneth] Jackson dates the beginning of the process to 1815, when regular steam ferry service to Manhattan made Brooklyn Heights the nation’s first true commuter suburb. (page 89)

American suburb version 1.0

  • When: 1853 onward
  • What it was: picturesque, full of green space, near central cities, attached by rail line
  • Who lived there: As mortgages didn’t exist, only those who could afford to buy a home outright
  • Examples: Llewellyn Park, NJ; Riverside, IL.
  • Note: Ebenezer Howard’s “Garden City” design is related.

American suburb version 2.0

  • When: Post World War II
  • What it was: cheap, small housing on vast land tracts; pre-assembled homes
  • Who lived there: Families with soldiers that expanded quickly so new homes were needed fast.
  • Examples: Levittown, Long Island; Lakewood, Los Angeles.
  • Note: “The prevailing myth”, writes Kenneth Jackson, “is that the postwar suburbs blossomed because of the preference of consumers who made free choices in an open environment. Actually, most postwar families were not free to choose among several residential alternatives. Because of public policies favoring the suburbs, only one possibility was economically feasible”.

American suburb version 3.0

  • When: Late 1980s, 1990s to now
  • What it was: Found near office parks, also known as “edge cities”, “common interest communities” (gated and homeowners associations)
  • Who lived there: Single races (self-segregating), people who lean conservative
  • Examples: Silicon Valley, Nevada, Florida
  • Note: Under the George W. Bush administration, Fannie Mae and Freddie Mac offered easy credit and homeownership rate rose to 69% by 2004. “(By 2012, it is expected to drop to 62%, the lowest level since 1960.)”

American suburb version 4.0

  • When: 2008, easy credit crisis, underwater mortgages
  • What it is: Least glamorous, the clichéd image of the inner city has moved to the suburbs. Arizona has highest rate of property crime. Nevada and Florida, the most suburbanized states, have highest rates of violent crime (Florida also has highest rate of pedestrian and bicycle fatalities).
  • Who lives there: A diverse group of people.
  • Examples: See “What it is”
  • Note: “Humans are social animals. I [Kenneth Jackson] think the biggest fake ever perpetrated is that children like, and need, big yards. What children like are other children. I think we move children to the suburbs to control the children, not to respond to something the children want. In the city, the kids might see somebody urinate in public, but they’re much more at risk in the suburbs, where they tend to die in cars.”

What are those public policies as described in American suburb version 2.0?

The federal government had carrots and sticks. Carrots were subsidies for homeownership (could be deducted from income taxes) and no down payment required for returning soldiers. Sticks included redlining (racial segregation), propagated by the Federal Housing Administration and banks. Zoning was another stick, which dictated what could go where.

Another carrot was the federally-funded highway system, the “greatest public subside to private real estate in the history of the world”.

Finding data about traffic and roads in Illinois

There are two good websites that provide information about roads, traffic, and their many attributes. One is provided by the Illinois Department of Transportation (IDOT) called Getting Around Illinois (GAI). The second is the Traffic Count Database System (TCDS).

Both provide Average Daily Traffic (ADT) counts with TCDS making the information easier to find and presents more of it.

The GAI map has an important layer: jurisdiction. With that information you can determine who has “ownership” of a road. Jurisdiction has been an important factor in the nearly year-long delay of the Jackson Boulevard protected bike lane segment from Ogden Avenue to Halsted Street. IDOT has jurisdiction over this segment (which continues east to Lake Shore Drive; the road is also known as Route 66) and is requiring that the Chicago Department of Transportation do more analysis and revise their designs.

If you are looking for ADT counts, I highly recommend TCDS as it uses the more familiar Google Maps and doesn’t require the Microsoft Silverlight plugin (which is slow and often denigrated with poor usability applications).

GAI has truck routes and crash information as well.

Slicing the crash data into interesting visualizations

The Chicago Crash Browser as it looks now. This only exists on my laptop and no place else. I can’t put it online because it’s so inefficient it would kill the server. 

I presented my Chicago Crash Browser to attendees of an OpenGov Hack Night three weeks ago and gathered a lot of feedback and some interest from designers and programmers there.

We collaboratively came up with a new direction: instead of focusing on creating a huge web application that I proposed, we (anyone who wants to help) would start small with a website and a couple of crash data visualizations. The visualizations would serve two purposes:

  • attract attention to the project
  • start building a gallery of data-oriented graphics that describes the breadth and extent of the crash data

Continue reading