Category: Tools

How to geocode a single address in QGIS

Since the last time I wrote about how to use BatchGeocode.com to perform pseudo-geocoding tasks in QGIS, there have been considerable improvements in the multi-platform, free, and open source GIS software. Now, geocoding (turning addresses into coordinates) is more automatic, albeit difficult to setup. (Okay, this has been around June 2009 and I just found out about it in October 2010.)

Once you install all the components, you’ll never have to do this again.

This method can only geocode one address at a time, but it will geocode all of the addresses into a single shapefile.

  1. Download QGIS.
  2. Download and install Python SetupTools. This includes the easy_install function that will download a necessary Python script, simplejson. On Mac you will have to use the Terminal (Applications>Utilities). Email me if you run into problems.
  3. Install simplejson. In the command line (Terminal for Mac; in Windows press Start>Run>”cmd”>Enter), type “easy_install simplejson”.
  4. Download the GeoCode plugin by Alessandro Pasotti via QGIS>Plugins>Fetch Python Plugins. You may have to load additional repositories to see it.
  5. Install geopy. In the command line (like step 3), type “easy_install geopy”.
  6. Specify your project’s projection in File>Project Properties.
  7. Get a Google Maps API key and tell the GeoCode plugin about it (QGIS>Plugins>GeoCode>Settings). You will need a Google account. If you don’t have your own domain name, you can just enter “google.com” when it asks for your domain.
  8. Geocode your first address by clicking on Plugins>GeoCode>Geocode. Type the full address (e.g. 121 N LaSalle Street, Chicago, IL for City Hall).
  9. The geocoded address will then appear in your Layers list as its own shapefile. All addresses geocoded (or reverse geocoded) in this project will appear in the same layer (therefore same attribute table).

Once you install all the components, you’ll never have to do this again. Geocoding will be available each and every time you use QGIS in the future on that workstation.

Tips

  • When you’re done geocoding,  save your results as a shapefile (right click the layer and click “Save as shapefile”). Twice I’ve lost my results after saving the project and quitting QGIS. When I reopened the project, the results layer was still listed, but contained no data.
  • Add a “name” column to the GeoCoding Plugin Results layer’s attribute table (toggle editing first). You can then type in the name of the building or destination at the address you geocoded. Edit the layer’s properties to have that name appear as a label for the point.

A map I made with QGIS showing three geocoded points of interest in Chicago. Data from City of Chicago’s GIS team.

 

Trying out new GIS software

I want to draw 50 and 120 feet buffers around the points of store entrances to show where bike parking should and shouldn’t be installed. I want to follow this example:

walgreens with bike parking buffers

Aerial photo of a Tucson, Arizona, Walgreens showing the location of existing bike parking and two buffers (50 and 120 feet) where proposed city rules would allow bike parking. I advocate for ratifying the 50 feet rule, which I’ve discussed on this blog and elsewhere many times.

I want to do this easily and accurately, so I will use GIS software to create a “buffer.” I use QGIS occasionally, but I want to try out other Mac-friendly applications. I’m getting my orthoimagery (geometrically corrected aerial photography) from the United States Geological Survey (USGS) using a web protocol called Web Map Server. I’m trying:

  • Cartographica, $495, with free trial license.
  • uDig, completely free software. UPDATE: I have had NO success getting any data to load from a WMS connection into uDig. I would like to understand why. Cartographica can obtain some of the WMS-stored data I want, although it messes up often.

I’m having success with neither – both are having issues downloading or maintaining a connection to the USGS orthoimagery. In one case, Cartographica trims the Bing Maps imagery to match the extent of my other objects (the buffer). In another case, it won’t even download the USGS imagery (and gives no indication that anything is happening). uDig hasn’t been able to download anything so far – I hope it’s asking for the current extent, instead of all data because it’s taking a looong time to do anything (so long that I just quit in the  middle of it).

This screenshot shows how to add new WMS connections to Cartographica.

UPDATE: I did it! I successfully used Cartographica (and the integrated Bing Maps) to create this drawing that shows the current (abysmal) bike parking at a Chicago Home Depot outside the 50 feet line.

Igniting the discussion on equity

I want to have more conversations about transportation equity

My master’s project is all about it. You might have read me talking about it a little here two weeks ago. A then I shot off a post with some key quotes I’m using about the topic in my project.

The purpose of the map is to show the difference in distribution between 2008 and 2009.

