<?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"
	>

<channel>
	<title>indiemaps.com/blog</title>
	<atom:link href="http://indiemaps.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiemaps.com/blog</link>
	<description>the notebook of cartographer zachary forest johnson</description>
	<pubDate>Sat, 23 May 2009 07:01:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Lens tools and fisheye map browsing</title>
		<link>http://indiemaps.com/blog/2009/04/lens-tools-and-fisheye-map-browsing/</link>
		<comments>http://indiemaps.com/blog/2009/04/lens-tools-and-fisheye-map-browsing/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 23:30:23 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[fisheye]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[lens tool]]></category>

		<category><![CDATA[map browsing]]></category>

		<category><![CDATA[mapping]]></category>

		<category><![CDATA[panning]]></category>

		<category><![CDATA[semantic zoom]]></category>

		<category><![CDATA[ui]]></category>

		<category><![CDATA[visualization]]></category>

		<category><![CDATA[zooming]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=89</guid>
		<description><![CDATA[L.A.&#8217;s Cartifact recently released Cartifact Maps, a Flash-based tilemaps viewer with custom cartography and advanced map browsing tools.  The historic overlays and beautiful cartographic design are perhaps of most interest, but I&#8217;m equally impressed by their implementation of a novel map browsing UI featuring a magnifying glass or &#8220;lens tool&#8221;.

I first saw this map [...]]]></description>
			<content:encoded><![CDATA[<p>L.A.&#8217;s <a href="http://cartifact.com/">Cartifact</a> recently released <a href="http://maps.cartifact.com/">Cartifact Maps</a>, a Flash-based tilemaps viewer with custom cartography and advanced map browsing tools.  The historic overlays and beautiful cartographic design are perhaps of most interest, but I&#8217;m equally impressed by their implementation of a novel map browsing UI featuring a magnifying glass or &#8220;lens tool&#8221;.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/cartifactLensTool.png" alt="" /></div>
<p>I first saw this map browsing technique in a <a href="http://maps.grammata.com/mapviewer/ChinaMissingGirls.html">minimal browser Matt Bloch created</a> for an older static project.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/blochLensTool.png" alt="" /></div>
<p>I implemented a lens tool in the final project version of the <a href="http://freedom.indiemaps.com/">World Freedom Atlas</a>.  I also experimented in some of the early prototypes with a continuous fisheye effect for map browsing. The latter never really took off because of the distortion and pixelation inherent in the raster method.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/wfaLensTool.png" alt="" /></div>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/wfaFisheye.png" alt="" /></div>
<p>And the same idea in a Google Maps <a href="http://mundanemaps.googlepages.com/mu004_memories.html">mashup</a>.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/googleMapsLensTool.png" alt="" /></div>
<p>The originator of the fisheye/magnification method for multi-scale mapping is probably Edgar Kant, in a 1957 map he produced for a migration study of Asby, Sweden, by Torsten Hägerstrand. Here the &#8220;distance from the centre shrinks proportionally to the logarithm of the real distance.&#8221;</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/hagerstrandLogarithmic.png" alt="" /></div>
<p>Much work proceeded on multi-scale map projections, with the touchstone article being Snyder&#8217;s 1987 &#8220;&#8216;Magnifying-glass&#8217; azimuthal map projections&#8221;.  Good coverage on such projections (including parallels to cartogram distortion) can be found in Canter&#8217;s<a href="http://books.google.com/books?id=8cR7yG5ohHoC&#038;pg=PA158&#038;lpg=PA158&#038;dq=%22Magnifying-glass”+azimuthal+map+projections&#038;source=bl&#038;ots=G5H3VjyQGH&#038;sig=8dtAXDFAthNWy2CyV8bf_jmmvs8&#038;hl=en&#038;ei=5z_aSe7-NaT0tQOU2uCmCg&#038;sa=X&#038;oi=book_result&#038;ct=result&#038;resnum=10#PPA157,M1"> <em>Small-scale Map Projection Design</em></a>.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/snyderMagnifyingGlass.png" alt="" /></div>
<p>In non-mapping UIs, the magnification/fisheye effect is fairly common; the Mac dock does it and even <a href="http://en.wikipedia.org/wiki/Cover_Flow">Cover Flow</a> can be considered somewhat of a variant.  For browsing and selection from a &#8220;large linear list&#8221;, Ben Bederson at <a href="http://www.cs.umd.edu/hcil/">HCIL</a> came up with <a href="http://www.cs.umd.edu/hcil/fisheyemenu/">fisheye menus</a>.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/fisheyeMenu.png" alt="" /></div>
<p>So nothing new in general UI terms, but still pretty novel and perhaps especially applicable to online map browsing.</p>
<h3>Map browsing</h3>
<p><a href="http://www.axismaps.com/">Axis Maps</a> cartographer Andy Woodruff did a great <a href="http://www.cartogrammar.com/blog/map-panning-and-zooming-methods/">post</a> on a variety of map panning and zooming methods.  The lens or magnifying glass tool performs both panning and zooming functions, and should be considered as an alternative to the nine methods outlined there.</p>
<p>In interactive applications, the approach&#8217;s major strengths are threefold:</p>
<ul>
<li>low mouse mileage for panning and making selections</li>
<li>less disorientation or &#8220;getting lost&#8221; as general cues are always available</li>
<li>the ability to see generals and specifics simultaneously</li>
</ul>
<p>The last is particularly important in cartographic applications where the success of a good thematic map is often seen as its ability to present overall trends and specific values in the same map.</p>
<h3>Semantic zoom lens tool</h3>
<p>The Cartifact example above is particularly interesting because of the <a href="http://www.infovis-wiki.net/index.php/Semantic_Zoom">semantic zoom</a> inherent in its lens tool.  In normal, geometric zooming, a map (or other image) is simply blown up; more detail is shown by definition, because more pixels are dedicated to the image. In semantic zooming, different (typically more detailed) larger-scale renderings are shown at higher zoom levels; not only are features larger, but more details (and labels) are shown. Such semantic zooming is standard in slippy maps, which are produced and tiled at predefined zoom levels.  Nonetheless, the application to a lens tool is noteworthy, especially in thematic cartography; generals and specifics can be presented simultaneously, and both can be tailored semantically to different zoom levels.</p>
<p>Here&#8217;s a quick example I threw together in Flex using <a href="http://modestmaps.com/">Modest Maps</a> (right-click to view source).</p>

<object	type="application/x-shockwave-flash"
			data="http://indiemaps.com/flash/lensTool/ModestMapsLensTool.swf"
			base="http://indiemaps.com/flash/lensTool/"
			width="800"
			height="500">
	<param name="movie" value="http://indiemaps.com/flash/lensTool/ModestMapsLensTool.swf" />
	<param name=base" value="http://indiemaps.com/flash/lensTool/" />
</object>
<p>I like inverting the above, or perhaps more interestingly, showing Microsoft Aerial as the base and Microsoft Hybrid as the lens; the spotlight (zoomed in or otherwise) then serves to provide political/cultural details for the moused-over region.</p>
<h3>Application to thematic cartography</h3>
<p>In online thematic cartography, the practice of showing smaller enumeration units at higher zoom levels is somewhat common.  The <em>NY Times</em> has done it a few times, including their <a href="http://elections.nytimes.com/2008/results/president/map.html">Election 2008 results maps</a> (the county-level choropleth is revealed by zooming in).</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/lensTool/nyTimesCounty.png" alt="" /></div>
<p>The same idea can be applied to a lens tool. Here the lens reveals the county vote results, and can be zoomed (again, a quick Flex job) to further investigate the local-level results.  Click to launch the map (it&#8217;ll take a few secs to load, project, and draw the data).</p>
<div class="centerIMG"><a href="http://indiemaps.com/flash/lensTool/ThematicMapLensTool.html"><img src="http://indiemaps.com/images/lensTool/thematicLensTool.png" alt="" /></a></div</p>
<p>The above is based on some projections and choropleth code I <a href="http://indiemaps.com/blog/2008/12/noncontiguous-area-cartograms/">released</a> last year. I think there&#8217;s more room for experimentation here: the size of the lens could be user-modifiable and semi-transparent (so you can still see where you&#8217;re mousing over the main map); I&#8217;d also like to create a less-pixellated fisheye lens and try out multiple lenses/fisheyes (for detailed comparisons of multiple areas while still providing context).</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2009/04/lens-tools-and-fisheye-map-browsing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>E00Parser, an ActionScript 3 parser for the Arc/Info Export topological GIS format</title>
		<link>http://indiemaps.com/blog/2009/02/e00parser-an-actionscript-3-parser-for-the-arcinfo-export-topological-gis-format/</link>
		<comments>http://indiemaps.com/blog/2009/02/e00parser-an-actionscript-3-parser-for-the-arcinfo-export-topological-gis-format/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 01:49:18 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[cartograms]]></category>

		<category><![CDATA[circular cartograms]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[Daniel Dorling]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[geography]]></category>

		<category><![CDATA[GIS]]></category>

		<category><![CDATA[graphs]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[topology]]></category>

		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=83</guid>
		<description><![CDATA[First off, why mess with such a retro format as Arc/Info Export (.e00)?&#8211;  any code written for this ASCII file type in the last few years has been on how to go from e00 to pretty much anything (especially to the non-topological data format, the shapefile).  
Put simply, topological information makes a lot [...]]]></description>
			<content:encoded><![CDATA[<p>First off, why mess with such a retro format as <a href="http://avce00.maptools.org/docs/v7_e00_cover.html">Arc/Info Export</a> (.e00)?&#8211;  any code written for this ASCII file type in the last few years has been on how to go <em>from</em> e00 <em>to</em> pretty much anything (especially to the non-topological data format, <a href="http://en.wikipedia.org/wiki/Shapefile">the shapefile</a>).  </p>
<p>Put simply, topological information makes a lot of things possible for the intrepid ActionScripter.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/e00/mapToGraph.png" alt="" /></div>
<p>E00 files non-redundantly store all nodes, lines, and polygons that make up a geographic data layer.  This geodata format is one of three currently <a href="http://www.census.gov/geo/www/cob/st2000.html">distributed by the Census Bureau</a> for boundary files (the others are the shapefile and the Ungenerate ASCII format).  The GIS formats used in most web mapping applications (I&#8217;m thinking of shapefiles, GeoJSON, and KML) are non-topological, meaning features are stored independently, and topological information on shared borders and the like is quite difficult to extract.  Like seriously hard.  Something you don&#8217;t want to be doing in the browser.  <a href="http://maps.grammata.com/">Matthew Bloch</a>, of the <em>NY Times</em>, did his cartography master&#8217;s thesis (at <a href="http://www.geography.wisc.edu/">Wisconsin</a>, natch) on <a href="http://www.mapshaper.org/">MapShaper</a>, much of which involved a C++ server-side solution for building topology from a polygonal shapefile.  Generalization requires non-redundant polylines so as not to create gaps between features when smoothing.  Other visualization techniques, including cartogram construction and graph decomposition, also require knowing the shared borders of geographic features.</p>
<p>Ideally, such topological information could be created/extracted for any geography, regardless of the datasource.  In reality, topology building is intensive and best suited to server-side processing.  Using E00 files and my E00Parser lets you experiment with the visualization and cartographic techniques only possible when such topological information is known, without the expensive processing necessary to build it. </p>
<h3>The code</h3>
<p>I&#8217;ve gotten a ton of use out of Edwin van Rijkom&#8217;s <a href="http://shp.riaforge.org/"><span class="incode">SHP</span> library</a>.  My noncontiguous cartogram, isolining, and political choropleth experiments relied on the code to load coordinate data in shapefile form at run-time, as did the <a href="http://indiemaps.com/blog/2008/01/shapefiles-projections-in-flash-as3/">early experiments</a> that led to <a href="http://indiemapper.com">indiemapper</a>.  I&#8217;m hoping I&#8217;ll get just as much use out of this parser, for when adjacency information is critical to the visualization technique.</p>
<p>There are two main classes, <span class="incode">E00Parser</span> and <span class="incode">E00Tools</span>.  <span class="incode">E00Parser</span> is based on the Perl extension <a href="http://search.cpan.org/~zummo/Geo-E00-0.05/lib/Geo/E00.pm"><span class="incode">Geo::E00</span></a> by Alessandro Zummo and Bert Tijhuis, with much aid from the (world famous) <a href="http://avce00.maptools.org/docs/v7_e00_cover.html">Arc/Info Export Format Analysis</a>.  There&#8217;s no way I would have attempted to write the AS3 E00 parser without Zummo and Tijhuis&#8217; code, as theirs appears to be the only stand-alone open source code available for reading the format.  Their Perl regular expressions were copied with few modifications, though I did fix an issue in some that was keeping their code from accurately reading certain sections of double-precision coverages.  I wrote <span class="incode">E00Tools</span> to collect a handful of methods for working with the resultant data.</p>
<p>I setup a <a href="http://code.google.com/p/e00parser/">Google Code project</a> for this work, as topology will likely form the basis for a decent amount of my cartographic experimentation in the near future.</p>
<ul>
<li>to browse the code, just go <a href="http://code.google.com/p/e00parser/source/browse/#svn/trunk/e00/src/com/indiemaps/mapping/data/parsers/e00">here</a></li>
<li>the latest zip distribution is available <a href="http://code.google.com/p/e00parser/downloads/list">here</a></li>
<li>three examples are included in <a href="http://code.google.com/p/e00parser/source/browse/#svn/trunk/e00/src/com/indiemaps/mapping/data/parsers/e00/examples"><span class="incode">com.indiemaps.mapping.data.parsers.e00.examples</span></a></li>
</ul>
<div class="centerIMG"><img src="http://indiemaps.com/images/e00/e00-mouseover.png" alt="" /></div>
<p>Oh, BTW:</p>
<blockquote><p>ESRI considers the export/import file format to be proprietary. As a consequence, the identified format can only constitute a &#8220;best guess&#8221; and must always be considered as tentative and subject to revision, as more is learned.</p></blockquote>
<p>(from the <em>Arc/Info Export Format Analysis</em>)</p>
<h3>How to use</h3>
<p>After loading your ASCII E00 file into a string, use something like the following to parse it.</p>
<div class="codecolorer-container actionscript" style="height:20px;"><div class="codecolorer" style="font-family: monospace;"><span class="kw2">var</span> <span class="kw3">data</span> : <span class="kw3">Object</span> = E00Parser.<span class="me1">parse</span><span class="br0">&#40;</span> e00Text <span class="br0">&#41;</span>;</div></div>
<p>The returned data object includes all information contained in the file, and can have as many as nine sections.  Of most use are the <span class="incode">arc</span> (non-redundant list of polylines), <span class="incode">pal</span> (list of all polygons and their associated lines), and <span class="incode">ifo</span> (attributes and labels) sections.  The exact structure of the returned object is described on the wiki <a href="http://code.google.com/p/e00parser/wiki/Structure">here</a>.</p>
<p>There are three <em>sweet</em> examples to be found in <a href="http://code.google.com/p/e00parser/source/browse/#svn/trunk/e00/src/com/indiemaps/mapping/data/parsers/e00/examples"><span class="incode">com.indiemaps.mapping.data.parsers.e00.examples</span></a>.</p>
<h3>Tools</h3>
<p><span class="incode">E00Tools</span> contains some methods for working with the resultant data of <span class="incode">E00Parser.parse()</span>.  Included are methods for:</p>
<ul>
<li>Drawing all <em>features</em></li>
<li>Drawing individual <em>features</em></li>
<li>Getting a list of polygon IDs for all <em>features</em></li>
<li>Getting the centroid of a <em>feature</em></li>
<li>Getting the shared border length of all <em>features</em> and their neighbors</li>
</ul>
<p>Key above is the idea of the <em>feature</em>.  <em>Michigan</em> is a <em>feature</em>.  <em>Features</em> are not directly encoded in E00 files like they are in other formats.  In a polygonal shapefile, for example, each feature is encoded as a <em>multipolygon</em>, constituted of one or more rings of points.  In E00 files, only polygons are directly encoded; feature information (which polygons make up which features) can be ascertained from the INFO (<span class="incode">ifo</span>) section.</p>
<h3>Experimentation</h3>
<div class="centerIMG"><img src="http://indiemaps.com/images/e00/experimentation.png" alt="" /></div>
<p>I created these AS3 classes for myself, because I wanted to experiment with topological geodata in visualization and cartographic applications.  This typically boils down to knowing which features are neighbors and how much of a border they share. The <span class="incode">E00Tools</span> methods <span class="incode">getAllFeatureNeighbors</span> and <span class="incode">getAllFeatureSharedBorderLengths</span> gives you easy access to this information.  </p>
<p>Daniel Dorling popularized the circular cartogram form among academic cartographers, outlining the symbology most notably in his <a href="http://www.sasi.group.shef.ac.uk/thesis/index.html">1991 PhD thesis</a> and 1996&#8217;s <em>Area Cartograms: Their Use and Creation</em> (available <a href="http://www.qmrg.org.uk/?page_id=141">here</a> in PDF form along with many other gems of quantitative geography).  Dr. Dorling made Pascal and C code available.  I <a href="http://indiemaps.com/blog/2008/01/dorlingpy/">ported it to Python</a>, and began experimenting, <a href="http://indiemaps.com/blog/2008/01/mine-is-more-like-poorling/">mostly in vain</a>, on a method that worked with a shapefile as input, but without the expense of building topology.  It produced at best a pale imitation.  Dorling describes the gravity model used to produce the cartograms in his dissertation:</p>
<blockquote><p>The algorithm which was developed to create the area cartograms worked by repeatedly applying a series of forces to the circles representing the places. Circles attract those they are topologically adjacent to; the strength of this attraction being greater the larger the distance is between them and the longer their common boundary. </p></blockquote>
<p>The algorithm thus requires the shared border lengths of all features and their neighbors.  Producing this info is easy with <span class="incode">E00Tools</span>, but it seems kind of backward to parse my geodata in ActionScript only to produce the rendering in Python.  I&#8217;m working on porting Dorling&#8217;s algorithm to AS3 so I can go directly from geodata to cartogram without switching platforms.</p>
<p>Lee Byron<a href="http://leebyron.com/how/2008/08/09/olympic-medals-cartogram/"> mentions another technique</a>, used to generate the <a href="http://www.nytimes.com/interactive/2008/08/04/sports/olympics/20080804_MEDALCOUNT_MAP.html">Olympic Medal Count cartograms</a> he helped produce for the <em>Times</em>.  Byron didn&#8217;t release any code, but notes that a soft body force directed layout algorithm written in ActionScript was used.  I haven&#8217;t been able to reproduce his method, but I&#8217;ve included an example that drops the topological information gathered from an E00 file into a <a href="http://flare.prefuse.org/">Flare</a> visualization using a <a href="http://flare.prefuse.org/api/flare/vis/operator/layout/ForceDirectedLayout.html">force directed layout</a>.  The example is minimal, but shows how the E00 classes can be integrated with the Flare visualization API, and may point the way to a slightly different method for producing circular cartograms client-side.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2009/02/e00parser-an-actionscript-3-parser-for-the-arcinfo-export-topological-gis-format/feed/</wfw:commentRss>
		</item>
		<item>
		<title>political cartography: voting with our pocketbooks</title>
		<link>http://indiemaps.com/blog/2009/01/political-cartography-voting-with-our-pocketbooks/</link>
		<comments>http://indiemaps.com/blog/2009/01/political-cartography-voting-with-our-pocketbooks/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 10:46:11 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[2008]]></category>

		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[bivariate]]></category>

		<category><![CDATA[brightness]]></category>

		<category><![CDATA[cartogram]]></category>

		<category><![CDATA[cartograms]]></category>

		<category><![CDATA[color]]></category>

		<category><![CDATA[election]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[mapping]]></category>

		<category><![CDATA[McCain]]></category>

		<category><![CDATA[Obama]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[politics]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[thematic mapping]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=80</guid>
		<description><![CDATA[These election maps are kinda late.  Here I&#8217;m interested in comparing how we, as a country, voted with our ballots versus how we voted with our dollars.  Obama received about 70% of the money donated to the major candidates in 2008, but only 53% of the votes, so I expected a bluer map. [...]]]></description>
			<content:encoded><![CDATA[<p>These election maps are kinda late.  Here I&#8217;m interested in comparing how we, as a country, voted with our ballots versus how we voted with our dollars.  Obama received about 70% of the money donated to the major candidates in 2008, but only 53% of the votes, so I expected a bluer map.  But I wasn&#8217;t sure what the spatial distribution of the difference would be.</p>
<p>As a first blush, the state level is alright (sorry Alaska, Hawaii).  Here I&#8217;m showing the proportion of the dollars donated to the major candidates that went to Barack Obama.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/politicalCartography/state-donations.png" alt="donations to the major candidates in the 2008 presidential election" /></div>
<p>Compare that blue and purple beauty, with only Mississippi to be embarrassed of, with this &#8212; the results of the popular vote.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/politicalCartography/state-votes.png" alt="votes to the major candidates in the 2008 presidential election" /></div>
<p>Some of those states were obviously more consequential to the candidates&#8217; finances.  Here&#8217;s an interactive cartogram, sized by either votes or total dollars.  Both cartograms use the 10th <em>densest</em> state as the &#8220;anchor unit&#8221; (in both cases, New Jersey), so comparisons between the two are meaningful.  I talk more about that in <a href="http://indiemaps.com/blog/2008/12/noncontiguous-area-cartograms/">my post on noncontiguous cartograms</a>.</p>

<object	type="application/x-shockwave-flash"
			data="http://indiemaps.com/flash/politicalCartography/VoteDonationComparisonExample.swf"
			base="http://indiemaps.com/flash/politicalCartography/"
			width="850"
			height="500">
	<param name="movie" value="http://indiemaps.com/flash/politicalCartography/VoteDonationComparisonExample.swf" />
	<param name=base" value="http://indiemaps.com/flash/politicalCartography/" />
</object>
<p>The state view is too coarse.  The obvious choice is the county level, but such aggregated data is not available from the FEC, nor from the <a href="http://open.blogs.nytimes.com/2008/10/14/announcing-the-new-york-times-campaign-finance-api/"><em>NY Times</em> Campaign Finance API</a>, where I retrieved all the finance data for this post. The data are available as individual records, or as summaries requestable by state or ZIP code.<strong>*</strong>  </p>
<p>So I wrote some Python scripts to retrieve and process all 32,800 ZIP codes available from the <em>Times</em> API.  There are more ZIP codes out there, but perhaps they had no donations in 2008.  This had to be spread over a few days, because the <em>Times</em> limits requests to 5000 per day per API key.</p>
<p>Thanks to the shapefiles available from <a href="http://www.census.gov/geo/www/cob/z52000.html#shp">the Census here</a> I was able to map the proportion of donations to Obama from those 32,800 ZIP codes. But too many ZIP codes lacked donations, leading to an unsightly choropleth characterized by radical change and data-less regions.  Best to aggregate to larger units (but smaller than the states above). The <em>NY Times</em> made some nice <a href="http://elections.nytimes.com/2008/president/campaign-finance/map.html">interactive campaign finance maps</a>, candidate-by-candidate, and aggregated to sub-state regions (ex. &#8220;Southern Wisconsin&#8221;, &#8220;Eastern Shore and northern Maryland&#8221;). I&#8217;ve settled on a finer unit, the <a href="http://www.census.gov/geo/www/cob/z32000.html">three-digit ZIP Code Tabulation Areas</a> (ZCTAs) of the Census Bureau (an aggregation of ZIP codes based on their first three digits).  These first three digits correspond to the <a href="http://en.wikipedia.org/wiki/Sectional_center_facility_(SCF)">sectional center facility</a> of the USPS that serves the area.  Though that sounds rather arbitrary, the Census Bureau has aggregated to such units in some of their data since 2000.  The following shows donations originating in the 877 three-digit ZIP code regions of the U.S.A., using the same color scheme as the maps above.</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/politicalCartography/zipcode-donations.png" alt="donations to the major candidates in the 2008 presidential election" /></div>
<p>As above, compared to the outcome of the popular vote (but by county):</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/politicalCartography/county-votes.png" alt="votes to the major candidates in the 2008 presidential election" /></div>
<p>I&#8217;ll spare you the ZIP code regions noncontiguous cartogram.  Cartograms rely on the recognizability of features on the distorted image, and 3-digit ZIP code regions lack familiarity save when they happen to line up with county boundaries.  A better technique in such cases is described by <a href="http://www.cartogrammar.com/blog/the-election-at-night/">Andy Woodruff</a> of <a href="http://www.axismaps.com/">Axis Maps</a>:</p>
<blockquote><p>It’s a standard red-blue map indicating the winner of each county in the lower 48 states, where the transparency indicates the population of a county. The many counties with low population fade into the background, diminishing their visual prominence. This is meant to accomplish something similar to a cartogram, where sizes are distorted to show the actual distribution of votes.</p></blockquote>
<p>Their <a href="http://www.axismaps.com/blog/2008/11/a-new-kind-of-election-map/">election maps</a> adapt the technique of encoding uncertainty information in transparency initially <a href="http://www.geovista.psu.edu/publications/MacEachren/maceachren_uncertainty_CP1992.pdf">suggested by Alan MacEachren in 1992</a> and refined by Igor Drecki in 1999.</p>
<p>Andy tells me they grouped counties into 16 opacity classes using the natural breaks (Jenks optimization) method.  I do the same here for my ZIP code regions.  This method minimizes the sum of deviations from class means, thus producing an optimal classification.  Sixteen classes ensures the appearance of a smooth gradient of transparencies.  I used <a href="http://www.r-project.org/">R</a> and the add-on package <a href="http://cran.r-project.org/web/packages/classInt/index.html">classInt</a> to create the classification.  Here then: finance compared to votes, with both <em>opacitized</em> by <em>consequentiality</em> (total dollars donated in one case, total votes cast in the other).</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/politicalCartography/transparency-black.png" alt="" class='alignnone' /></div>
<p>And here the same over a white background (thus switching the visual variable representing consequentiality to saturation).</p>
<div class="centerIMG"><img src="http://indiemaps.com/images/politicalCartography/transparency-white.png" alt="" /></div>
<p>I&#8217;ve said very little about what these maps actually show.  I&#8217;ll let the maps do the talking on that, though please do contact me if you&#8217;d like the data used in these maps for your own experiments.</p>
<p>One thing I&#8217;ve neglected to mention thus far: all of the above graphics were produced with ActionScript 3, using just a text editor and the latest <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">free Flex SDK.</a>  I used <a href="http://www.python.org/">Python</a> to retrieve and process the campaign finance data, <a href="http://www.openoffice.org/">OpenOffice</a> to paste the processed data into the DBF files of the shapefiles retrieved from the <a href="http://www.census.gov/geo/www/cob/bdy_files.html">Census Bureau</a>, and <a href="http://www.r-project.org/">R</a> to classify the data.  It&#8217;s pretty sweet that such visualizations can be created using only free tools and data.</p>
<p class="update">
update: As I toiled on my ZIP code detour, it turns out <a href="http://finder.geocommons.com/">GeoCommons Finder</a> was <a href="http://maker.geocommons.com/searches?mh_query=FEC+individual+county">accumulating the data</a> I craved.  As described there: &#8220;The monthly individual donor data was downloaded from FEC (Federal Election Commission), geocoded and then aggregated to county level for the lower 48 states.&#8221; The data provided there by county will still require some processing and doesn&#8217;t cover the full range of the data presented by ZIP code region above, but the common county aggregation makes further comparisons with voting data possible, and I&#8217;ll show some bivariate maps utilizing this new data in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2009/01/political-cartography-voting-with-our-pocketbooks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Early cartograms</title>
		<link>http://indiemaps.com/blog/2008/12/early-cartograms/</link>
		<comments>http://indiemaps.com/blog/2008/12/early-cartograms/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 08:40:26 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bubble charts]]></category>

		<category><![CDATA[cartograms]]></category>

		<category><![CDATA[history of cartography]]></category>

		<category><![CDATA[map projections]]></category>

		<category><![CDATA[mapping]]></category>

		<category><![CDATA[symbology]]></category>

		<category><![CDATA[timeline]]></category>

		<category><![CDATA[visualization]]></category>

		<category><![CDATA[Waldo Tobler]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=78</guid>
		<description><![CDATA[I&#8217;m kind of on a cartogram kick lately.  I&#8217;m interested in the pioneers of the form, those who first thought to distort borders and explode topologies in order to convey the distribution of some thematic variable.  When was the first cartogram produced, where, and by whom?  I ran into a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m kind of on a cartogram kick lately.  I&#8217;m interested in the pioneers of the form, those who first thought to distort borders and explode topologies in order to convey the distribution of some thematic variable.  When was the first cartogram produced, where, and by whom?  I ran into a lot of material while researching my thesis; this post only begins the discussion.</p>
<h3>1868</h3>
<p>The honor typically goes to <a href="http://en.wikipedia.org/wiki/Pierre_Émile_Levasseur">Émile Levasseur</a> for the diagrammatic maps contained in his 1868 and 1875 economic geography textbooks.  </p>
<div class="centerIMG"><img src='/images/levasseur.png' alt='early diagrammatic map by Levasseur' class='alignnone' /></div>
<p>H. Gray Funkhouser (1937) wrote of these &#8220;colored bar graphs&#8221;,</p>
<blockquote><p>
<em>squares proportional to the extent of surfaces, population, budget, commerce, merchant marine of the countries of Europe</em>, the squares being grouped about each other in such a manner as to correspond to their geographical position
</p></blockquote>
<p>Interestingly, Waldo Tobler (2004) points out that the example printed by Funkhouser (above) was sized by land area and thus not a true value-by-area cartogram. I don&#8217;t have access to Levasseur&#8217;s texts, and it&#8217;s odd that the only available scan of Levasseur&#8217;s first cartogram shows a diagrammatic map, not a true cartogram.</p>
<h3>1897</h3>
<p>On the other hand is the image below, whose units are definitely sized to the data, but whose geographic arrangement is questionable.  I first saw this page from an 1897 Rand McNally <em>Atlas of the World</em> in a <a href="http://spacecollective.org/rodneyw/2738/The-Debt-of-Your-Country">SpatialCollective post</a>; a <a href="http://www.davidrumsey.com/luna/servlet/detail/RUMSEY~8~1~20703~550091:The-world-s-gold-and-silver-money,-">high res version</a> is available from the David Rumsey Map Collection.</p>
<div class="centerIMG"><img src='/images/atlas-1897.png' alt='a bubble chart, perhaps a circular cartogram, from an 1897 atlas' class='alignnone' /></div>
<p>Circles on the left are sized proportional to population, those on the right to debt.  Though the arrangement seems haphazard, geography is not ignored as the circles are grouped together by continent.  I don&#8217;t really buy these as cartograms, but they&#8217;re certainly a predecessor to the circular cartogram form popularized by <a href="http://www.shef.ac.uk/geography/staff/dorling_danny/">Danny Dorling</a> nearly 100 years later.</p>
<h3>1903</h3>
<p>Others refer to the election maps of Hermann Haack and Hans Wiechel as the first cartograms (presumably because the popular example of Levasseur&#8217;s earlier technique was scaled by land area). These cartograms, which show election results in the Reichstag, were sized to population and of the same rectangular form as the earlier Levasseur diagrams.</p>
<p>Though these maps are mentioned in the second volume of Eckert&#8217;s touchstone history of cartography, <em>Die Kartenwissenschaft</em> (1925), they&#8217;re not reprinted there, and I&#8217;ve no access to the original sources.</p>
<h3>1911</h3>
<p>Professor John Krygier <a href="http://makingmaps.wordpress.com/2008/02/19/1911-cartogram-apportionment-map/">dug this one up</a> — perhaps the first American cartogram, and an interesting example of the form.</p>
<div class="centerIMG"><img src='/images/bailey-1911.png' alt='perhaps the first American cartogram' class='alignnone' /></div>
<p>This is the earliest non-rectangular cartogram I&#8217;ve seen of any provenance, and it is unique in maintaining the exact outer shape of the United States, while abandoning unit shape and position.</p>
<h3>1929</h3>
<div class="centerIMG"><img src='/images/grundy-1929.png' alt='Grundy's early American cartogram' class='alignnone' /></div>
<p>Another early American example, the above map by Joseph Grundy was published by the <em>Washington Post</em> in 1929.  States are scaled &#8220;on the basis of population and Federal taxes&#8221;.  Though somewhat rough, I consider this the first modern cartogram, as it maintains topology without abstracting to rectangles.</p>
<h3>1934</h3>
<p><a href="http://en.wikipedia.org/wiki/Erwin_Raisz">Erwin Raisz</a> was the first to give cartograms academic attention, describing their production in &#8220;The rectangular statistical cartogram&#8221; (1934) and devoting significant coverage to the form in his popular cartography textbooks.</p>
<div class="centerIMG"><img src='/images/raisz-1934.png' alt='rectangular statistical cartogram by Erwin Raisz, 1934' class='alignnone' /></div>
<h3>1961</h3>
<p>A later example, but still a first. In 1961, <a href="http://www.geog.ucsb.edu/~tobler/">Waldo Tobler</a> arrived at the University of Michigan as an assistant professor and began working on the first computer programs for cartogram production. His &#8220;pseudo cartograms&#8221; were created by expanding or compressing the lat/long grid until the minimum root mean squared error of unit densities resulted. </p>
<div class="centerIMG"><img src='/images/tobler-1961.png' alt='early computer cartogram by Waldo Tobler' class='alignnone' /></div>
<p>Errors were typically quite high, though likely no higher than those on the manually-produced ones that came before. All subsequent cartogram algorithms can be considered variants of Tobler&#8217;s method.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/12/early-cartograms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>noncontiguous area cartograms</title>
		<link>http://indiemaps.com/blog/2008/12/noncontiguous-area-cartograms/</link>
		<comments>http://indiemaps.com/blog/2008/12/noncontiguous-area-cartograms/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 07:13:26 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[cartograms]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[flash cartograms]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Judy Olson]]></category>

		<category><![CDATA[map projections]]></category>

		<category><![CDATA[noncontiguous]]></category>

		<category><![CDATA[portfolio]]></category>

		<category><![CDATA[symbology]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=75</guid>
		<description><![CDATA[notes on noncontiguous cartograms and ActionScript 3 classes for producing them
Fully contiguous cartograms have stretched and distorted borders but perfectly maintained topologies. Like the Gastner-Newman diffusion-based cartograms we see all over the place.  Though all sorts of cartogram designs have been produced, those with perfect topology preservation (fully contiguous cartograms) receive the majority of [...]]]></description>
			<content:encoded><![CDATA[<p><em>notes on noncontiguous cartograms and ActionScript 3 classes for producing them</em></p>
<p>Fully contiguous cartograms have stretched and distorted borders but perfectly maintained topologies. Like the <a href="http://www.worldmapper.org/">Gastner-Newman diffusion-based cartograms</a> we see all over the place.  Though all sorts of cartogram designs have been produced, those with perfect topology preservation (fully contiguous cartograms) receive the majority of academic and popular press attention.</p>
<p>Some notable exceptions are the well done animated ones by <a href="http://show.mappingworlds.com/">Mapping Worlds</a> and a <a href="http://www.nytimes.com/interactive/2008/11/02/opinion/20081102_OPCHART.html">recent <em>NY Times</em> example</a> showing electors per voter that I&#8217;ll return to later.  These fully noncontiguous cartograms preserve the shapes of enumeration units perfectly, but don&#8217;t even attempt to preserve any borders or adjacencies from the original map.</p>
<div class="centerIMG"><img src='/images/noncontiguous/nonconExample.png' alt='noncontiguous cartogram close-up' class='alignnone' /></div>
<p>Judy Olson (Wisconsin Geography alum natch) wrote the only <a href="http://www3.interscience.wiley.com/journal/119642159/abstract">academic article</a> to focus specifically on this cartogram symbology in 1976.  She believed noncontiguous cartograms held three potential advantages over contiguous cartograms (I&#8217;ve three more below):</p>
<ol>
<li>&#8220;the empty areas, or gaps, between observation units are meaningful representations of discrepancies of values, these discrepancies generally being a major reason for constructing a cartogram&#8221;</li>
<li>production of noncontiguous cartograms involves &#8220;only the discrete units for which information is available and only the lines which can be accurately relocated on the original map appear on the noncontiguous cartogram&#8221;</li>
<li>because of perfect shape preservation, &#8220;recognition of the units represented is relatively uncomplicated for the reader&#8221;</li>
</ol>
<p>Despite these inherent advantages (along with ease of production), all the early value-by-area cartograms I&#8217;ve seen maintain contiguity.  Some took the radical step of abstracting features to geometric primitives, like Levasseur&#8217;s early French examples (which may not have been cartograms) and Erwin Raisz&#8217;s early American &#8220;rectangular statistical cartograms&#8221;.  But in many ways the noncontiguous design is the more radical cartogram, as it actually breaks the basemap apart — rather than skewing shared borders it abandons them.</p>
<h4>my AS3 classes</h4>
<p>Olson outlines a technique — the projector method — for manually producing such cartograms.  A projector capable of precise numeric reduction/enlargement was required, but not much else, and accurate cartograms could be produced in minutes.  A scaling factor was calculated for each enumeration unit, the projector was set to this value, and the projected borders were traced, keeping units centered on their original centers.</p>
<p>My AS3 NoncontiguousCartogram class works similarly.  It takes an array of objects containing geometry and attribute properties and creates a noncontiguous cartogram.  I include methods for creating the input array from a shapefile/dbf combo, but using KML, WKT, or geoJSON representations wouldn&#8217;t be too hard.  Methods are included for projecting this lat/long linework (to Lambert&#8217;s Conformal Conic projection at least).  The NoncontiguousCartogram class draws the input geography, figures the area of each feature, and scales figures according to their density in the chosen thematic variable.</p>
<p>It&#8217;s all good/in ActionScript 3, so can be used in Flash or Flex. The <a href="http://indiemaps.com/flash/noncontiguous/noncontiguous.zip">zip distribution</a> includes the following:</p>
<ul>
<li>the main NoncontiguousCartogram.as class</li>
<li>two example applications and the data needed to run them</li>
<li>utility classes, including some that make creating cartograms from shp/dbf input quite easy</li>
<li>Edwin Van Rijkom&#8217;s <a href="http://code.google.com/p/vanrijkom-flashlibs/">SHP and DBF libraries</a>, which are used to load the shapefiles in both of the included examples</li>
<li>Keith Peters&#8217; <a href="http://www.bit-101.com/blog/?p=1126">MinimalComps</a> AS3 component library, for the components used in one of the examples</li>
<li>Grant Skinner&#8217;s <a href="http://www.gskinner.com/libraries/gtween/">gTween</a> class, which is required by the NoncontiguousCartogram class for tween transitions</li>
</ul>
<p><a href="http://indiemaps.com/flash/noncontiguous/srcview/">Browse all the above</a> or <a href="http://indiemaps.com/flash/noncontiguous/noncontiguous.zip">download the zip</a>.</p>
<h4>Flash examples</h4>
<p>I created a few examples, all started from just shapefile input.  The following are screenshots, but there are interactive examples further down.  First, an example out of Olson&#8217;s article, presumably produced using the &#8220;projector method&#8221; described above:</p>
<div class="centerIMG"><img src='/images/noncontiguous/olsonExample-reduced.png' alt='noncontiguous cartogram from Olson\&#039;s article' class='alignnone' /></div>
<p>Here I&#8217;ve updated Olson&#8217;s example with more recent data and a snazzy red outline:</p>
<div class="centerIMG"><img src='/images/noncontiguous/oldPopulation.png' alt='' class='alignnone' /></div>
<p>This one took a few secs to load the shapefile, project to Winkel Tripel, draw, and scale the cartogram by population:</p>
<div class="centerIMG"><img src='/images/noncontiguous/worldPopulation.png' alt='' class='alignnone' /></div>
<div class="centerIMG"><img src='/images/noncontiguous/usCountyPopulation.png' alt='' class='alignnone' /></div>
<p>The above is great as an artistic rendering, but is probably a bad depiction of the data as 10% of the counties have increased in size and there is a fair bit of overlap.  Decreasing the alpha of the counties reveals the overlap, and creates a really interesting rendering of the data.</p>
<div class="centerIMG"><img src='/images/noncontiguous/usCountyPopulation-take2.png' alt='' class='alignnone' /></div>
<p>If you&#8217;ve read this far, you probably at least want to see some shit move around or something. Here&#8217;s an example I put together with election data; it shows off the basic updating and tweening capabilities built into the class.  Notice how all features are drawn around their centroid and therefore remain centered as they change scale.  Tweening is via Grant Skinner&#8217;s <a href="http://www.gskinner.com/libraries/gtween/">gTween</a> and interface components are from Keith Peters&#8217; <a href="http://www.bit-101.com/blog/?p=1126">MinimalComps</a> library, which is great for prototyping in only AS3.</p>

<object	type="application/x-shockwave-flash"
			data="http://indiemaps.com/flash/noncontiguous/ElectionResultsCartogramExample.swf"
			base="http://indiemaps.com/flash/noncontiguous/"
			width="700"
			height="500">
	<param name="movie" value="http://indiemaps.com/flash/noncontiguous/ElectionResultsCartogramExample.swf" />
	<param name=base" value="http://indiemaps.com/flash/noncontiguous/" />
</object>
<p>In the above, the &#8220;electors per voter&#8221; option is based on the same data as the well-made <a href="http://www.nytimes.com/interactive/2008/11/02/opinion/20081102_OPCHART.html"><em>NY Times</em> example</a> I mentioned earlier, but something&#8217;s fishy about one of our scalings, because they <a href="http://indiemaps.com/images/noncontiguous/dontLineUp.png">don&#8217;t line up</a>.</p>
<h4>design considerations</h4>
<p>Position and size.  Both affect the one thing you&#8217;re trying to avoid on a noncontiguous cartogram: feature overlap.  If features are left at their original centroids, overlap is likely if any units are enlarged.  When sizing features on a noncontiguous cartogram, one feature is chosen as the &#8220;anchor unit&#8221;.  This feature will stay the same size, and all others will be scaled up or down depending on whether their density is higher or lower than the anchor.  If the unit with the highest density is chosen, overlap will be avoided because all other units will be reduced.  This can often produce large areas of white space and units too small to recognize.</p>
<p>To address this, both the anchor unit and the feature centers are configurable.  The &#8220;anchor percentile&#8221; is set in the class constructor, and can range from zero to one.  If set to one, all but one feature will be reduced; if set to zero, all but one feature will be enlarged.  </p>
<p>By default, features scale around their original centroids.  You can pass a Dictionary of feature centers (using the objects contained in the combined array as keys) to the constructor (or via the settable property, featureCenters), which allows you to manually position the features.  I include the following example to give you some ideas for how to use this feature.  I create an interactive cartogram on which features can be moved around.  Well Known Text representations of the feature centers are generated and converted into the required Dictionary via some included utility methods.  <a href="http://indiemaps.com/flash/noncontiguous/srcview/source/ManualCartogramTest.as.html">Check out the source</a> of this example to see what&#8217;s going on.</p>

<object	type="application/x-shockwave-flash"
			data="http://indiemaps.com/flash/noncontiguous/ManualCartogramTest.swf"
			base="http://indiemaps.com/flash/noncontiguous/"
			width="800"
			height="450">
	<param name="movie" value="http://indiemaps.com/flash/noncontiguous/ManualCartogramTest.swf" />
	<param name=base" value="http://indiemaps.com/flash/noncontiguous/" />
</object>
<h4>projections</h4>
<p>In her 1976 article, Judy Olson used linework projected with an equal area projection.  This was a requirement of her method, as she was using known land area measurements in her calculation of densities and scaling factors.  My class calculates areas of features — projected or otherwise — before scaling, so any projection can be utilized and an accurately-scaled cartogram will result.  In the examples above, I use a conformal projection (included in the source) on the points before passing to the cartogram class.  Conformal projections preserve local angles (shape, sort of) and may result in features that are easier to recognize.</p>
<p>That said, for most applications it&#8217;s probably a good idea to use equivalent (equal area) projections before constructing these cartograms, as the divergence of the thematic variable from land area is often the point of creating the cartogram in the first place.  </p>
<h4>more advantages</h4>
<p>In my thesis research last spring, noncontiguous cartograms performed quite well: subjects rated them highly on aesthetics and could locate and estimate the areas of features with relatively high accuracy.  I would add the following to Olson&#8217;s list of noncontiguous cartogram advantages.</p>
<ol>
<li>Olson concentrates on the perfect shape preservation of noncontiguous cartograms.  The form (well, those with units centered on the original enumeration unit centroids, as in Olson&#8217;s projector method) also perfectly preserves the <em>location</em> of the features on the resultant transformed cartogram. Not only are features easier to recognize, but locations within the transformed units can be accurately located as well (cities or mountain ranges from the original geography can be accurately plotted on the transformed cartogram).</li>
<li>Because units are separate on the transformed cartogram, their figure-ground is increased and areas of features can therefore be more accurately estimated.</li>
<li>Many cartogram designs (including most manual cartograms and the Gastner-Newman-produced cartograms) sacrifice some <em>accuracy</em> for shape recognition.  This is a defensible tradeoff, especially as area estimation is notoriously inaccurate and nonlinear.  Yet it&#8217;s a tradeoff that noncontigous cartograms need not make, as they can always perfectly represent the data with relative areas without sacrificing shape preservation.
</ol>
<p>Thus, noncontiguous cartograms seem to excel at the cartogram&#8217;s two main map-reading tasks: shape recognition and area estimation.  This is mediated somewhat by the chief advantage of contiguous cartograms: compactness.  Because no space is created between enumeration units, contiguous cartogram enumeration units can be larger than those on noncontiguous cartograms, all other things equal.  The increased size on contiguous cartograms may improves their legibility.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/12/noncontiguous-area-cartograms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nightingale&#8217;s roses in ActionScript 3</title>
		<link>http://indiemaps.com/blog/2008/10/nightingales-roses-in-actionscript-3/</link>
		<comments>http://indiemaps.com/blog/2008/10/nightingales-roses-in-actionscript-3/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 08:30:00 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[charting]]></category>

		<category><![CDATA[coxcomb]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[nightingale]]></category>

		<category><![CDATA[pie chart]]></category>

		<category><![CDATA[rose]]></category>

		<category><![CDATA[symbology]]></category>

		<category><![CDATA[temporal]]></category>

		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=70</guid>
		<description><![CDATA[I&#8217;ve long been a sucker for the polar area/coxcomb/rose charts popularized by Florence Nightingale.  These multivariate charts can show ordered or unordered categorical data.  As noted in an Economist piece on influential information graphics,
As with today&#8217;s pie charts, the area of each wedge is proportional to the figure it stands for, but it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve long been a sucker for the polar area/coxcomb/rose charts popularized by Florence Nightingale.  These multivariate charts can show ordered or unordered categorical data.  As noted in <a href="http://www.economist.com/world/europe/displaystory.cfm?story_id=10278643">an <em>Economist</em> piece</a> on influential information graphics,</p>
<blockquote><p>As with today&#8217;s pie charts, the area of each wedge is proportional to the figure it stands for, but it is the radius of each slice (the distance from the common centre to the outer edge) rather than the angle that is altered to achieve this.</p></blockquote>
<div class="centerIMG"><img src="/images/coxcomb/nightingaleCoxcombs.png" alt="" /></div>
<p>I wanted to produce some just for kicks, so looked around for a script in AS3.  No dice.  OK, any language?  Didn&#8217;t see anything.  So I sat on the idea for a while and then finally thought up the technique that made producing them in AS3 quite easy.  With the resultant classes, producing graphics like the following small multiples of U.S. soldier deaths in Iraq is a snap.  The classes are written in AS3, so can be used with Flash, Flex, or mxmlc.  All the example screenshots below are PNGs captured from SWFs produced with only AS3 (extended Sprites).  To see the code (which includes a lot of ugly annotation), click &#8216;<a href="http://indiemaps.com/flash/coxcomb/srcview/">view source</a>&#8216; below any image.  All source code is included in the ZIP distribution linked below.</p>
<h3>U.S. Soldier Deaths in Iraq, March 2003 to October 2008</h3>
<div class="centerIMG"><img src="/images/coxcomb/usSoldierDeathsIraq.png" alt="" width="867" height="185" /></div>
<p class="caption"><a href="http://indiemaps.com/flash/coxcomb/srcview/source/IraqDeathCountCoxcombs.as.html">view source</a></p>
<p>The above chart series utilizes the coxcomb in the same manner as Nightingale&#8217;s original — as a month-by-month temporal chart.  The following is also a small multiples presentation, but utilizes categorical coxcombs to show car color popularity by percent manufactured.</p>
<h3>Cars manufactured by color, 2003 to 2006</h3>
<div class="centerIMG"><img class="alignnone" src="/images/coxcomb/carColors.png" alt="" width="737" height="380" /></div>
<p class="caption"><a href="http://indiemaps.com/flash/coxcomb/srcview/source/CarColors.as.html">view source</a></p>
<p>And as the ultimate test for the classes, I decided to try my hand at reproducing <a href="http://indiemaps.com/images/coxcomb/Nightingale-mortality.jpg">Nightingale&#8217;s original graphic</a>.  I relied on <a href="http://www.florence-nightingale-avenging-angel.co.uk/">Hugh Small&#8217;s</a> beautiful reproduction of Nightingale&#8217;s graphic.  I quickly gave up on reproducing the fonts, and indeed a few of Nightingale&#8217;s embellishments/idiosyncrasies are not reproduced in my graphic.  But one of these nights I&#8217;ll extend the class to more faithfully reproduce Nightingale&#8217;s original.  Nevertheless, not bad eh?</p>
<h3> </h3>
<div class="centerIMG"><img src="/images/coxcomb/myNightingale.png" alt="" width="1005" height="610" /></div>
<p class="caption"><a href="http://indiemaps.com/flash/coxcomb/srcview/source/NightingaleCoxcomb.as.html">view source</a></p>
<p>I&#8217;m open to the criticism that these coxcombs (and other area-based symbologies) are rarely preferable to a simple bar chart (a length-based symbology).  But I still believe they ought to be a part of the information designer&#8217;s toolkit, especially as they hold definite advantages over their more popular offspring, the pie chart.  For animated or small multiples applications in particular, the coxcomb is preferable to the pie chart because of the constant position/angle of slices.  It&#8217;s easy to glance across a series of small multiples coxcombs, or watch an animating coxcomb, and follow individual slices.  I&#8217;ve built basic interactivity and tweening (using Grant Skinner&#8217;s lightweight <a href="http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html">GTween Engine</a>) into the class.  See <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=00007o">this discussion</a> over at Edward Tufte&#8217;s site for some of the advantages and disadvantages of coxcomb charts.</p>
<p>Further, though bar charts may be easier to read, they may not work in all contexts, including interactive mapping, in which <em>compactness</em> may outweigh other concerns.</p>
<p>Here&#8217;s an example of some of the basic tweening and interactive capabilities of the class.</p>

<object	type="application/x-shockwave-flash"
			data="http://indiemaps.com/flash/coxcomb/CoxcombTest.swf"
			width="550"
			height="550">
	<param name="movie" value="http://indiemaps.com/flash/coxcomb/CoxcombTest.swf" />
</object>
<p class="caption"><a href="http://indiemaps.com/flash/coxcomb/srcview/">view source</a></p>
<p>When I initially thought of coding these charts, I balked at the idea of constructing slices whose relative areas would faithfully represent the data.  But I eventually realized that I could just use masked circles.  The circles could be accurately scaled to the data, and since each segment would mask the same percentage of the circle, the resultant pie slices would faithfully represent the data.  The technique (demonstrated in the diagram below) has the added advantage of allowing tweening of slices in animated displays.</p>
<div class="centerIMG"><img src="/images/coxcomb/coxcombAS3Diagram.png" alt="" /></div>
<p class="caption">the main technique behind CoxcombChart.as — the masking and rotation of CoxcombSlices</p>
<p>A bit easier said than done, since the strokes on each slice need to be drawn.  But that boils down to geometry.  Each slice need only be rotated into place to form the final rose chart.</p>
<p>I&#8217;ll create a few more examples in the future — I&#8217;m particularly interested in the cartographic applications of this multivariate chart.  I&#8217;ll likely post a <a href="http://modestmaps.com">Modest Maps</a> layer showing coxcomb charts of average precipitation-by-month for major cities, or something, in the near future.  For now, here&#8217;s all the code used to produce the graphics above.  It should be pretty easy to produce a coxcomb chart of any data using this code, and my interface is flexible enough to modify the appearance and interactivity of the charts for most applications.  But feel free to extend the class and override methods to alter these properties.</p>
<ul>
<li>A <a href="http://indiemaps.com/flash/coxcomb/coxcomb.zip">ZIP of the full distribution</a>.  This also includes Grant Skinner&#8217;s lightweight <a href="http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html">GTween Engine</a> (a single .as class) which is required for the class.  Andy Woodruff&#8217;s <a href="http://www.cartogrammar.com/blog/drawing-dashed-lines-with-actionscript-3/">DashedLine</a> class is also included, as it is used in the Nightingale example.</li>
<li>For you browsers, view all the source <a href="http://indiemaps.com/flash/coxcomb/srcview/">here</a></li>
</ul>
<p>Creating the coxcombs should be pretty easy.  Here&#8217;s an example instantiation of a non-interactive coxcomb, 350 pixels wide/tall, with 3 slices, each a different color.</p>
<div class="codecolorer-container actionscript"><div class="codecolorer" style="font-family: monospace;"><span class="kw2">var</span> myCoxcomb : CoxcombChart = <span class="kw2">new</span> CoxcombChart<span class="br0">&#40;</span> <br />
&nbsp; &nbsp; <span class="br0">&#91;</span> <br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> label : <span class="st0">'red'</span>, value : <span class="nu0">15</span> <span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> label : <span class="st0">'white'</span>, value : <span class="nu0">20</span> <span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> label : <span class="st0">'blue'</span>, value : <span class="nu0">25</span> <span class="br0">&#125;</span> <br />
&nbsp;&nbsp; &nbsp;<span class="br0">&#93;</span>,<br />
&nbsp;&nbsp; &nbsp;<span class="nu0">350</span>, <span class="br0">&#91;</span> 0xff0000, 0xffffff, 0x0000ff <span class="br0">&#93;</span>, 0x888888<br />
<span class="br0">&#41;</span>;</div></div>
<div class="centerIMG"><img src="/images/coxcomb/simpleCoxcomb.png" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/10/nightingales-roses-in-actionscript-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SpatialKey: insanely good geovisualization</title>
		<link>http://indiemaps.com/blog/2008/08/spatialkey-insanely-good-geovisualization/</link>
		<comments>http://indiemaps.com/blog/2008/08/spatialkey-insanely-good-geovisualization/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 09:38:05 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[chorodot]]></category>

		<category><![CDATA[geovisualization]]></category>

		<category><![CDATA[heatmap]]></category>

		<category><![CDATA[neocartography]]></category>

		<category><![CDATA[spatialkey]]></category>

		<category><![CDATA[symbology]]></category>

		<category><![CDATA[universal mind]]></category>

		<category><![CDATA[visualization]]></category>

		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=62</guid>
		<description><![CDATA[I&#8217;m a little late on this, so I hope it&#8217;s old news to most readers that Universal Mind, where I&#8217;ve worked for the past 2 months, just launched a technology preview of the SpatialKey visualization system.  This is a big deal.


Andrew Powell, Doug McCune, and Brandon Purcell have already posted great introductions to SpatialKey, so [...]]]></description>
			<content:encoded><![CDATA[<p><del>I&#8217;m a little late on this, so I hope it&#8217;s old news to most readers that <a href="http://universalmind.com">Universal Mind</a>, where I&#8217;ve worked for the past 2 months, just launched a technology preview of the <a href="http://spatialkey.com">SpatialKey visualization system</a>.  This is a big deal.</del></p>
<p class="centerIMG"><img src="/images/skProstitution.png" alt="" /></p>
<p><del><br />
<a href="http://www.infoaccelerator.net/blog/post.cfm/universal-mind-introduces-spatialkey">Andrew Powell</a>, <a href="http://dougmccune.com/blog/2008/08/06/announcing-spatialkey-geographic-information-without-limits/">Doug McCune</a>, and <a href="http://www.bpurcell.org/blog/index.cfm?mode=entry&amp;entry=1112">Brandon Purcell</a> have already posted great introductions to SpatialKey, so I won&#8217;t go through all that here.  But just so&#8217;s you know: SpatialKey is a visualization system for geotemporal (location + time) data, developed primarily in Flex, that lets you filter and render thousands of points very quickly, all client-side in your browser.</del></p>
<p><del>This is not a formal release.  We&#8217;re in a technology preview for now, which means you just get to see some sweet examples, but soon we&#8217;ll release a version, SpatialKey Personal, into which you can load and visualize your own data.  Here are links to three of my favorite examples (for more, check out our <a href="http://www.spatialkey.com/spatialkey/www/gallery/gallery_home.cfm">Gallery page</a>, or <a href="http://blog.spatialkey.com/2008/08/spatialkey-technology-preview/">this post</a> on the <a href="http://blog.spatialkey.com/">SpatialKey blog</a>).</del></p>
<ul>
<li><del><a href="http://www.spatialkey.com/spatialkey/fms/skclient/index.cfm#dataset=sanAntonioProstitution;template=aggregate">where prostitutes are arrested in San Antonio</a></del></li>
<li><del><a href="http://www.spatialkey.com/spatialkey/fms/skclient/index.cfm#dataset=sacbeeBig;template=comparison">the housing slump in Sacramento</a></del></li>
<li><del><a href="http://www.spatialkey.com/spatialkey/fms/skclient/index.cfm#dataset=walmartPlus;template=playback">the radial spread of Wal-Mart</a></del></li>
</ul>
<p><del>As I said, <a href="http://www.infoaccelerator.net/blog/post.cfm/universal-mind-introduces-spatialkey">other</a> <a href="http://dougmccune.com/blog/2008/08/06/announcing-spatialkey-geographic-information-without-limits/">better</a> <a href="http://www.bpurcell.org/blog/index.cfm?mode=entry&amp;entry=1112">introductions</a> have been written on SpatialKey; I just want to focus on a few of my favorite features or attributes.</del></p>
<h3><del>not a single, do-it-all application</del></h3>
<p><del>SpatialKey is based around a collection of visualization templates.  Each offers a unique view of the data, with specialized visualizations, filters, and UI controls.  Since the templates are specialized, each one is pretty easy to learn and begin using.</del></p>
<p><del>The examples linked above demonstrate the <a href="http://spatialkey.com/spatialkey/www/gallery/gallery_home.cfm#1">animation</a>, <a href="http://spatialkey.com/spatialkey/www/gallery/gallery_home.cfm#3">map comparison</a>, and <a href="http://spatialkey.com/spatialkey/www/gallery/gallery_home.cfm#2">drill down</a> templates.  The fourth template we&#8217;re showing off now is the <a href="http://spatialkey.com/spatialkey/www/gallery/gallery_home.cfm#4">temporal heat index</a> template (here&#8217;s an example of that: <a href="http://www.spatialkey.com/spatialkey/fms/skclient/index.cfm#dataset=sacramentoResidenceBurglary2006;template=heat">Sacramento residential burglaries</a>).</del></p>
<h3><del>chorodot symbolization</del></h3>
<p><del>You don&#8217;t see these much, but I think they&#8217;re really effective.  The &#8220;heat grid&#8221; symbolization in SpatialKey is a modern implementation of a technique put forth by Alan MacEachren and David DiBiase in 1991.</del></p>
<p><del>Aggregating points to arbitrary but regularly-shaped polygons, or binning, was an extant graphical practice at the time, but the geographic application and their particular methods created an effective cartographic symbology.  Other than SpatialKey, I haven&#8217;t seen this symbolization in a  geographic visualization context, but I think it&#8217;s very effective at presenting large datasets that require aggregation.  The heat grid symbolization in SpatialKey extends the approach by allowing grid renderings of attributes of the data (like house prices or temperature) in addition to aggregation of the count of points.</del></p>
<p class="centerIMG"><img class="alignnone" src="/images/chorodot.jpg" alt="chorodot of AIDS cases in Pennsylvania" /></p>
<p class="caption"><del>MacEachran and DiBiase&#8217;s example chorodot map of AIDS in Pennsylvania (image from J.B. Krygier&#8217;s <a href="http://cc.owu.edu/~jbkrygie/krygier_html/geog_353/geog_353_lo/geog_353_lo08.html">lecture notes</a>)</del></p>
<p class="centerIMG"><img class="alignnone" src="/images/spatialKeyGrid.png" alt="grid symbology in SpatialKey, implementation of the chorodot cartographic symbology" /></p>
<p class="caption"><del>SpatialKey grid symbolization showing a data attribute (average home prices) in Sacramento county</del></p>
<h3><del>small multiples / map comparison</del></h3>
<p><del>I&#8217;ve always been a fan of the <a href="http://en.wikipedia.org/wiki/Small_multiple">small multiples</a> depiction of change, illustrated so well by Edward Tufte in <em>The Visual Display of Quantitative Information</em> and <em>Envisioning Information</em>.  Though the SpatialKey Map Comparison template shows <em>two</em> multiples, it qualifies (and we can easily plug in more maps for specialized templates).</del></p>
<p class="centerIMG"><img class="alignnone" src="/images/spatialKeyMapComparison.png" alt="" /></p>
<p class="caption"><del>D.C. construction in the SpatialKey Map Comparison template</del></p>
<p><del>Both the maps and the time charts are live-linked.  Mousing over an area on one of the maps or a bar on one of the time charts reveals the tooltip for both displays, allowing you to easily retrieve specifics for different time periods or areas.</del></p>
<p class="centerIMG"><img class="alignnone" src="/images/liveLinkedMaps.png" alt="" /></p>
<h3><del>complex temporal filtering and focusing via the heat index chart</del></h3>
<p><del>The time chart, shown in the first screenshot above, is great for revealing linear temporal trends in a dataset, and for enabling linear filtering.  But some datasets evince more complex temporal trends &#8212; for example, some crimes may be more common on a certain day of the week <em>and</em> at a certain time of day.  Such trends are lost when data is aggregated in a linear fashion to, say, days or weeks.</del></p>
<p class="centerIMG"><img class="alignnone" src="/images/heatIndexSexCrimes.png" alt="" /></p>
<p class="caption"><del>sex crime arrests in Sacramento</del></p>
<p><del>The temporal heat index chart reveals such complex trends and allows filtering by multiple temporal aspects simultaneously (for example, showing only prostitution arrests on Tuesdays between 3 and 4 am).</del></p>
<h3><del>in closing</del></h3>
<p><del>I was late to the game on this one, joining Universal Mind in June.  SpatialKey was developed by the brilliant team of Doug McCune, Ben Stucki, and Andrew Powell, led by Brandon Purcell and Tom Link, with product manager Mike Connor.  It&#8217;s a privilege working with such a talented crew.</del></p>
<p><del>Our goals for this technology preview are modest (blowing minds, getting feedback), but we&#8217;re excited to continue developing SpatialKey and SpatialKey Law Enforcement.  And we&#8217;ll be releasing updates, new examples, and SpatialKey Personal in the near future.  So stay tuned to the <a href="http://blog.spatialkey.com">SpatialKey blog</a>, and please <a href="feedback@spatialkey.com">contact us</a> if you have any feedback on our technology preview.</del></p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/08/spatialkey-insanely-good-geovisualization/feed/</wfw:commentRss>
		</item>
		<item>
		<title>seeing the plate</title>
		<link>http://indiemaps.com/blog/2008/06/seeing-the-plate/</link>
		<comments>http://indiemaps.com/blog/2008/06/seeing-the-plate/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 21:06:42 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[baseball]]></category>

		<category><![CDATA[charting]]></category>

		<category><![CDATA[pitch location]]></category>

		<category><![CDATA[pitching]]></category>

		<category><![CDATA[sportsviz]]></category>

		<category><![CDATA[symbology]]></category>

		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=47</guid>
		<description><![CDATA[I&#8217;m really digging the Boston Globe&#8217;s recent visualization tracking Manny Ramirez&#8217;s hunt for 500 home runs (reached on May 31st).  

This cool app answers seemingly every question about when and how Manny hit his home runs&#8230;except for the one I&#8217;m most interested in: where on the plate is Manny most likely to hit a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really digging the <em>Boston Globe</em>&#8217;s recent <a href="http://www.boston.com/sports/baseball/redsox/extras/manny_500_homeruns/">visualization tracking Manny Ramirez&#8217;s hunt for 500 home runs</a> (reached on May 31st).  </p>
<p class="centerIMG"><a href="http://www.boston.com/sports/baseball/redsox/extras/manny_500_homeruns/"><img src="http://indiemaps.com/images/manny.png" alt="manny ramirez's 500 home runs (from Boston.com)" /></a></p>
<p>This cool app answers seemingly every question about when and how Manny hit his home runs&#8230;except for the one I&#8217;m most interested in: where on the plate is Manny most likely to hit a home run?  I&#8217;ve seen a few visualizations recently that do this sort of thing, so I thought I&#8217;d share this view of current practices in the area of <em>pitch location v. batting performance</em> visualization.  </p>
<p>ESPN will often show you a 1D view (showing only the <em>x</em> dimension of the pitch location) during games, dividing the plate into three horizontal segments (in this case showing the number of home runs  this year by Vladimir Guerrero):</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/espn.png" alt="espn screenshot showing home runs by pitch location" /></p>
<p>A more advanced, 2D view of the same is used often on ESPN&#8217;s <em>Baseball Tonight</em>:</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/espn2.png" alt="espn screenshot showing batting average by pitching location" /></p>
<p>For a while now, ESPN.com&#8217;s <a href="http://scores.espn.go.com/mlb/scoreboard">baseball Gamecasts</a> have shown real-time pitch locations, including whether the ball was called a strike (red) or a ball (green). </p>
<p class="centerIMG"><img src="http://indiemaps.com/images/gamecast.png" alt="espn gamecast screenshot showing pitch locations" /></p>
<p>Turning on &#8220;Hit Zones&#8221; reveals a very cool diverging blue-to-red <a href="http://en.wikipedia.org/wiki/Heat_map">heatchart</a>-style graphic of batting performance in the 9 segments of the plate&#8217;s plane.</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/gamecast3.png" alt="espn gamecast screenshot showing pitch locations and heatchart of batting averages" /></p>
<p>The above is apparently a common method of showing this statistic.  These heatcharts differ in 1) how many segments the plate is divided into and 2) whether a sequential or diverging color scheme is used.  Here&#8217;s one &#8212; with many more segments and a high swing zone &#8212; for Ted Williams, from the <a href="http://www.tedwilliams.com/_data/hzone.htm">Official Ted Williams Website</a>.</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/tedwilliams.png" alt="Ted Williams' batting averages by pitch location" /></p>
<p>And a very cool report in the <a href="http://baseballanalysts.com/archives/2006/11/generalities_in.php">Baseball Analysts</a> shows batting averages with 20 pitch location squares, aggregated over two seasons, and divided into the four types of batter-pitcher matchups.  For example, the image below shows the greyscale heatchart for the matchup, Left-handed pitcher vs. Left-handed batter.</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/grids.png" alt="pitch locations and batting averages" /></p>
<p>MLB.com&#8217;s <a href="http://www.mlb.com/mlb/gameday/">Gameday</a> does a better job, methinks, of showing pitch locations relative to the batter and the plate.  But they don&#8217;t give any indication of the particular batter&#8217;s performance with different pitch locations:</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/gameday.png" alt="pitch visualization in MLB.com's Gameday" /></p>
<p>I also like the above because it at least suggests the <a href="http://en.wikipedia.org/wiki/Strike_(baseball)">3d nature of the strike zone</a>: pitches with movement will not leave the space above the plate at the same position as they entered it.  The heatcharts shown above do a good job of showing pitch locations in the <em>x</em> and <em>z</em> dimensions.  A pitch visualization notable for showing these <em>x</em> and <em>z</em> locations at various points in <em>y</em> space is Lokesh Dhakar&#8217;s <a href="http://www.lokeshdhakar.com/2007/09/20/baseball-pitches/">Baseball Pitches Illustrated</a> (shown below is the slider), though this too is concerned only with pitching.  </p>
<p class="centerIMG"><img src="http://indiemaps.com/images/slider.png" alt="pitch visualization" /></p>
<p>Thanks to the <a href="http://webusers.npl.uiuc.edu/~a-nathan/pob/pitchtracker.html">PITCHf/x system</a>, there is a ton of pitch location data available.  Currently, though, there have been few attempts to flexibly visualize this data.  One app, the <a href="http://baseball.bornbybits.com/php/combined_tool.php">PITCHf/x tool by Josh Kalk</a>,  is quite flexible, but the charts themselves leave something to be desired (below for Ben Sheets).</p>
<p class="centerIMG"><img src="http://indiemaps.com/images/pitchfx.png" alt="Ben Sheets' pitch location visualized" /></p>
<p>I&#8217;m thinking more of a tool like <a href="http://www.visual-io.com/baseball/">Visual i|o&#8217;s baseball visualization tool</a>, or the <em>Boston Globe</em> app linked above, that would take advantage of this rich data, but allow it to be manipulated and filtered in real-time.  For example, I&#8217;d love to just look at <em>called</em> strikes or balls, and be able to filter that down by ballpark, or perhaps even by individual umpire, and visualize it by the ratio of strikes-to-balls, to get a better idea of the true strike zone.  And, it&#8217;s worth noting that there&#8217;s no reason this information need be aggregated to grid squares; it could also be shown with a continuous density representation like <a href="http://indiemaps.com/blog/2008/06/this-is-not-a-heat-map/">this style of heatmap</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/06/seeing-the-plate/feed/</wfw:commentRss>
		</item>
		<item>
		<title>isolining package for ActionScript 3</title>
		<link>http://indiemaps.com/blog/2008/06/isolining-package-for-actionscript-3/</link>
		<comments>http://indiemaps.com/blog/2008/06/isolining-package-for-actionscript-3/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 06:15:48 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[isolines]]></category>

		<category><![CDATA[mapping]]></category>

		<category><![CDATA[portfolio]]></category>

		<category><![CDATA[symbology]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=43</guid>
		<description><![CDATA[A week or so back I wrote about a package I ported/modified to create the Delaunay triangulation in Flash with a few AS3 classes.  As I noted there, such a triangulated irregular network (TIN) allows us to interpolate isolines — lines of constant value (aka isarithms, commonly called contours).
So, given a field of points [...]]]></description>
			<content:encoded><![CDATA[<p>A week or so back <a href="http://indiemaps.com/blog/2008/05/delaunay-triangulation-in-actionscript-3/">I wrote about</a> a package I ported/modified to create the Delaunay triangulation in Flash with a few AS3 classes.  As I noted there, such a <a href="http://en.wikipedia.org/wiki/Triangulated_irregular_network">triangulated irregular network</a> (TIN) allows us to interpolate <a href="http://en.wikipedia.org/wiki/Isoline">isolines</a> — lines of constant value (aka isarithms, commonly called contours).</p>
<p>So, given a field of points (weather stations, say)&#8230; </p>
<p><img src="http://indiemaps.com/images/weatherStations.png" alt="weather stations" /></p>
<p>&#8230;with one or more attributes attached (temperature, say)&#8230;</p>
<p><img src="http://indiemaps.com/images/weatherStations2.png" alt="weather stations for interpolation" /></p>
<p>&#8230;a TIN can be constructed.</p>
<p><img src="http://indiemaps.com/images/tin.png" alt="triangulated irregular network" /></p>
<p>With the above TIN, values can be interpolated along each edge between the points of known values (<em>control points</em>).  The interpolation is strictly linear (that is, the value 50 would be interpolated halfway along an edge whose control points were valued 48 and 52).</p>
<p><img src="http://indiemaps.com/images/interpolatedPoints.png" alt="interpolated points for isolining" /></p>
<p>With a given <a href="http://en.wikipedia.org/wiki/Contour_interval">contouring interval</a> (I&#8217;m using 4 degrees F here), we can connect some of these interpolated points, creating our contour lines.</p>
<p><img src="http://indiemaps.com/images/isolinesRigid.png" alt="rigid isolines, ready for smoothing" /></p>
<p>With the previous steps stripped away, this creates a passable isoline map.</p>
<p><img src="http://indiemaps.com/images/isolinesRigidMasked.png" alt="masked isolines" /></p>
<p>The lines are rigid, though, and should be smoothed for presentation.  I allow two methods for this.  You can use the &#8220;simple&#8221; method, which just uses the built-in graphics method curveTo between the midpoint of each isoline segment (below with the isoline interval decreased to 3 degrees).</p>
<p><img src="http://indiemaps.com/images/simpleCurve.png" alt="simple curves for isolining" /></p>
<p>The above looks alright, but the curves are not continuous, closed loops can still have hard corners, and the isolines no longer pass through the interpolated points (we have therefore generalized an already-inaccurate interpolation).  My compatriot Andy Woodruff, author of the glorious new <a href="http://cartogrammar.com/blog">Cartogrammar blog</a>, offered to write a nice continuous curve method that ensured isolines would still pass through the interpolated values.  You can read about the method in <a href="http://www.cartogrammar.com/blog/continuous-curves-with-actionscript-3/">his post</a>.  Here she blows:</p>
<p><img src="http://indiemaps.com/images/continuousCurve.png" alt="continuous curves for isolining" /></p>
<p>Bringing it all together, then, and incorporating the only <em><strong>extra</strong></em> feature I wrote (tinting of isolines), here&#8217;s a nice finished isoline map of temperature across the U.S.</p>
<p><img src="http://indiemaps.com/images/isolineFinished.png" alt="finished isoline map of U.S. temperature" /></p>
<p>My new isolining package for Flash/ActionScript3 accomplishes all of the above, requiring only an array of point data with attribute values attached.  The above example, was accomplished with the following lines of code (after drawing the U.S. states from a shapefile).</p>
<div class="codecolorer-container actionscript"><div class="codecolorer" style="font-family: monospace;"><span class="co1">//first, generate the array of triangles (ITriangle objects) from the point data</span><br />
<span class="kw2">var</span> triangles:<span class="kw3">Array</span> = Delaunay.<span class="me1">triangulate</span><span class="br0">&#40;</span>points<span class="br0">&#41;</span>;<br />
Delaunay.<span class="me1">drawDelaunay</span><span class="br0">&#40;</span>triangles, points, triClip, <span class="kw2">false</span><span class="br0">&#41;</span>; <span class="co1">//comment this out if you don't want to draw the triangulation</span><br />
<span class="co1">//generate an array of isolines (isoline objects)</span><br />
<span class="kw2">var</span> isos:<span class="kw3">Array</span> = IsoUtils.<span class="me1">isoline</span><span class="br0">&#40;</span>triangles, points, triClip, <span class="nu0">3</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="co1">//create color and class arrays for tinting the isolines</span><br />
<span class="kw2">var</span> classesArray:<span class="kw3">Array</span> = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span><span class="nu0">40</span>, <span class="nu0">44</span>, <span class="nu0">48</span>, <span class="nu0">52</span>, <span class="nu0">56</span>, <span class="nu0">60</span>, <span class="nu0">64</span>, <span class="nu0">68</span>, <span class="nu0">72</span>, <span class="nu0">76</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> colorsArray:<span class="kw3">Array</span> = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span>0x051CFD, 0x4602FD, 0x6D0EEB, 0x8400FF, 0xC400FF, 0xEA00FF, 0xFF00E2, 0xFF0095, 0xFF0030, 0xFF0015, 0xFB3507<span class="br0">&#41;</span>;<br />
<span class="co1">//then, actually draw them, using a continuous curve</span><br />
IsoUtils.<span class="me1">drawIsolines</span><span class="br0">&#40;</span>isos, triClip, <span class="st0">&quot;continuous&quot;</span>, colorsArray, classesArray, .<span class="nu0">5</span>, .<span class="nu0">95</span><span class="br0">&#41;</span>;</div></div>
<p>The full example is included in the .zip distribution.  Get that here:</p>
<ul>
<li><a href="http://indiemaps.com/code/isolinesAS3.zip">the full .zip thing</a> (in addition to my <span class="incode">isolines</span> class and an example, the archive includes my <a href="http://indiemaps.com/blog/2008/05/delaunay-triangulation-in-actionscript-3/"><span class="incode">delaunay</span> triangulation package</a>, Andy Woodruff&#8217;s <a href="http://www.cartogrammar.com/blog/continuous-curves-with-actionscript-3/"><span class="incode">cubicBezier</span> class</a>, and a slightly modded version of Edvin van Rijkom&#8217;s <a href="http://shp.riaforge.org/"><span class="incode">shp</span> classes</a>, which are used to draw the shapefile in the example .fla)</li>
<li>or, for you browsers, the main <a href="http://indiemaps.com/code/IsoUtils.as.txt"><span class="incode">IsoUtils.as</span> class</a></li>
</ul>
<p>Keep in mind: triangulation is just one interpolation method, and is many ways the least technical (and accurate).  More accurate interpolation techniques include <a href="http://www.ncgia.ucsb.edu/pubs/spherekit/inverse.html">inverse-distance</a> and <a href="http://www.nbb.cornell.edu/neurobio/land/OldstudentProjects/cs490-94to95/clang/kriging.html">kriging</a>.  ***If you&#8217;re having trouble, and your isoline interval is not an integer, check out the comment at line 171 of <a href="http://indiemaps.com/code/IsoUtils.as.txt"><span class="incode">isoUtils.as</span></a>.  Please fix that, BTW.</p>
<p>I meant to add other features, but since I started work this past week, I&#8217;m posting the package as-is, and invite others to modify.  On my wishlist:</p>
<ul>
<li><a href="http://blogs.esri.com/Support/blogs/mappingcenter/archive/2008/05/09/hypsometric-tinting.aspx">hypsometric tinting</a>, or color between the lines, would allow for more effective terrain or temperature mapping</li>
<li>support for projections and other coordinate conversions in the <span class="incode">drawIsolines</span> method.  I have packages for converting lat/long to a number of map projections, but currently the drawIsolines method doesn&#8217;t have support for passing a point coordinate conversion method.</li>
<li>an animated demo.  This thing&#8217;s lightning-fast, so why not?</li>
<li>something that would be <em><strong>super wicked</strong></em> would be if someone would implement <a href="http://www.nagt.org/files/nagt/jge/abstracts/Kennelly_v50n4p428.pdf">Tanaka&#8217;s illuminated contours [pdf]</a> method, that thickens/thins and darkens/lightens lines like so&#8230;<br />
<img src="http://indiemaps.com/images/tanaka1.png" alt="tanaka method" /><br />
&#8230;creating beautiful relief maps like the one below<br />
<img src="http://indiemaps.com/images/tanaka2.png" alt="tanaka illuminated contours" />
</ul>
<p>If you add anything to the package, feel free to post a link to your revised version in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/06/isolining-package-for-actionscript-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>oh hey WordPress</title>
		<link>http://indiemaps.com/blog/2008/06/oh-hey-wordpress/</link>
		<comments>http://indiemaps.com/blog/2008/06/oh-hey-wordpress/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 04:27:15 +0000</pubDate>
		<dc:creator>zach'ry</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[admin]]></category>

		<category><![CDATA[blogging]]></category>

		<category><![CDATA[blogware]]></category>

		<category><![CDATA[blosxom]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://indiemaps.com/blog/?p=42</guid>
		<description><![CDATA[Yeah I switched to WordPress, after being a (sometimes) proud Blosxom (specifically Blosxom.PHP) user for half a year.  It wasn&#8217;t an easy decision, especially as it required porting all my posts and comments, mostly manually, to WordPress, but after using it for just a few days I can tell it will be worth it.
Now there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah I switched to WordPress, after being a (sometimes) proud <a href="http://www.blosxom.com/">Blosxom</a> (specifically <a href="http://js.hu/package/blosxom.php/">Blosxom.PHP</a>) user for half a year.  It wasn&#8217;t an easy decision, especially as it required porting all my posts and comments, mostly manually, to WordPress, but after using it for just a few days I can tell it will be worth it.</p>
<p>Now there&#8217;s nothing wrong with Blosxom (well&#8230;), nor with other minimal blogware, but I gradually grew weary of the quirks (for example, it took me a weekend to debug the commenting functionality) and I began to feel like it was taking away from my writing.</p>
<p>What does this mean for you?</p>
<ul>
<li>I&#8217;ve likely lost a lot of indie cred in your books.</li>
<li>If you subscribe, you&#8217;ll want to update your feed to <a href="http://indiemaps.com/blog/feed/">this</a>.</li>
<li>Outside links to individual blog posts won&#8217;t work. I can hopefully fix or redirect these eventually, but for now we&#8217;re all screwed.</li>
</ul>
<p>On the bright side, you&#8217;re here, which means something&#8217;s working.</p>
]]></content:encoded>
			<wfw:commentRss>http://indiemaps.com/blog/2008/06/oh-hey-wordpress/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
