Category: Open Access

Download GIS data from ArcGIS servers using a simple command

A lot of geospatial data (GIS) in the world is stored on ArcGIS MapServers, a part of the Esri “stack” of products that municipalities and other governments use to manage and publish GIS data.

A lot of people want that data, and not every government has enabled the ArcGIS data hub features that make it easier to get. For an example data hub, check out Cook County, Illinois.

If you have ArcGIS software on your Windows computer, then it can be pretty easy to plug in the map server URL and manipulate and extract the data.

For the rest of us who don’t have a very expensive license for that software, you can use a “command line” tool (written in Python) on any computer to download any layer of GIS data hosted on the ArcGIS MapServer and automatically convert it to GeoJSON.

Tutorial

You’ll need to install the Python package pyesridump, from the OpenAddresses GitHub repository, created by Ian Dees and other contributors.

Installing pyesridump is easy if you have pip installed, using the command pip install esridump.

The next thing you’ll need is the URL to a layer in a MapServer, and these are not easy to find.

Finding data to download

I can almost guarantee the county where you live has one. Before you continue, check to see if your county (or other jurisdiction) has the “open data portal” add-on to their ArcGIS stack.

A handful of suggestions:

  • Here are links to the open data portals enabled by Esri for Lake County, Illinois, and Broomfield County, Colorado.
  • A reader suggested looking for MapServers for jurisdictions around the world by looking through Esri’s portal of open data called ArcGIS Hub.
  • Use a search engine to search for the URL pattern that’s common to ArcGIS servers: paste “inurl:arcgis/rest/services” into a search engine. (You can also limit this search to a particular domain name, say, “chicago.gov”, by adding “site:chicago.gov” to the search query, making the full search query “inurl:arcgis/rest/services site:chicago.gov”.

Once you locate a dataset you want, you can find the MapServer URL under About>Data Source on the right side of the page.

I normally find them by looking at the HTML source code of a MapServer I already know about.

For this example I’ll use one of the GIS layers in the Cook County, Illinois, election service MapServer – here’s the layer for the Cook County commissioners districts.

Fetch the data

Once you have the URL the command is simple:

esri2geojson http://cookviewer1.cookcountyil.gov/ArcGIS/rest/services/cookElectnSrvc/MapServer/11 cookcounty_commissioners.geojson

  • The first term, esri2geojson tells your computer which program to load.
  • The second term is the URL of the MapServer URL.
  • The third term is the filename and location where you want to store the file. I prefer running the command “inside” the folder where I want the file to be stored. You can also specify a full path of the file. On a Mac this would look like ~/Users/username/Documents/GIS/projectname/cookcounty_commissioners.geojson

After you enter the command into your computer’s terminal, press enter. esri2geojson will report back once, after it finds and understands the MapServer URL you gave it. When it’s done, the command will “close” and your computer’s terminal will wait for the next command.

Do you have questions, or need some help? Leave a comment below.

Cataloging the city’s emails about what staff said regarding Laquan McDonald’s death

Screen grab from the released Laquan McDonald video

The City of Chicago released a trove emails spread over eight PDF files containing 3,000 pages, on New Year’s Eve, wherein city staff, including from the mayor’s office, police department, law department, discussed how they should handle countless requests from the media for information about the police shooting of Laquan McDonald.

In the middle of the night on October 20, 2014, Chicago police officer Jason Van Dyke shot 17-year-old Laquan McDonald 16 times, killing him.

Over a year later, a dashcam video of the shooting was released, sparking protests, theresignation of Chicago’s Police Chief, a federal investigation, and calls for the Mayor and State’s Attorney to resign.

I set to work that night reading as many as I could, and gathering strangers on Twitter to help read and catalog them.

This blog post is intended to point to the Google Sheet where we – over a dozen people who congregated here via Twitter – recorded the details of each message, including what it said, what we think the communicators meant, and what information was missing.

Read the Laquan McDonald emails catalog.

Links between Emanuel’s campaign donors and their building projects

The Tribune called out Emanuel’s appearance at a press conference as an endorsement of a locally-designed skyscraper (Studio Gang and bKL Architecture) to be built by Wanda, a Chinese development company – it has yet to receive any approval. Photo: Ted Cox, DNAinfo.

The Chicago Tribune reviewed the campaign contributions of Mayor Rahm Emanuel’s top donors and linked each donor to how it does business with Emanuel or the city. The article overall discussed how easy it is for Rahm to raise more money than what’s probably necessary to be elected a second time.

The Tribune graciously provided this data as a simple table which I’ve republished here in order to add links to building permit information from Chicago Cityscape. The website I’ve developed lists company and person names in an immediately searchable form. Currently there are over 90,000 companies, architects, and property owners that have received a building permit since 2010. Use the Illinois Sunshine database to find out who’s contributing to whom in the Chicago election.

Note: You’ll see “listed under [many] names” for several companies; this indicates that the Chicago building permit database uses different spellings, or the company has changed their name.

[table id=1 /]

Neither the article nor this table are meant to indicate any wrongdoing – campaign donations are public and it’s common to receive them from companies that do business in Chicago. It’s the extent that the donation appears to pay for favors or favoritism over other donors (which may be competing companies), or what’s right, that determines when immorality becomes an issue (a connection that’s hard to demonstrate).

Get out of Googleville: my presentation on web mapping

Alternate headlines: Google Maps versus OpenStreetMap; why OpenStreetMap is better than Google Maps

I presented to the Chicago GIS Network Meetup group on February 5,2013, about alternatives to Google when it comes to mapping on the web. I created the presentation and outline a couple hours before giving it and came up with this slideshow with three frames.

Googleville 1 of 3

Google Maps and its data is a one-way street (or many one-way streets). Google will take data but won’t give it back.

Googleville 2 of 3

Google Maps has all of these features, but they’re easier to manipulate when you use an alternative. Alternatives like: MapBox, TileMill, OpenLayers, OpenStreetMap (made easy with JOSM), GeoCommons – I’m sure there are plenty more.

Googleville 3 of 3

OpenStreetMap is the Wikipedia of online mapping and geographic data. Considering switching to OSM.

Stolen Bike Registry data: Which train stations have the most bike theft?

If you can help it, don’t park your bike on the sidewalk under the tracks at the Clybourn Metra Station. Too many opportunities for theft here. 

The Stolen Bike Registry is a website created by Chicagoans for people to notify the community that their bike has been stolen. I make no claims to the accuracy or completeness (or anything) about this list or the dataset from which it was created. Because of less than optimal data collection practices, and a diversity of website users, the location information is difficult to comb through and present. I’ve used Google Refine to clean up some of the location data so that I can pick out the theft locations that represent CTA or Metra stations.

This is a list of the most reported bike theft locations that are CTA or Metra stations, from about June 13, 2006, to April 2, 2011, representing 1,740 bike theft reports*. It’s not known how many bike thefts were reported to the police because they don’t know.

CTA (13 stations)

Logan Square Blue Line CTA 8
Rockwell Brown Line CTA 5
Addison Brown Line CTA 2
Fullerton Red/Brown Line CTA 2
Paulina Brown Line CTA 2
Western & Milwaukee (Blue Line) CTA 2
Western Brown Line CTA 2
Addison Blue Line CTA 1
Chicago Brown Line CTA 1
Damen Blue Line CTA 1
Ashland Orange Line CTA  1
Cumberland Blue Line CTA 1
Wellington Brown Line CTA 1

The new bike racks at Clybourn Metra station are in a more visible spot. Maybe there’s even a security camera pointed at them some of the time. 

Metra (24 stations)

Clybourn Metra 19
Ravenswood Metra 18
Edgebrook Metra 4
Evanston Main Street Metra 2
Forest Glen Metra 2
Healy Metra 2
Lake Cook Metra 2
Ogilvie Metra 2
57th Street Metra 1
College Avenue Metra Train Station 1
Corner of Maple & Church in downtown Evanston, near Metra 1
Glenview Metra Station 1
Harlem Metra Station Berwyn, IL 1
Irving Park Metra Stop 1
Jefferson Park Metra 1
LaSalle Street Metra 1
Mayfair Metra 1
Metra Station at Davis Street, Evanston 1
Morton Grove Metra Station 1
Prairie Crossing Metra Station 1
Rogers Park Metra 1
Union Station Metra 1
Western Metra Station 1
Wilmette Metra 1

* Reports come from around the world. 10 dates have been excluded because their dates were anomalous, empty, or not possible.

Updated September 30 to correct a Metra station and combine it with another.