<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Notebook &#187; Mapping</title>
	<atom:link href="http://eniya.com/notebook/category/mapping/feed/" rel="self" type="application/rss+xml" />
	<link>http://eniya.com/notebook</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 21 Sep 2009 04:12:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zip Code, Latitude, Longitude, City, State</title>
		<link>http://eniya.com/notebook/2008/09/27/zip-code-latitude-longitude-city-state/</link>
		<comments>http://eniya.com/notebook/2008/09/27/zip-code-latitude-longitude-city-state/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 21:09:32 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Mapping]]></category>

		<guid isPermaLink="false">http://www.eniya.com/notebook/2008/09/27/zip-code-latitude-longitude-city-state/</guid>
		<description><![CDATA[
Recently Eric Meyer asked how to translate thousands of postcodes into city and state. For large datasets, your best bet may be a commercial geocoding service. Google and the USGS both use Tele Atlas, for instance. However, if you just want something to play with, you have several options. You can pre-process your data with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.eniya.com/notebook/wp-content/uploads/2008/09/map.gif" alt="" /></p>
<p>Recently <a href="http://meyerweb.com/eric/thoughts/2008/09/23/survey-mapping/">Eric Meyer asked</a> how to translate thousands of postcodes into city and state. For large datasets, your best bet may be a commercial geocoding service. Google and the <a href="http://earthquake.usgs.gov/eqcenter/dyfi/background.php#geocode">USGS</a> both use <a href="http://www.teleatlas.com/OurProducts/MapEnhancementProducts/Geocoding/index.htm">Tele Atlas</a>, for instance. However, if you just want something to play with, you have several options. You can pre-process your data with the <a href="http://www.census.gov/geo/www/tiger/zip1999.html">1999 U.S. Postal Service ZIP Codes</a> and <a href="http://www.census.gov/geo/www/fips/fips.html">Federal Information Processing Standards (FIPS) Codes</a> from the US Census Bureau. Use MS Access to import the zipnov99 dBase file and then export as a tab delimited text file. The result includes Zip Code, latitude, longitude, state code, county code, and a few other codes. The state and county codes match the FIPS codes, which then give you the full state and county.</p>
<p>You could also use the <a href="http://weather.unisys.com/wxp/etc/zip.raw">United States Zip Code Database (updated 2/99)</a> available from <a href="http://weather.unisys.com/info/stations.html">Unisys Global Station Index Information</a>. This is a National Weather Service related data product, and contains state, country, latitude, longitude, and elevation of weather stations.</p>
<p>To use the 1999 geocode data, I wrote a small <a href="http://eniya.com/demo/map/combine.txt">Perl script</a> that reads multiple data files, matches each Zip Code with the corresponding geocode data, and then outputs a single combined file.</p>
<p>For data visualization, I uploaded the resulting tab delimited file to a <a href="http://spreadsheets.google.com/">Google Spreadsheet</a>, and then used the <a href="http://gmaps-samples.googlecode.com/svn/trunk/spreadsheetsmapwizard/makecustommap.htm">Google Map Wizard</a> to output the map code. This is an easy way to put any location on a map. You can also add information and links to each marker.</p>
<p>What follows is a Google map for the processed <a href="http://eniya.com/demo/map/combined_ca.txt">California data</a> from the <a href="http://alistapart.com/articles/survey2008">2008 Survey results</a>. A few Zip Codes did not match the 1999 data and are not included. Please note there are nearly 2,000 data points, so there will be a delay when the data loads. Loading will also max your CPU temporarily, and the map will be a bit slow when you zoom. Here is the <a href="http://eniya.com/demo/map/map.html">map demo</a>.</p>
<p>If you don’t have thousands of addresses, you may be interested in <a href="http://code.google.com/apis/maps/articles/phpsqlgeocode.html">geocoding addresses with PHP/MySQL</a> instead. You may also be interested in Ben Fry’s <a href="http://benfry.com/zipdecode/">zipdecode</a> project, which is further described in his book, Visualizing Data.</p>
<p>Comments are moderated.</p>
]]></content:encoded>
			<wfw:commentRss>http://eniya.com/notebook/2008/09/27/zip-code-latitude-longitude-city-state/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
