<?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; geotags</title>
	<atom:link href="http://code.flickr.com/blog/tag/geotags/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>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>Twitter API updates, FireEagle and new Flickr API fun</title>
		<link>http://code.flickr.com/blog/2008/04/30/twitter-api-updates-fireeagle-and-new-flickr-api-fun/</link>
		<comments>http://code.flickr.com/blog/2008/04/30/twitter-api-updates-fireeagle-and-new-flickr-api-fun/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 17:48:05 +0000</pubDate>
		<dc:creator>revdancatt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[fireeagle]]></category>
		<category><![CDATA[geotags]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[places]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://code.flickr.com/blog/?p=9</guid>
		<description><![CDATA[Last night twitter released their next batch of API improvements, of course the one that caught my eye was &#8230;
&#8220;[NEW] /account/update_location.[xml&#124;json] &#8211; sets the location for the
authenticated user to the string passed in a &#8220;location&#8221; parameter.
Nothing fancy, no geocoding or normalization.  Just putting this out
there so developers can start playing with how geolocation might [...]]]></description>
			<content:encoded><![CDATA[<p>Last night twitter released their <a href="http://groups.google.com/group/twitter-development-talk/browse_thread/thread/722b8cb5925563de">next batch of API improvements</a>, of course the one that caught my eye was &#8230;</p>
<blockquote><p>&#8220;[NEW] /account/update_location.[xml|json] &#8211; sets the location for the<br />
authenticated user to the string passed in a &#8220;location&#8221; parameter.<br />
Nothing fancy, no geocoding or normalization.  Just putting this out<br />
there so developers can start playing with how geolocation might fit<br />
into their Twitter applications.&#8221;</p></blockquote>
<p><a href="http://www.flickr.com/photos/35468159852@N01/2454112540" title="View 'saving woeids in the location field' on Flickr.com"><img src="http://farm3.static.flickr.com/2112/2454112540_2a27e357a4.jpg" alt="saving woeids in the location field" border="0" width="448" height="289" /></a></p>
<p>&#8230; which is nice as it&#8217;s just thrown in there as a &#8216;what if&#8217; type of thing. There&#8217;s no direct reason for twitter to have location stuff, (well no more than Flickr I guess)  but everyone knows that everyone wants it.</p>
<p>It&#8217;d be great if you didn&#8217;t have to update twitter yourself and there was something else out there that could do it for us.</p>
<p>Read <a href="http://geobloggers.com/archives/2008/04/29/twitter-api-updates-fireeagle-and-new-flickr-api-fun/">the rest of &#8220;Twitter API updates, FireEagle and new Flickr API fun&#8221;</a> for more on Twitter&#8217;s location API, FireEagle, and Flickr&#8217;s not-a-geocoder.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.flickr.com/blog/2008/04/30/twitter-api-updates-fireeagle-and-new-flickr-api-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
