Tech Tip: Getting starting with PostGIS for geographic analysis

IRE and NICAR

For journalists hoping to analyze geographic data, the cost of geographic information system (GIS) software can be prohibitive. Fortunately, there are open-source, free solutions available for cost-cutting journalists who want to do spatial analysis.

Pursuing an open-source option is easier said than done. Often, open-source software can be difficult for the lay journalist to install and even begin to understand.

PostGIS for PostgreSQL database manager offers a solution that is free, robust and easy to use — assuming you know what you're doing.

Granted, when I received the assignment to install PostGIS for PostgreSQL on my Mac to handle spatial queries, I thought it would be relatively simple. However, like many computer users who scratch their heads at the concept of a command-line interface, I was in for a lot of work.

Fortunately, I was successful and would like to share with Uplink readers how to get a free spatial-querying database installed on your local machine.

BEFORE YOU GET STARTED

I should note that the following how-to was tested on a Mac computer, though PostgreSQL offers binaries of its programs for several operating systems, including Linux, Windows, FreeBSD and Solaris.

As a concurrent Windows user, I know that most steps that I detail should work for a Windows machine, though the details of commands may differ.

I would suggest that you download and install QGIS, another open-source GIS program that is useful for viewing geographic shapefiles. This will help you identify GIS files you may have on your local machine if you're not using a commercial GIS, such as ArcView. It is also useful in viewing GIS data after it has been imported into PostGIS.

POSTGRESQL INSTALLATION

First, you should go to the PostgreSQL Web site to download the Mac OSX binary package. The file includes an install program that will take all of the trouble out of having to install anything using the command line.

Once you have downloaded the package, which weighs in at about 54MB, begin the PostgreSQL installation by clicking on the install app. The default options for the program files and data files locations are appropriate, so I would not suggest changing them.

The installation will prompt you to create a password. This is the password you will use to log into the PostgreSQL database for the superuser – postgres – that the installation will create. A superuser is the default installation account that is automatically given full privileges to use the database. Unless you are worried about anyone accessing your data on your local machine, I suggest you make this password identical to the user on your MacOSX installation.

Nick McClellan is a master's student at the Missouri School of Journalism and worked with IRE as a graduate research assistant.

Tags:

Advertise in Uplink

IRE logo

The National Institute for Computer-Assisted Reporting is a joint program of
Investigative Reporters and Editors, Inc., and the Missouri School of Journalism.

141 Neff Annex, Missouri School of Journalism, Columbia MO, 65211, Tel. 573-882-2042, Fax 573-884-5544

All Rights Reserved