Thursday, December 3, 2009

Thursday Data: CIA World Factbook

The CIA World Factbook is operated by the U.S. Central Intelligence Agency.  Not only does it offer numerous maps and country-by-country information, it also provides world-wide data for download for use in tables (and subsequently for GIS).  Data categories include geography, people, economy, communications, transportation, and military. The data is updated every 2 weeks and rank orders countries by the data type (e.g. population highest to lowest).  

You can search the website for data, but it may be better to just download the whole Factbook (with or without PDF reference maps).  Once the files ares downloaded and extracted (from zip), you can search through the files for the data you want.  Data files are stored as both html and text.

Unfortunately, the file for each data table (e.g. population, GDP, etc.) is labeled only with a number, and there isn't a table (at least not one this blogger could find) explaining which number matches up with which data.  For instance, the file 2001rank.html gives GDP by country, but you don't know that until you open it.

What's probably the easiest way to find what you need is to open the rankorder folder--where the data files are kept--and open the file rankorderguide.html.  Then you can choose which data category to look under (say, economy), then the specific data you want (say, GDP).  The rank order is shown in html, but you can click "download data," which gives a text friendly format you can copy into a simple text editor, save, and then import into Excel. 

If you haven't seen it already, check out the Tuesday Tools entry to see Factbook's new KMLFactbook web app, which allows you to create Google Earth friendly KML files catered to the Factbook data you choose.