This post, though, is all about the graphic above. A lengthy conversation has begun in the comments on the Flickr page. I want more people to get talking about why 2008 might look the way it does, and why 2009 looks the way it does. Perhaps you need a little background on 2009: I made sure to visit the most underserved Wards you see in 2008 and ensure they receive new bike racks in 2009.

A big question is why people in those areas aren’t asking for bike racks. Does no one there ride a bike to the store? Or maybe they do but don’t know how to request a bike rack or know the purpose of one? Maybe they got a bike stolen and need some tips on proper locking.

Those are all questions I want my project to answer – and I’m working hard 20 hours per week to answer them! But I want more questions. I want ideas that point me to look in new directions. If you don’t like my response, tell me.

Bike parking is almost always mentioned in nationwide bike plans as a necessary way to complete the urban bicycling network. Mia Birk, “famous” bicycle planner, and principal at Alta Planning and Design in Portland, Oregon, says that bike parking is part of “the tool kit for successful 
bicycle infrastructure in cities.” Another Portland entity is aware of equity: BikePortland.org.

What’s going on here? Photo by Eric Rogers.

Update on GIS information for Haiti

We all woke up this morning to see news that another earthquake has happened in Haiti, near the center of the first one eight days ago.

“The United Nations Development Programme (UNDP) employed nearly 400 Haitians in cash-for-work activities to jump start the local economy and facilitate the delivery of urgently needed humanitarian assistance.”

This post is an update to my previous article about how GIS is used for disaster relief efforts. I recently came across a webpage on Harvard’s China Earthquake Geospatial Research Portal that lists copious, up-to-date, GIS-compatible data from organizations around the world. The portal began in response to the Sichuan, China, earthquake in May 2008.

Visit the Haiti GIS Data Portal now.

For new GIS students, this would be a great starting point for a class final project. The Portal is hosting the datasets as a public service and invites anyone with relevant data to submit it to the site operators for wider dissemination. Data comes from the United Nations, several universities, OpenStreetMap contributors, and the German Center for Air and Space Travel, among others.

“Petty Officer 3rd Class Cameron Croteau, a Damage Controlman aboard the Coast Guard Cutter Oak, carries an injured Haitian girl to an awaiting Coast Guard HH-60 Jayhawk helicopter Tuesday, Jan. 19, 2010. Coast Guard and Navy helicopters airlifted injured Haitians to a private hospital in Milot, Haiti. U.S. Coast Guard photo by Petty Officer 3rd Class Brandyn Hill.”

As I mentioned in the previous post, there are many photos on Flickr when you search for “haiti earthquake.” When I wrote the post on January 14, 2010, there were only about 300 photos, and now there are over 6,900. Only 1,200 have a Creative Commons license, though (both of the photos above have a Creative Commons license). It seems that the United States Military, the United Nations, and major relief organizations are providing the majority of photos. And they’re uploading them fast. The number of photos on Flickr jumped by 50 from when I started this paragraph.

How GIS helps earthquake relief efforts for Haiti

While Geographic Information systems software can definitely produce pretty maps, its power lies in analyzing data and plotting or comparing sensory or observed data to spatial data (like roads or terrain). The earthquake in Haiti rocked the capital city, Port-au-Prince with a shock of magnitude 7.0 on Tuesday, January 12, 2010.

A photo from a United States military flyover shows damage in the Port of Port-au-Prince, Haiti. Photo taken by Petty Officer 2nd Class Sondra-Kay Kneen and uploaded by Chuck Simmins.

There are several applications for GIS to help with earthquake response, and two blog posts that appeared this morning shed light on how.

The first article came from ESRI, the California-based makers of ArcGIS, the most used GIS application. The article linked to a user-built map on their ArcGIS Online service showing on Bing maps where the earthquake and its aftershocks struck (the map sits behind a registration wall). ESRI even has a disaster response team that helps organizations get their response projects off the ground quickly.

Infrastructurist posted the second article, showing some before and after satellite imagery of Haiti, provided by Google and GeoEye.

So what can GIS do? From ESRI’s list, “GIS for Disaster Response“:

  • Rapid identification of potential shelter/housing locations (schools, libraries, churches, public buildings) appropriate for supporting affected populations.
  • Determine how many tents will be needed based on the location of populations affected by the disaster.
  • Analyze areas where large numbers of refugees can establish camps out of harm’s way that are accessible for supply delivery and have access to water and other resources necessary to support large numbers of people.
  • Many more examples.

Want more information? Here’s where to get it: