Tag: OpenStreetMap

Where do those weird Chicago place labels on certain maps come from?

Andrew Huff pointed out some archaic neighborhood names he saw on a map that was generated using Carto. The company’s map “tiles” use free and open source data from OpenStreetMap, “the Wikipedia of maps”.

I’m going to tell you where these names come from!

Chicago cartographer Dennis McClendon has also written about the names.

I had a similar question as Andrew several years ago. (Note: I’m a very active OpenStreetMap editor, and I add/change/delete things from the map multiple times a week.)

First, we have to find that place name in the OpenStreetMap database, after which we can discover its provenance. The best way to do this is to search Nominatim, the “debugging search engine” for OSM.

I searched for “Summerdale” because that sounds unique. The fourth result is the right match, so go ahead and open that place name’s details page.

That details page still doesn’t tell us what we need to know, but there’s a link called that starts with “node” that leads deeper into the OSM database.

On the page “Node: Summerdale (153430485)” there are a bunch of “tags” that describe this place’s record in the OSM database. Some of those tags start with “gnis”, which is an abbreviation for “GeoNames Information System”, commonly shortened to GeoNames.

GNIS is managed by the U.S. Board of Geographic Names, which is part of the United States Department of Interior’s U.S. Geological Survey (commonly known as USGS).

We can use the GNIS Feature Search site to look up Summerdale by name or ID. (Using name is easier, and I recommend narrowing it to the state of Illinois.)

There are four results for “Summerdale” in Illinois, and two are in Cook County, and one of these is a church, and the other a “populated place”. We want the populated place result.

Here’s where our journey ends, because this result page tells the citation of how “Summerdale” got to be in a United States federal government database of place names.

Hauser, Philip M. and Evelyn M. Kitigawa, editors. Local Community Fact Book for Chicago 1950. Chicago, Illinois : University of Chicago, 1953. p18

Finding the original source

You can find that book in the Newberry library in Chicago. Request it on their computer and a librarian will fetch and bring it to you. I did that in 2015 (which was also the first time I visited the library).

Uptown community area page in the 1950 Local Community Fact Book

Here’s what that book looks like, and you can see “Summerdale” mentioned at the end of the third paragraph on the page for the Uptown community area (which is an official place with a permanent boundary):

During the 1870’s and 1880’s, Uptown was still predominantly open country. The area east of Clark Street, from Montrose to devon, was a farming community. At each of the station that had been opened on the Chicago and Milwaukee line –at Argyle, Berwyn, Bryn Mawr and Devon Avenues–there were a few frame residences. West of Clark Street, a substantial portion of the land was swampy. Scattered settlements, chiefly the frame cottages of railroad employees, appeared along the Northwestern railroad tracks. An important factor in the growth of this area was the opening of the Ravenswood station at Wilson Avenue. The opening of another station on this line at Foster Avenue, eventually gave his to the settlement of Summerdale.

I haven’t answered Andrew’s other question, on why Lincoln Square or Uptown, official community areas with permanent boundaries, don’t show on Carto’s map.

That’s because no one has imported these boundaries or these place names into OpenStreetMap. You can do it, and here’s how.

Designing a new static map style for Chicago Cityscape

I redesigned the static maps that are shown on Chicago Cityscape’s Place pages to tone down their harsh hues, and change what data (which comes from OpenStreetMap) is shown.

All 2,800 maps are automatically generated using a program called MOATP (“Map of all the places”) which is based on Neil Freeman’s svgis program. Both programs are open source.

The map now shows all roads; it was awkward to see so many empty spaces between buildings. Secondary* and residential roads are shown with slightly less thickness than primary and motorway roads. Also included are multi-use trails in parks.

Parks and grass are shown in different hues of green, although I don’t think it’s distinctive enough to know there’s a difference. Cemeteries remain a darker green.

I’ve changed the building color to soften the harsh brown. Only named buildings and schools appear, which is why you see a lot of gaps. Most buildings outside downtown aren’t named.

Retail areas have been added in a soft, salmon and tan-like color to show where “activity” areas in each Place.

I’ll be uploading the new maps soon.

* These road categories come from the OpenStreetMap “highway” tag.

At least 2.5 percent of the land area in Chicago is covered in parking lots and garages

Here’s how I know that at least 2.5 percent of the land area in Chicago is covered in parking lots and garages, as of February 5, 2017.

That’s a lot of polluted water runoff.

I grabbed the land area of 227.3 from the Wikipedia page.

I grabbed all the parking lots from OpenStreetMap via Metro Extracts, which is going to be the most complete map of parking lots and garages.

Volunteer mappers, including me, drew these by tracing satellite imagery.

With the parking lots data in GIS, I can count their area in square feet, which comes out to 160,075,942.42. Convert that to square miles and you get 5.74.

5.74/227.3*100 = 2.5 percent

The last snapshot of parking lot data I have is from February 2016, when only 3.39 square miles of parking lots have been drawn.

There are still many more parking lots to be drawn!

How to extract highways and subway lines from OpenStreetMap as a shapefile

It’s possible to use Overpass Turbo to extract any object from the OpenStreetMap “planet” and convert it from a GeoJSON or KML file to a shapefile for manipulation and analysis in GIS.

Say you want the subway lines for Mexico City, and you can’t find a GTFS file that you could convert to shapefile, and you can’t find the right files on Sistema de Transporte Colectivo’s website (I didn’t look for it).

Here’s how to extract the subway lines that are shown in OpenStreetMap and save them as a GIS shapefile.

This is my second tutorial to describe using Overpass Turbo. The first extracted places of worship in Cook County. I’ve also used Overpass Turbo to extract a map of campgrounds

Extract free and open source data from OpenStreetMap

  1. Open the Overpass Turbo website and, on the map, search for the city from which you want to extract data. (The Overpass query will be generated in such a way that it’ll only search for data in the current map view.)
  2. Click the “Wizard” button in the top toolbar. (Alternatively you can copy the code below and paste it into the text area on the website and click the “Run” button.)
  3. In the Wizard dialog box, type in “railway=subway” in order to find metro, subway, or rapid transit lines. (If you want to download interstate highways, or what they call motorways in the UK, use “highway=motorway“.) Then click the “build and run query” button.
  4. In a few seconds you’ll see lines and dots (representing the metro or subway stations) on the map, and a new query in the text area. Notice that the query has looked for three kinds of objects: node (points/stations), way (the subway tracks), relation (the subway routes).
  5. If you don’t want a particular kind of object, then delete its line from the query and click the “Run” button. (You probably don’t want relation if you’re just needing GIS data for mapping purposes, and because routes are not always well-defined by OpenStreetMap contributors.)
  6. Download the data by clicking the “Export” button. Choose from one of the first three options (GeoJSON, GPX, KML). If you’re going to use a desktop GIS software, or place this data in a web map (like Leaflet), then choose GeoJSON. Now, depending on what browser you’re using, a couple things could happen after you click on GeoJSON. If you’re using Chrome then clicking it will download a file. If you’re using Safari then clicking it will open a new tab and put the GeoJSON text in there. Copy and paste this text into TextEdit and save the file as “mexico_city_subway.geojson”.

Overpass Turbo screenshot 1 of 2

Screenshot 1: After searching for the city for which you want to extract data (Mexico City in this case), click the “Wizard” button and type “railway=subway” and click run.

Overpass Turbo screenshot 2

Screenshot 2: After building and running the query from the Wizard you’ll see subway lines and stations.

Overpass Turbo screenshot 3

Screenshot 3: Click the Export button and click GeoJSON. In Chrome, a file will download. In Safari, a new tab with the GeoJSON text will open (copy and paste this into TextEdit and save it as “mexico_city_subway.geojson”).

Convert the free and open source data into a shapefile

  1. After you’ve downloaded (via Chrome) or re-saved (Safari) a GeoJSON file of subway data from OpenStreetMap, open QGIS, the free and open source GIS desktop application for Linux, Windows, and Mac.
  2. In QGIS, add the GeoJSON file to the table of contents by either dragging the file in from the Finder (Mac) or Explorer (Windows), or by clicking File>Open and browsing and selecting the file.
  3. Convert it to GeoJSON by right-clicking on the layer in the table of contents and clicking “Save As…”
  4. In the “Save As…” dialog box choose “ESRI Shapefile” from the dropdown menu. Then click “Browse” to find a place to save this file, check “Add saved file to map”, and click the “OK” button.
  5. A new layer will appear in your table of contents. In the map this new layer will be layered directly above your GeoJSON data.

Overpass Turbo screenshot 4

Screenshot 4: The GeoJSON file exported from Overpass Turbo has now been loaded into the QGIS table of contents.

Overpass Turbo screenshot 5

Screenshot 5: In QGIS, right-click the layer, select “Save As…” and set the dialog box to have these settings before clicking OK.

Query for finding subways in your current Overpass Turbo map view

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“railway=subway”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “railway=subway”
node["railway"="subway"]({{bbox}});
way["railway"="subway"]({{bbox}});
relation["railway"="subway"]({{bbox}});
/*relation is for "routes", which are not always
well-defined, so I would ignore it*/
);
// print results
out body;
>;
out skel qt;

How to make a map of places of worship in Cook County using OpenStreetMap data

The screenshot shows the configuration you need to find and download places of worship in Cook County, Illinois, using the Overpass Turbo website.

If you’re looking to make a map of churches, mosques, synagogues and other places of worship, you’ll need data.

  • The Yellow Pages won’t help because you can’t download that.
  • And Google Maps doesn’t let you have a slice of their database, either.
  • There’s no open data* for this because churches don’t pay taxes, don’t have business licenses, and aren’t required to register in any way

This where OpenStreetMap (OSM) comes in. It’s a virtual planet that anyone can edit and anyone can have for free.

First we need to figure out what tag people use to identify these places. Sometimes on OSM there are multiple tags that identify the same kind of place. You should prefer the one that’s either more accurate (and mentioned as such in the wiki) or widespread.

The OSM taginfo website says that editors have added over 1.2 million places of worship to the planet using amenity=place_of_worship.

Now that we know which tag to look for, we need an app that will help us get those places, but only within our desired boundary. Open up Overpass Turbo, which is a website that helps construct calls to the Overpass API, which is one way to find and download data from OSM.

Tutorial

In the default Overpass Turbo query, there’s probably a tag in brackets that says [amenity=drinking_fountain]. Change that to say [amenity=place_of_worship] (without the quotes). Now change the viewport of the map to show only the area in which you want Overpass Turbo to look for these places of worship. In the query this argument is listed as ({{bbox}}).

The map has a search bar to find boundaries (cities, counties, principalities, neighborhoods, etc.) so type in “Cook County” and press Enter. The Cook County in Illinois, United States of America, will probably appear first. Select that one and the map will zoom to show the whole county in the viewport.

Now that we’ve set the tag to [amenity=place_of_worship] and moved the map to show Cook County we can click “Run”. In a few seconds you’ll see a circle over each place of worship.

It’s now simple to download: Click on the “Export” button and click “KML” to be able to load the data into Google Earth, “GeoJSON” to load it into a GIS app like QGIS, or “save GeoJSON to gist” to create an instant map within GitHub.

*You could probably get creative and ask a municipality for a list of certificates of occupancy or building permits that had marked “religious assembly” as the zoning use for the property.