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

<channel>
	<title>Code: Flickr Developer Blog &#187; clustr</title>
	<atom:link href="http://code.flickr.com/blog/tag/clustr/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.flickr.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 19 Nov 2009 15:59:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flickr Shapefiles Public Dataset 1.0</title>
		<link>http://code.flickr.com/blog/2009/05/21/flickr-shapefiles-public-dataset-10/</link>
		<comments>http://code.flickr.com/blog/2009/05/21/flickr-shapefiles-public-dataset-10/#comments</comments>
		<pubDate>Thu, 21 May 2009 23:58:53 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clustr]]></category>
		<category><![CDATA[creativecommons]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[shapefiles]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=904</guid>
		<description><![CDATA[
				

					photo by dp
				

The name sort of says it all, really, but here&#8217;s the short version:
We are releasing all of the Flickr shapefiles as a single download, available for use under the Creative Commons Zero Waiver. That&#8217;s fancy-talk for &#8220;public domain&#8221;.
The long version is:

To the extent possible under law, Flickr has waived all copyright and related [...]]]></description>
			<content:encoded><![CDATA[<div>
				<a href="http://www.flickr.com/photos/dianeperson/3356117774/" title="Yes, it is. by dp., on Flickr"><img src="http://farm4.static.flickr.com/3442/3356117774_d5b4d901a6.jpg" width="500" height="375" alt="Yes, it is." style="padding:10px;border:1px dotted #ccc;margin-top:20px;margin-bottom:10px;"/></a></p>
<div style="font-size:small;margin-bottom:20px;text-align:right">
					photo by <a href="http://www.flickr.com/photos/dianeperson/3356117774/">dp</a>
				</div>
</p></div>
<p>The name sort of says it all, really, but here&#8217;s the short version:</p>
<p>We are releasing all of <a href="http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/">the Flickr shapefiles</a> as a single download, available for use under the <a href="http://creativecommons.org/publicdomain/zero/1.0/">Creative Commons Zero Waiver</a>. That&#8217;s fancy-talk for &#8220;public domain&#8221;.</p>
<p>The long version is:</p>
<blockquote>
<p>To the extent possible under law, Flickr has waived all copyright and related or neighboring rights to the &#8220;Flickr Shapefiles Public Dataset, Version 1.0&#8221;. This work is published from the United States. <i>While you are under no obligation to do so, wherever possible it would be extra-super-duper-awesome if you would attribute <a href="http://www.flickr.com/">flickr.com</a> when using the dataset. Thanks!</i></p>
</blockquote>
<p>We are doing this for a few reasons.</p>
<ul>
<li style="margin-bottom:15px;">We want people (developers, researchers and anyone else who wants to play) to find new and interesting ways to use the shapefiles and we recognize that, in many cases, this means having access to the entire dataset.</li>
<li style="margin-bottom:15px;font-size:auto;">We want people to feel both comfortable and confident using this data in their projects and so we opted for a public domain license so no one would have to spend their time wondering about the issue of licensing. We also think the work that the <a href="http://www.creativecommons.org/">Creative Commons</a> crew is doing is valuable and important and so we chose to release the shapefiles under the <a href="http://wiki.creativecommons.org/CC0">CC0</a> waiver as a show of support.</li>
<li style="margin-bottom:15px;">We want people to create their own shapefiles and to share them so that other people (including us!) can find interesting ways to use them. We&#8217;re pretty sure there&#8217;s something to this &#8220;shapefile stuff&#8221; even if <a href="http://www.flickr.com/photos/junku/sets/303691/">we can&#8217;t always put our finger on it</a> so if publishing the dataset will encourage others to do the same then we&#8217;re happy to do so.</li>
</ul>
<div>
				<a href="http://www.flickr.com/photos/mbkepp/3205712102/"><img src="http://farm4.static.flickr.com/3344/3205712102_0997aa9218.jpg" height="500" width="500" alt="buster tries to solve our TV problems" style="padding:10px;border:1px dotted #ccc;margin-top:20px;margin-bottom:10px;"/></a></p>
<div style="font-size:small;margin-bottom:20px;text-align:right">
					photo by <a href="http://www.flickr.com/photos/mbkepp/3205712102/">mbkepp</a>
				</div>
</p></div>
<p>The dataset itself is pretty straightforward. It is a single 549MB XML file uncompressed (84MB when zipped). The data model is a simple, pared-down version of what you can already get via <a href="http://www.flickr.com/services/api/">the Flickr API</a> with an emphasis on the <i>shape</i> data.</p>
<p>Everything lives under a single root <code>places</code> element. For example:</p>
<pre style="margin-bottom:20px;">
&lt;place woe_id=&quot;26&quot; place_id=&quot;BvYpo7abBw&quot; place_type=&quot;locality&quot; place_type_id=&quot;7&quot; label=&quot;<a href="http://www.flickr.com/places/CA/QC/Arvida"">Arvida, Quebec, Canada</a>&quot;&gt;
	&lt;shape created=&quot;1226804891&quot; alpha=&quot;0.00015&quot; points=&quot;45&quot; edges=&quot;15&quot; is_donuthole=&quot;0&quot;&gt;
		&lt;polylines <b style="color:pink;">bbox=&quot;48.399932861328,-71.214576721191,48.444801330566,-71.157333374023&quot;</b>&gt;
			&lt;polyline&gt;
				<b style="color:pink;">&lt;!-- points go here--&gt;</b>
			&lt;/polyline&gt;
		&lt;/polylines&gt;
		&lt;shapefile url=&quot;<b style="color:pink;">http://farm4.static.flickr.com/3203/shapefiles/26_20081116_082a565562.tar.gz</b>&quot; /&gt;
	&lt;/shape&gt;

	&lt;!-- and so on --&gt;
&lt;/place&gt;
			</pre>
<p>Aside from the quirkiness of the shapes themselves, it is worth remembering that some of them may just be wrong. We work pretty hard to prevent Undue Wronginess &trade; from occurring but we&#8217;ve seen it happen in the past and so it would be, well, wrong not to acknowledge the possibility. On the other hand we don&#8217;t think we would have gotten this far if it wasn&#8217;t mostly right but if you see something that looks weird, <a href="http://tech.groups.yahoo.com/group/yws-flickr/">please let us know</a></p>
<p>The dataset is available for download, today, from:</p>
<p style="text-align:center;padding-top:20px;padding-bottom:20px;border:1px dotted #666;margin-top:30px;margin-bottom:30px;"><b style="font-family:sans-serif;font-size:large;"><a href="http://www.flickr.com/services/shapefiles/1.0/">http://www.flickr.com/services/shapefiles/1.0/</a></b></p>
<p>The other exciting piece of news is that the <a href="http://www.ygeoblog.com/">Yahoo! GeoPlanet</a> team has also released <a href="http://developer.yahoo.com/geo/">a public dataset of <i>all their WOE IDs</i></a> that include parent IDs, adjacent IDs and aliases (that&#8217;s just more fancy-talk for &#8220;different names for the same place&#8221;) under the <a href="http://creativecommons.org/licenses/by/2.0/">Creative Commons Attribution License</a>.</p>
<p>Which is pretty awesome, really.</p>
<div>
				<a href="http://www.flickr.com/photos/straup/3539879004/" title="Now &amp; Then by straup, on Flickr"><img src="http://farm3.static.flickr.com/2333/3539879004_af2c145472.jpg" width="500" height="338" alt="Now &amp; Then" style="padding:10px;border:1px dotted #ccc;margin-top:20px;margin-bottom:30px;"/></a>
			</div>
<p>They&#8217;ve also released the <a href="http://developer.yahoo.com/geo/placemaker/">GeoPlanet Placemaker API</a>. You feed it a big old chunk of free-form text and then &#8220;the service identifies places mentioned in text, disambiguates those places, and returns unique identifiers (WOEIDs) for each, as well as information about how many times the place was found in the text, and where in the text it was found.&#8221;</p>
<p>Again, <a href="http://www.flickr.com/photos/mbiddulph/2327731497/">Moar Awesome</a>.</p>
<p>And a bit dorky. It&#8217;s true. The data, all by itself, won&#8217;t tell a story. It needs <i>people and history</i> to make that possible but as you poke around all this stuff don&#8217;t forget the value of having a big giant, and now open, database of unique identifiers and what is possible when you use them as a bridge between other things. Without WOE IDs we wouldn&#8217;t have been able to <a href="http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/">generate the shapefiles</a> or do <a href="http://www.flickr.com/places/">the Places project</a> or provide a way to <a href="http://toys.lerdorf.com/archives/49-Select-from-World.html">search for photos by place, rather than location</a>.</p>
<p>Enjoy!</p>
<p>Oh, and those &#8220;unidentified&#8221; outliers, in New York City, that I mentioned in <a href="http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/">the last post about the donut hole shapefiles</a>: <i>The Bronx Zoo, Coney Island and Shea Stadium</i>. Of course!</p>
<div>
				<a href="http://www.flickr.com/photos/straup/3536471854/" title="(if you lived here) by straup, on Flickr"><img src="http://farm4.static.flickr.com/3297/3536471854_7e10436b3a.jpg" width="500" height="375" alt="(if you lived here)" style="padding:10px;border:1px dotted #ccc;margin-top:20px;margin-bottom:10px;"/></a></p>
<div style="font-size:small;margin-bottom:20px;text-align:right">photos by <a href="http://www.flickr.com/photos/ajagendorf25/3457595954/">ajagendorf25</a>, <a href="http://www.flickr.com/photos/auggie_tolosa/3025514778">auggie tolosa</a> and <i>the sky</i>
			</div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/05/21/flickr-shapefiles-public-dataset-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Absence and the Anchor</title>
		<link>http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/</link>
		<comments>http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/#comments</comments>
		<pubDate>Wed, 06 May 2009 21:18:40 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clustr]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[shapefiles]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=885</guid>
		<description><![CDATA[
      
photo by selflesh

Back in January, I wrote a blog post about some experimental work that I&#8217;d been doing with the shapefile data we derive from geotagged photos. I was investigating the idea of generating shapefiles for a given location using not the photos associated with that place but, instead, [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top:20px; margin-bottom:30px;">
      <a href="http://www.flickr.com/photos/selflesh/3147200065/" title="Sketch | 12.28.08 by selflesh, on Flickr"><img src="http://farm4.static.flickr.com/3103/3147200065_cfc089d2d2.jpg" width="500" height="375" alt="Sketch | 12.28.08" style="border:1px dotted #ccc;padding:10px;margin-bottom:10px;"/></a></p>
<div style="font-size:small;text-align:right;"><a href="http://www.flickr.com/photos/selflesh">photo by selflesh</a></div>
</p></div>
<p>Back in January, I wrote a blog post about <a href="http://code.flickr.com/blog/2009/01/12/living-in-the-donut-hole/">some experimental work that I&#8217;d been doing with the shapefile data</a> we derive from geotagged photos. I was investigating the idea of generating shapefiles for a given location using not the photos associated with that place but, instead, from the photos associated with the <i>children</i> of that place. For example, London:</p>
<div style="margin-top:20px; margin-bottom:20px;">
<a href="http://www.flickr.com/photos/straup/3504862388/" title="London by straup, on Flickr"><img src="http://farm4.static.flickr.com/3561/3504862388_484a0b4d72.jpg"  width="500" height="405" alt="London" style="border:1px dotted #ccc;padding:10px;"/></a>
</div>
<p>The larger pink shape is what we (Flickr) think of as the &#8220;city&#8221; of London. The smaller white shapes are its neighbourhoods. The red shapes represent an entirely new shapefile that we created by collecting all the points for those neighbourhoods and running them through <a href="http://code.flickr.com/blog/2009/04/07/the-only-question-left-is/">Clustr</a>, the tool we use to generate shapes.</p>
<p>For lack of any better name I called these shapes &#8220;donut holes&#8221; because, well, because that&#8217;s what they look like. The larger shape is a pretty accurate reflection of the greater metropolitain area of London, the place that has grown and evolved over the years out of the city center that most people would recognize in the smaller red shape. Our goal with the shapefiles has always been to use them to better reverse-geocode people&#8217;s geotagged photos so these sorts of <a href="http://www.flickr.com/search/?q=timbits&#038;ss=2">variations on a theme</a> can better help us understand <a href="http://magicalnihilism.wordpress.com/2009/04/22/a-palimpsest-for-a-place/">where a place is</a>.</p>
<p>Like New York City. No one gets New York right including us try as we might (though, in fairness, it&#8217;s gotten better recently (no, really)) and even I am hard pressed to explain the giant pink blob, below, that is supposed to be New York City. On the other hand, the red donut hole shape even though (perhaps, because) it spills in to New Jersey a bit is actually a pretty good reflection of the way people move through the city as a whole.</p>
<div style="margin-top:20px; margin-bottom:20px;">
<a href="http://www.flickr.com/photos/straup/3505864039/" title="NYC by straup, on Flickr"><img src="http://farm4.static.flickr.com/3347/3505864039_7f71cdef4d.jpg" width="500" height="408" alt="NYC" style="border:1px dotted #ccc;padding:10px;"  /></a>
</div>
<p>It could play New York on TV, I think.</p>
<p>I&#8217;m not sure how to explain the outliers yet, either, other than to say the shapefiles for city-derived donut holes may contain up to 3 polygons (or &#8220;records&#8221; in proper <a href="http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf">Shapefile-speak</a>) compared to a single polygon for plain-old city shapes so if nothing else it&#8217;s an indicator of where people are taking photos.</p>
<p><i>If the shapefiles themselves are uncharted territory, the donut holes are the fuzzy horizon even further off in the distance. We&#8217;re not really sure where this will take us but we&#8217;re pretty sure there&#8217;s something to it all so we&#8217;re eager to share it with people and see what they can make of it too.</i></p>
<div style="margin-top:20px; margin-bottom:20px;">
<a href="http://www.flickr.com/photos/straup/3504858798/" title="Vietnam by straup, on Flickr"><img src="http://farm4.static.flickr.com/3556/3504858798_517fb8c448_b.jpg"  width="512" height="1024" alt="Vietnam" style="border:1px dotted #ccc;padding:10px;"/></a>
</div>
<p>(This is probably still my favourite shapefile ever.)</p>
<p>Starting today, the donut hole shapes are available for developers to use with their developer magic via the <a href="http://www.flickr.com/services/api">Flickr API</a>.</p>
<p>At the moment we are only rendering donut hole shapefiles for cities and countries. I suppose it might make sense to do the same for continents but we probably won&#8217;t render states (or provinces) simply because there is too much empty unphotographed space between the cities to make it very interesting.</p>
<p>There are also relatively few donut holes compared to the corpus of all the available shapefiles so rather than create an entirely new API method we&#8217;ve included them in the <a href="http://www.flickr.com/services/api/flickr.places.getShapeHistory.html">flickr.places.getShapeHistory</a> API method which returns all the shapefiles ever created for a place. Each <code>shape</code> element now contains an <b>is_donuthole</b> attribute. Here&#8217;s what it looks like for <a href="http://www.flickr.com/places/United+Kingdom/England/London">London</a>:</p>
<pre style="margin-top:20px; margin-bottom:30px;">
&lt;shapes total="6" woe_id="44418" place_id=".2P4je.dBZgMyQ"
	place_type="locality" place_type_id="7"&gt;

	&lt;shape created="1241477118" alpha="9.765625E-05" count_points="275464"
		count_edges="333" <b style="color:pink;">is_donuthole="1"</b>&gt;

		&lt;!-- shape data goes here... --&gt;

	&lt;/shape&gt;

	&lt;!-- and so on -&gt;

&lt;/shapes&gt;
</pre>
<p>Meanwhile, the <a href="http://www.flickr.com/services/api/flickr.places.getInfo.html">places.getInfo</a> API method has been updated to included a <b>has_donuthole</b> attribute, to help people decide whether it&#8217;s worth calling the <code>getShapeHistory</code> method or not. Again, using London as the example:</p>
<pre style="margin-top:20px; margin-bottom:30px;">

&lt;place place_id=".2P4je.dBZgMyQ" woeid="44418" latitude="51.506"
       longitude="-0.127" place_url="/United+Kingdom/England/London"
       place_type="locality" place_type_id="7" timezone="Europe/London"
       name="London, England, United Kingdom" <b style="color:pink;">has_shapedata="1"</b>&gt;

	&lt;shapedata created="1239037710" alpha="0.00029296875" count_points="406594"
                   count_edges="231" <b style="color:pink;">has_donuthole="1" is_donuthole="0"</b>&gt;

        &lt;!-- and so on --&gt;
&lt;/place&gt;
</pre>
<p>Finally, here&#8217;s another picture by <a href="http://selflesh.blogspot.com/">Shannon Rankin</a> mostly just because I like her work so much. Enjoy!</p>
<div style="margin-top:20px; margin-bottom:20px;">
<a href="http://www.flickr.com/photos/selflesh/2913186810/" title="Guardian by selflesh, on Flickr"><img src="http://farm4.static.flickr.com/3172/2913186810_2e8f3fd2d6.jpg" width="500" height="500" alt="Guardian" style="border:1px dotted #ccc;padding:10px;margin-bottom:10px;"/></a></p>
<div style="font-size:small;text-align:right;"><a href="http://www.flickr.com/photos/selflesh">photo by selflesh</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Only Question Left Is</title>
		<link>http://code.flickr.com/blog/2009/04/07/the-only-question-left-is/</link>
		<comments>http://code.flickr.com/blog/2009/04/07/the-only-question-left-is/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 17:21:58 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clustr]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[geotags]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[shapefiles]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=802</guid>
		<description><![CDATA[
            
photo by Shawn Allen

At the Emerging Technology conference this year Stamen Design&#8217;s Michal Migurski and Shawn Allen led an afternoon workshop called &#8220;Maps from Scratch: Online Maps from the Ground Up&#8221; where people made digital maps from, well&#8230; scratch.
If you&#8217;ve never heard of [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top:25px;margin-bottom:25px;">
            <a href="http://www.flickr.com/photos/shazbot/3282821808/"><img src="http://farm4.static.flickr.com/3504/3282821808_da359404ff.jpg" height="457" width="500" alt="" style="border:1px dotted #ccc; padding:10px;" /></a></p>
<p style="text-align:right;font-size:small;">photo by <a href="http://www.flickr.com/photos/shazbot/3282821808/in/set-72157614736071588/">Shawn Allen</a></p>
</p></div>
<p>At the <a href="http://en.oreilly.com/et2009/public/content/home">Emerging Technology</a> conference this year <a href="http://www.stamen.com/">Stamen Design&#8217;s</a> Michal Migurski and Shawn Allen led an afternoon workshop called &#8220;<a href="http://en.oreilly.com/et2009/public/schedule/detail/5555">Maps from Scratch: Online Maps from the Ground Up</a>&#8221; where people made digital maps from, well&#8230; scratch.</p>
<p>If you&#8217;ve never heard of Stamen they&#8217;ve been doing some of the most exciting work around the idea of &#8220;<a href="http://mike.teczno.com/notes/oakland-crime-maps/XI.html">custom cartography</a>&#8221; including: <a href="http://cabspotting.org/">Cabspotting</a>, <a href="http://oakland.crimespotting.org/">Oakland Crimespotting</a> and <a href="http://teczno.com/old-oakland/">Old Oakland Maps</a>, work for the <a href="http://www.tom-carden.co.uk/2009/02/12/new-maps-at-london2012com/">London Olympics</a>, and <a href="http://www.sensescape.com/2009/02/cloudmade/">designing custom map tiles for CloudMade</a>. (Stamen also built the recently launched <a href="http://www.flickr.com/explore/clock">Flickr Clock</a> :-)</p>
<p>All of this is interesting in its own right; proof that there is still a lot of room in which to imagine maps beyond so-called <a href="http://mappinghacks.com/2006/04/07/web-map-api-roundup/">red-dot fever</a>. All of this is extra interesting in light of Apple&#8217;s recent announcement to allow developers to define <a href="http://arstechnica.com/apple/news/2009/03/iphone-sdk-focus-maps-from-your-apps.ars">their own map tiles</a> in the next iPhone OS release. All of this super-duper interesting because it is work produced by a team of <i>less than 10 people</i>.</p>
<p>The <a href="http://www.osgeo.org/">tools</a>, and increasingly the <a href="http://magicalnihilism.wordpress.com/2009/04/03/data-as-seductive-material/">data</a>, to build <a href="http://blog.everyblock.com/2008/feb/18/maps/">the maps we want</a> are bubbling up and becoming easier and more accessible to more people every day. Easier, anyway.</p>
<blockquote style="font-family:sans-serif;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:10px;padding-top:20px;margin-top:10px;margin-bottom:20px;">
<p>&#8220;One of the things that made this tutorial especially interesting for us was our use of Amazon&#8217;s EC2 service, the &#8220;Elastic Compute Cloud&#8221; that provides billed-by-the-hour virtual servers with speedy internet connections and a wide variety of operating system and configuration options. Each participant received a login to a freshly-made EC2 instance (a single server) with code and lesson data already in-place. We walked through the five stages of the tutorial with the group coding along and making their own maps, starting from incomplete initial files and progressing through added layers of complexity.</p>
<p>&#8220;Probably the biggest hassle with open source geospatial software is getting the full stack installed and set up, so we&#8217;ve gone ahead and made the AMI (Amazon Machine Image, a template for a virtual server) available publicly for anyone to use, <a href="http://www.mapsfromscratch.com">along with notes on the process we used to create it</a>.&#8221;</p>
<p style="text-align:right;">&#8212; <a href="http://mike.teczno.com/notes/maps-from-scratch.html">Michal Migurski</a></p>
</blockquote>
<p>The Maps From Scratch (MFS) AMI may not be a Leveraged Turn Key Synergistic <a href="http://www.catb.org/~esr/jargon/html/D/DWIM.html">Do-What-I-Mean</a> Solutions Platform but, really, anything that dulls the hassle and cost of setting up specialized software is <i>a great big step in the right direction</i>. I mention all of this because Clustr, the command-line application we use to <a href="http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/">derive shapefiles from geotagged photos</a>, has recently been added to the list of tools bundled with the MFS AMI.</p>
<p>Specifically: <b>ami-4d769124</b>.</p>
<p>We&#8217;re super excited about this because it means that Clustr is that much easier for people to use. We expressly chose to make Clustr an open-source project to share some of the tools we&#8217;ve developed with the community but it has also always had a relatively high barrier to entry. Building and configuring a Unix machine is often more that most people are interested in, let alone compiling big and complicated maths libraries from scratch. Clustr on EC2 is not a magic pony factory but hopefully it will make the application a little friendlier.</p>
<div  style="margin-top:25px;margin-bottom:25px;">
<a href="http://www.flickr.com/photos/straup/3295483210/" title="Shapes by straup, on Flickr"><img src="http://farm4.static.flickr.com/3564/3295483210_5631c5bfc5.jpg" width="500" height="375" alt="Shapes" style="border:1px dotted #ccc; padding:10px;" /></a>
       </div>
<p>Creating and configuring an EC2 account is too involved for this post but there are lots of good resources out there, starting with <a href="http://aws.amazon.com/ec2/">Amazon&#8217;s own documentation</a>. When I&#8217;m stuck I usually refer back to Paul Stamatiou&#8217;s <a href="http://paulstamatiou.com/2008/04/05/how-to-getting-started-with-amazon-ec2http://paulstamatiou.com/2008/04/05/how-to-getting-started-with-amazon-ec2">How To: Getting Started with Amazon EC2</a>.</p>
<p>Assuming that you familiar using Unix command line tools, let&#8217;s also assume that you have gotten all your ducks in a row and are ready to fire up the MFS AMI:</p>
<pre style="margin-bottom:20px;">
your-computer> ec2-run-instances <b style="color:#000;">ami-4d769124</b> -k example-keypair

your-computer> ec2-describe-instances
</pre>
<p>At which point, you&#8217;ll see something like this:</p>
<pre style="margin-bottom:20px;">
INSTANCE i-xxxxxxxx <b style="color:#000;">ami-4d769124</b> ec2-xxxxx.amazonaws.com blah blah blah
</pre>
<p><code>i-xxxxxxxx</code> is the unique identifier of your current EC2 session. You will need this to tell Amazon to shut down the server and stop billing you for its use.</p>
<p><code>ec2-xxxxx.amazonaws.com</code> is the address of your EC2 server on the Internets.</p>
<p>Once you have that information, you can start using Clustr. First, log in and create a new folder where you&#8217;ll save your shapefile:</p>
<pre style="margin-bottom:20px;">
your-computer> ssh -i example-rsa-key root@ec2-xxxxx.amazonaws.com

ec2-xxxxx.amazonaws.com> mkdir /root/clustr-test
</pre>
<p>The MFS AMI comes complete with a series of sample &#8220;points&#8221; files to render. We&#8217;ll start with the list of <a href="http://www.flickr.com/photos/revdancatt/3398050524/">all the geotagged photos uploaded to Flickr</a> on March 24:</p>
<pre style="margin-bottom:20px;">
ec2-xxxxx.amazonaws.com> /usr/bin/clustr -v -a 0.001 \
   <b style="color:#000;">/root/clustr/start/points-2009-03-24.txt</b> \
   /root/clustr-test/clustr-test.shp
</pre>
<p>By default Clustr generates a series of files named <code>clustr</code> (dot <code>shp</code>, dot <code>dbf</code> and dot <code>shx</code> because <a href="http://en.wikipedia.org/wiki/Shapefile">shapefiles</a> are funny that way) in the current working directory. You can specify an alternate name by passing a fully qualified path as the last argument to Clustr. When run in verbose mode (that&#8217;s the <code>-v</code> flag) you&#8217;ll see something like this:</p>
<pre style="margin-bottom:20px;">
Reading points from input.
Got 44410 points for tag '20090324'.
799 component(s) found for alpha value 0.001.
- 23 vertices, area: 86.7491, perimeter: 71.9647
- 32 vertices, area: 1171.51, perimeter: 41.3095
- 8 vertices, area: 18.5112, perimeter: 0.529504
- 12 vertices, area: 1484.81, perimeter: 10.8544
...
Writing 505 polygons to shapefile.</pre>
<p>Yay!</p>
<pre style="margin-bottom:20px;">
ec2-xxxxx.amazonaws.com> ls -la /root/clustr-test
total 172
drwxr-xr-x 2 root root  4096 2009-04-07 03:14 .
drwxr-xr-x 5 root root  4096 2009-04-07 02:22 ..
-rw-r--r-- 1 root root 52208 2009-04-07 03:14 clustr-test.dbf
-rw-r--r-- 1 root root 97388 2009-04-07 03:14 clustr-test.shp
-rw-r--r-- 1 root root  4140 2009-04-07 03:14 clustr-test.shx
</pre>
<p>Now copy the shapefiles back to your computer and terminate your EC2 instance (or you might be surprised when you get your next billing statement from Amazon).</p>
<pre style="margin-bottom:20px;">
ec2-xxxxx.amazonaws.com> scp -r /root/clustr-test \
   you@your-computer:/path/to/your/desktop/

ec2-xxxxx.amazonaws.com> exit

your-computer> ec2-terminate-instances i-xxxxxxxxx
</pre>
<p>I created this image (using the open source <a href="http://www.qgis.org/">QGIS</a> application) for all those points by running Clustr multiple times with alpha numbers ranging from 0.05 to <em>603</em>:</p>
<div style="margin-top:25px;margin-bottom:25px;">
            <a href="http://www.flickr.com/photos/straup/3393441637/" title="SHAPEZ (2009-03-24) by straup, on Flickr"><img src="http://farm4.static.flickr.com/3611/3393441637_9c2537345a.jpg" width="500" height="292" alt="SHAPEZ (2009-03-24)"  style="border:1px dotted #ccc; padding:10px;" /></a></p></div>
<p>Here&#8217;s another version rendered using the <a href="http://code.google.com/p/mapnik-utils/wiki/Nik2Img">nik2img</a> application and a custom style sheet, both included with the MFS distribution:</p>
<div style="margin-top:25px;margin-bottom:25px;">
          <a href="http://www.flickr.com/photos/straup/3419358867/" title="clustr by straup, on Flickr"><img src="http://farm4.static.flickr.com/3608/3419358867_a0a421c730.jpg" width="500" height="333" alt="clustr"  style="border:1px dotted #ccc; padding:10px;" /></a>
        </div>
<p>Here&#8217;s one of all the geotagged photos tagged &#8220;<a href="http://www.flickr.com/photos/tags/route66">route66</a>&#8221; (with alpha numbers ranging from 0.001 to 0.5):</p>
<div style="margin-top:25px;margin-bottom:25px;">
            <a href="http://www.flickr.com/photos/straup/3390234642/" title="tag=route66, alpha=(0.001 - 0.5) by straup, on Flickr"><img src="http://farm4.static.flickr.com/3658/3390234642_aa85616023.jpg" width="500" height="292" alt="tag=route66, alpha=(0.001 - 0.5)"  style="border:1px dotted #ccc; padding:10px;" /></a></p>
<p style="font-style:italic;font-size:small;text-align:right;">Apologies and big sloppy kisses to Stamen&#8217;s own <a href="http://stamen.com/projects/mappr">Mappr</a> (first released in 2005).</p>
</p></div>
<p>Or tagged &#8220;<a href="http://www.flickr.com/photos/tags/caltrain">caltrain</a>&#8220;, the commuter train that runs between San Francisco and San Jose:</p>
<div style="margin-top:25px;margin-bottom:25px;">
		<a href="http://www.flickr.com/photos/straup/3385980494/" title="tag=caltrain, alpha=0.001 by straup, on Flickr"><img src="http://farm4.static.flickr.com/3600/3385980494_260db12e99.jpg" width="500" height="314" alt="tag=caltrain, alpha=0.001" style="border:1px dotted #ccc; padding:10px;" /></a>
        </div>
<p>Meanwhile, Matt Biddulph at <a href="http://www.dopplr.com/">Dopplr</a> has been generating <a href="http://www.flickr.com/photos/mbiddulph/tags/clustr/">a series of visualizations</a> depicting the shape of where to eat, stay and explore for the cities in their <a href="http://blog.dopplr.com/2009/03/20/the-dopplr-new-york-release-rolling-out-the-social-atlas/">Places</a> database. This is what <a href="http://www.dopplr.com/place/gb/london"> London</a> looks like:</p>
<div style="margin-top:25px;margin-bottom:25px;">
          <a href="http://www.flickr.com/photos/mbiddulph/3421335356/"><img src="http://farm4.static.flickr.com/3306/3421335356_f4757613ce.jpg" height="279" width="500" style="border:1px dotted #ccc; padding:10px;" /></a>
	</div>
<p>Or: &#8220;<a href="http://www.flickr.com/photos/mbiddulph/3421922514/">London dopplr places, filtered to only places my social network has been to, clustrd</a>&#8220;.</p>
<p>One of the things I like the most about Clustr is that it will generate shape(file)s for any old list of geographic coordinates. Now that most of the hassle of setting up Clustr has been (mostly) removed, the only question left is: <i><a href="http://magicalnihilism.wordpress.com/2009/04/06/my-first-cloudmade-map-style-lynchian_mid/">What do you want to render?</a></i></p>
<blockquote style="font-family:sans-serif;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:10px;padding-top:20px;margin-top:20px;margin-bottom:20px;">
<p>&#8220;They do not detail locations in space but histories of movement that constitute space.&#8221;</p>
<p style="text-align:right;">&#8212; <a href="http://cyberbadger.blogspot.com/2008/11/map-studies-manifesto-complete.html">Rob Kitchin, Chris Perkins</a></p>
</blockquote>
<p>If you&#8217;re like me you&#8217;re probably thinking something like &#8220;Wouldn&#8217;t it be nice if I could just POST a points file to a webservice running on the AMI and have it return a compressed shapefile?&#8221; It sure would so I wrote <a href="http://github.com/straup/ws-clustr/tree/master">a quick and dirty version</a> (not included in the MFS AMI; you&#8217;ll need to do that yourself) in PHP but if there are any Apache hackers in the house who want to make a zippy C version that would be even Moar Awesome &trade;.</p>
<p>If you don&#8217;t want to use the MFS AMI and would rather just install Clustr on your own machine instance, here are the steps I went through to get it work on a Debian 5.0 (Lenny) AMI; presumably the steps are basically the same for any Linux flavoured operating system:</p>
<pre style="margin-bottom:20px;">
$> apt-get update
$> apt-get install libcgal-dev
$> apt-get install libgdal1-dev
$&gt; apt-get install subversion

$&gt; svn co <a href="http://code.flickr.com/svn/trunk/clustr/">http://code.flickr.com/svn/trunk/clustr/</a>
$&gt; cd clustr
$&gt; make
$&gt; cp clustr /usr/bin/

$&gt; clustr -h

clustr 0.2 - construct polygons from tagged points
written by Schuyler Erle

(c) 2007-2008 Yahoo!, Inc.

Usage: clustr [-a &lt;n&gt;] [-p] [-v] &lt;input&gt; &lt;output&gt;
   -h, -?      this help message
   -v          be verbose (default: off)
   -a &lt;n&gt;      set alpha value (default: use "optimal" value)
   -p          output points to shapefile, instead of polygons

If &lt;input&gt; is missing or given as "-", stdin is used.
If &lt;output&gt; is missing, output is written to clustr.shp.
Input file should be formatted as: &lt;tag&gt; &lt;lon&gt; &lt;lat&gt;\n
Tags must not contain spaces.
        </pre>
<p>Just like that!</p>
<div style="margin-top:25px;margin-bottom:25px;">
            <a href="http://www.flickr.com/photos/timo/3397788209/"><img src="http://farm4.static.flickr.com/3608/3397788209_931d2d2acb.jpg" height="333" width="500" alt=""  style="border:1px dotted #ccc; padding:10px;" /></a></p>
<p style="font-size:small;text-align:right;">photo by <a href="http://www.flickr.com/photos/timo">Timo Arnall</a></p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2009/04/07/the-only-question-left-is/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Shape of Alpha</title>
		<link>http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/</link>
		<comments>http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 21:21:51 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[geo]]></category>
		<category><![CDATA[clustr]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=278</guid>
		<description><![CDATA[


We have a lot of geotagged photos
Almost ninety million, as I write this, and the numbers keep growing especially as nearly every new smart phone released to market has not only a camera but also the ability to capture location information with it.
For every geotagged photo we store up to six Where On Earth (WOE) [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top:20px;margin-bottom:20px;">
<a href="http://www.flickr.com/photos/straup/2853741772/" title="Untitled #1221325485 by straup, on Flickr"><img src="http://farm4.static.flickr.com/3092/2853741772_928938d420.jpg" width="500" height="375" alt="Untitled #1221325485" style="border:1px dotted #ccc;padding:10px;" /></a>
</div>
<h2 style="margin-bottom:15px;">We have a lot of geotagged photos</h2>
<p>Almost ninety million, as I write this, and the numbers keep growing especially as nearly every new <q>smart</q> phone released to market has not only a camera but also the ability to capture location information with it.</p>
<p>For every geotagged photo we store up to six <a href="http://developer.yahoo.com/geo/">Where On Earth (WOE)</a> IDs. These are unique numeric identifiers that correspond to the hierarchy of places where a photo was taken: the neighbourhood, the town, the county, and so on up to the continent. This process is usually referred to as <a href="http://code.flickr.com/blog/2008/09/04/whos-on-first/">reverse-geocoding</a>.</p>
<p>Over time this got us wondering: If we plotted all the geotagged photos associated with a particular WOE ID, would we have enough data to generate a mostly accurate contour of that place? Not a perfect representation, perhaps, but something more fine-grained than a bounding box. It turns out we can.</p>
<p>So, starting today there are 150,000 (and counting) WOE IDs with proper (-ish) shape data, available via the <a href="http://www.flickr.com/services/api">Flickr API</a>. What kind of shapes, you ask?</p>
<p>Continents:</p>
<table>
<tr>
<td><a href="http://flickr.com/photos/straup/2986605405/"><img src="http://farm4.static.flickr.com/3161/2986605405_f50d14c3dc_m.jpg" style="border:none;" /></a></td>
<td width="5%;">&nbsp;</td>
<td valign="top"><a href="http://flickr.com/photos/straup/2986605381/"><img src="http://farm4.static.flickr.com/3153/2986605381_11c2007119_m.jpg"style="border:none;"  /></a></td>
</tr>
</table>
<p>Countries:</p>
<table>
<tr>
<td><a href="http://flickr.com/photos/straup/2972130238/"><img src="http://farm4.static.flickr.com/3004/2972130238_70c47e52b3_m.jpg" style="border:none;" /></a></td>
<td width="5%;">&nbsp;</td>
<td><a href="http://flickr.com/photos/straup/2972130754/"><img src="http://farm4.static.flickr.com/3210/2972130754_71fe99ae37_m.jpg"style="border:none;" /></a></td>
</tr>
</table>
<p>States and cities:</p>
<table>
<tr>
<td><a href="http://flickr.com/photos/straup/2971287541/"><img src="http://farm4.static.flickr.com/3288/2971287541_27e6a06a21_m.jpg" style="border:none;" /></a></td>
<td width="5%;">&nbsp;</td>
<td><a href="http://flickr.com/photos/straup/2972131146/"><img src="http://farm4.static.flickr.com/3067/2972131146_92c785b00c_m.jpg" style="border:none;" /></a></td>
</tr>
</table>
<p>Even neighbourhoods:</p>
<table>
<tr>
<td><a href="http://flickr.com/photos/straup/2972131416/"><img src="http://farm4.static.flickr.com/3254/2972131416_3d2256360e_m.jpg" style="border:none;" /></a></td>
<td width="5%;">&nbsp;</td>
<td><a href="http://flickr.com/photos/straup/2986628225/"><img src="http://farm4.static.flickr.com/3166/2986628225_f1c3e1c39c_m.jpg" style="border:none;" /></a></td>
</tr>
</table>
<p>Each one of those illustrations represents the boundaries of a particular place whose outline was generated using <strong>nothing but the latitudes and longitudes of the geotagged photos associated with that location&#8217;s WOE ID</strong>. No <a href="http://en.wikipedia.org/wiki/Geographic_information_system">GIS</a> information was harmed in the creation of these shapes.</p>
<p><em>How cool is that?!</em></p>
<h2 style="margin-bottom:15px;">How does it work?</h2>
<p>The short version is: Scary and complicated maths. The longer version is: We are generating <a href="http://biogeometry.duke.edu/software/alphashapes/index.html">alpha shapes</a> using the set of unique latitudes and longitudes associated with a WOE ID. The long version, to quote <a href="http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Alpha_shapes_3/Chapter_main.html">Tran Kai Frank Da and Mariette Yvinec</a>, is:</p>
<blockquote style="font-family:sans-serif; margin-left:10%;margin-right:10%;">
<p>&#8220;Imagine a huge mass of ice-cream making up the space &#8230; and containing the points as <q>hard</q> chocolate pieces. Using one of those sphere-formed ice-cream spoons we carve out all parts of the ice-cream block we can reach without bumping into chocolate pieces, thereby even carving out holes in the inside (eg. parts not reachable by simply moving the spoon from the outside). We will eventually end up with a (not necessarily convex) object bounded by caps, arcs and points. If we now straighten all <q>round</q> faces to triangles and line segments, we have an intuitive description of what is called the alpha shape&#8230;&#8221;</p>
</blockquote>
<p>(There are also some useful illustrations of what that all means on Francois Belair&#8217;s <a href="http://cgm.cs.mcgill.ca/~godfried/teaching/projects97/belair/alpha.html">	Everything You Always Wanted to Know About Alpha Shapes But Were Afraid to Ask</a> website.)</p>
<h2 style="margin-bottom:15px;">The community of authority and the authority of community</h2>
<p>This is the important part: Many, if not most, of these shapes will look a little weird. Possibly even &#8220;wrong&#8221;. This is both okay and to be expected for a few reasons, at least.</p>
<ul>
<li>
<p>Sometimes we just don&#8217;t have enough geotagged photos in a spot to make it is possible to create a shapefile. Even if we do have enough points to create a shape there aren&#8217;t enough to create a shape that you&#8217;d recognize as the place where you live. We chose to publish those shapes anyway because it shows both what we know and don&#8217;t about a place and to encourage users to help us fix mistakes.</p>
<p>If the shape of the neighbourhood is incomplete or looks weird why not consider organizing a <a href="http://www.flickr.com/photos/tags/photowalk/map">photowalk</a> around its edges and when you get home add them to the map. The next time we generate a new shapefile for that neighbourhood it should look more like the place you recognize!</p>
</li>
<li>
<p>We did a bad job reverse geocoding photos for a particular spot and they&#8217;ve ended up associated with the wrong place. We&#8217;ve learned quite a lot about how to do a better job of it in the last two years but there is a limit to how much human awareness and subtlety we can codify. Sometimes, the data we have to try and work out what&#8217;s going on is just bad or out of date.</p>
<p>Ultimately, that&#8217;s why we added <a href="http://code.flickr.com/blog/2008/08/08/location-keeping-it-real-on-the-streets-yo/">the tools to help users correct their geotagged photos</a> so that we can adjust things to their understanding of the world and begin to map facts on the ground rather than from on high.</p>
</li>
<li>
<p>We are not very sophisticated yet in how we assign the size of the alpha variable when we generate shapes. As far as we can tell no one else has done this sort of thing so like reverse-geocoding we are learning as we go. For example, with the exception of continents and countries we boil all other places down to a single contiguous shape. We do this by slowly cranking up the size of the ice cream scoop which in turn can lead to a loss of fidelity.</p>
<p>Does the <q>shape</q> of Florida, or of Italy, include the waters that lie between the mainland and the surrounding islands? It&#8217;s not usually the way we imagine the territory that a place occupies but I think it probably does. On the other hand, including the ocean between California and Hawaii as <q>part of</q> the United States would be kind of dumb.</p>
</li>
<p>Are any of these the correct decisions? We&#8217;re not sure yet.</p>
</li>
</ul>
<p>A concrete example to illustrate the point. Here are two versions of the island of <a href="http://www.flickr.com/places/Canada/Quebec/Montreal">Montreal</a>, each generated from the same set of coordinates. The version on the left used an alpha number (an ice cream spoon) large enough to ensure that only a single shape was created compared with the version on the right that allowed for two shapes.</p>
<table>
<tr>
<td><img src="http://farm4.static.flickr.com/3189/2972131778_d6d2b9a629_m.jpg" /></td>
<td width="5%;">&nbsp;</td>
<td valign="top"><img src="http://farm4.static.flickr.com/3031/2986660583_6f6bd6f113_m.jpg" width="240" height="181" alt="" /></td>
</tr>
</table>
<p>What&#8217;s going on, then? All those photos taken in St. Jean-sur-Richelieu (20 minutes south of Montreal) were added to the map back when we first added geotagging to the site and the information about the province of Quebec was not as detailed as what we have now. Ultimately, we decided to include the version on the left because as <a href="http://magicalnihilism.wordpress.com/2008/10/11/bionic-noticing-on-irving-street/">Matt Jones recently said</a>:</p>
<blockquote style="font-family:sans-serif; margin-left:10%;margin-right:10%;">
<p>&#8220;<em>The long here</em> that Flickr represents back to me is becoming only more fascinating and precious as geolocation starts to help me understand how I identify and relate to place. The fact that Flickr&#8217;s mapping is now starting to <a href="http://code.flickr.com/blog/2008/09/04/whos-on-first/">relate location to me the best it can in human place terms</a> is fascinating &#8211; they do a great job, but where it falls down it falls down gracefully, inviting corrections and perhaps <a href="http://www.flickr.com/photos/blackbeltjones/2920892513/#comment72157607816350512">starting conversation</a>.&#8221;</p>
</blockquote>
<p>As with any visualization of aggregate data there are likely to be areas of contention. One of the reasons we&#8217;re excited to make this stuff available is that much of it simply isn&#8217;t available anywhere else and the users and the developer community who make up Flickr have a gift for building magic on top of the API so we&#8217;re doubly-excited to see what people do with it.</p>
<p>That said please remember that this it is an aggregate view of things and should be treated more like the <a href="http://www.flickr.com/places/US/CA/SF#zeitgeist">the zeitgeist of a place</a> and not as capital-C confirmed facts on the ground or our taking sides in any conflicts (real, imagined or otherwise) between friends and neighbours.</p>
<p>These are not maps you should use to guide your spaceship back to Earth but they&#8217;re probably good enough to explore the possibilities.</p>
<h2 style="margin-bottom:15px;">Clustr</h2>
<div style="margin-top:20px;margin-bottom:20px;">
<a href="http://flickr.com/search/?w=all&#038;q=schuyler+erle&#038;m=text" title="UR DOTZ I HAS DEM"><img src="http://farm4.static.flickr.com/3252/2985372999_dc8fca06e2.jpg" width="500" height="375" alt="UR DOTZ I HAS DEM" style="border:1px dotted #ccc;padding:10px;" /></a>
</div>
<p>Meanwhile, back in the nuts-and-bolts department: The actual alpha shapes are generated by a program called Clustr, written for us by <a href="http://iconocla.st/cv.html">the fantabulous Schuyler Erle</a>.</p>
<p>Clustr is a command-line application written in C++ that takes as its arguments the path to a file containing a list of points (the hard chocolate pieces) and an alpha parameter (the ice cream spoon) and generates a <a href="http://en.wikipedia.org/wiki/Shapefile">shapefile</a> describing the contour (the alpha shape) of that list. Anecdotally, we&#8217;ve seen Clustr plow through a file with four million unique coordinates (representing the continental United States, Alaska and Hawaii) in under three minutes on some pretty modest hardware.</p>
<p>The shapedata for a WOE ID is available via the Flickr API using the <a href="http://www.flickr.com/services/api/flickr.places.getInfo.html">flickr.places.getInfo</a> method.</p>
<p>Not all places have shape data yet so the root &lt;place&gt; element contains a <code>has_shapedata</code> attribute for checking at a glance. Otherwise you can test for the presence of a &lt;shapedata&gt; element. It will look like this:</p>
<pre>
&lt;place place_id=&quot;4hLQygSaBJ92&quot; woeid=&quot;3534&quot;
	latitude=&quot;45.512&quot; longitude=&quot;-73.554&quot;
	place_url=&quot;/Canada/Quebec/Montreal&quot; place_type=&quot;locality&quot;
	name=&quot;Montreal, Quebec, Canada&quot;
	<strong>has_shapedata=&quot;1&quot;</strong>&gt;

   &lt;!-- all the usual places hierarchy elements --&gt;

   <strong>&lt;shapedata created=&quot;1223513357&quot; alpha=&quot;0.012359619140625&quot;
      count_points=&quot;34778&quot; count_edges=&quot;52&quot;&gt;
      &lt;polylines&gt;
         &lt;polyline&gt;
            45.427627563477,-73.589645385742 45.428966522217,-73.587898254395, etc...
         &lt;/polyline&gt;
      &lt;/polylines&gt;
   &lt;/shapedata&gt;</strong>

&lt;/place&gt;
</pre>
<p style="text-decoration:line-through;">Sometime next week, we will also include links to a real live <a href="http://en.wikipedia.org/wiki/Shapefile">ESRI shapefile</a>, the well-known and mostly-loved lingua franca of the GIS community, for each WOE ID. They were supposed to be included with this release but because of a last minute glitch they need to be prettied up a little first. We think that the inclusion of the polylines will be enough to keep people busy until then. Shapefiles will be included, in the API, as a link to a compressed file you can download separately. For example:</p>
<p style="font-style:italic;">Update: The first round of (ESRI) <a href="http://en.wikipedia.org/wiki/Shapefile">shapefiles</a> have been reprocessed and are now available via the API. Shapefiles are included as a link to a compressed file you can download separately. For example:</p>
<pre>
    &lt;urls&gt;
       <strong>&lt;shapefile&gt;
          http://farm4.static.flickr.com/9999/shapefiles/3534_20081020_S33KR3TSHAPE.tar.gz
       &lt;/shapefile&gt;</strong>
    &lt;/urls&gt;
</pre>
<p>Our plan is to generate new renderings on a relatively constant basis, something like every month or two, though we haven&#8217;t firmed up any of those details yet. We&#8217;ll post about them here or on the <a href="http://tech.groups.yahoo.com/group/yws-flickr/">API mailing list</a> as things are worked out.</p>
<h2 style="margin-bottom:15px;">But wait, there&#8217;s more!</h2>
<p>Along with the shape data the source code for Clustr is available in the Flickr Code <a href="http://code.flickr.com/svn/trunk/clustr/">repository</a> and through <a href="http://code.flickr.com/trac/browser/trunk/clustr">our trac install</a>, distributed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL (version 2)</a>.</p>
<p>Clustr has two major dependencies not included with the source that you will need to install yourself in order to use. They are the <a href="http://www.cgal.org/">Computational Geometry Algorithms Library</a> (CGAL) and the <a href="http://www.gdal.org/">Geospatial Data Abstraction Library</a> (GDAL). Both are relatively straightforward to install on <a href="http://packages.ubuntu.com/">Linux</a> and <a href="http://www.freshports.org/">BSD</a> flavoured operating systems; Windows and OS X are still a bit of a chore.</p>
<p>You probably won&#8217;t be able to download Clustr and simply plug it in to your awesome web-application today but I am hopeful that in time the community will develop higher level language (Perl, Python, Ruby, you name it&#8230;) bindings to make it easier and faster to write tools that build on the work we&#8217;ve done so far.</p>
<div style="margin-top:20px;margin-bottom:20px;">
<a href="http://flickr.com/photos/julianbleecker/2787751572/"><img src="http://farm4.static.flickr.com/3215/2787751572_c4a74415d6.jpg"  style="border:1px dotted #ccc;padding:10px;" /></a></p>
<p style="font-size:small;">photo by <a href="http://flickr.com/photos/julianbleecker/">Julian Bleecker</a></p>
</div>
<p style="text-decoration:line-through;">By the way, there is a still a known-known bug in Clustr rendering <q>interior rings</q> (the donut holes where there are no geotagged photos) in shapefiles. Specifically, they holes are rendered as actual polyline records. You can see an example of the problem in the screenshot of the shapefile for North America, above. We hope to have a proper patch in place by the time we make the ESRI files available next week. As it is since the problem only manifests itself for countries and continents it seemed like a reasonable thing for a version 0.1 release.</p>
<p style="font-style:italic;">Update: Clustr 0.2, with a fix for <a href="http://code.flickr.com/trac/changeset/461">errant interior rings</a>, has been checked in to the <a href="http://code.flickr.com/svn/trunk/clustr/">code.flickr.com SVN repository</a>.</p>
<p>Finally, these are early days and this is very much a developer&#8217;s release so we look forward to your feedback and also hope you will be understanding as we learn our way around the gotchas and quirks that will no doubt pop up.</p>
<h2 style="margin-bottom:15px;">In other geostuffs</h2>
<p>In other geostuffs, we have enabled Open Street Maps tiles for two more cities: Baghdad and Kabul and George has written <a href="http://flickrtheblog.wordpress.com/2008/10/30/more-cities/">a fantastic post highlighting some of the photos we&#8217;ve found in both cities</a> so go and have a look.</p>
<div style="margin-top:20px;margin-bottom:20px;">
<a href="http://www.flickr.com/photos/straup/2987745074/" title="Picture 16 by straup, on Flickr"><img src="http://farm4.static.flickr.com/3035/2987745074_9acfe83c68_o.png" width="488" height="486" alt="Picture 16" style="border:1px dotted #ccc;padding:10px;" /></a>
</div>
<p><small>Map data <a href="http://creativecommons.org/licenses/by-sa/3.0/">CCBYSA</a> 2008 <a href="http://OpenStreetMap.org">OpenStreetMap.org</a> contributors</small></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
