Flickr as a database?

Nine Ladies stone circle, viewed from the King Stone

Nine Ladies stone circle, viewed from the King Stone

I went out on a photo trip yes­ter­day. I’ve been test­ing the iPhone app GeoLogTag recently. For some reason I simply can­not get my iPhone talk­ing to my MacBook, which makes a lot of the WiFi syncing apps a waste of time. GeoLogTag has an option to geotag pho­tos on Flickr. If you visit this photo’s page on Flickr and look at the data on the right side, you’ll see it was taken near Stanton in Peak and there’s a map so you can see other nearby pho­tos.

Once you’ve remembered to leave the phone on, which means can­cel­ling the auto-lock, which geo-logging, then tag­ging is pretty much pain­less. The phone keeps track of where it is at any given time. It con­nects to Flickr and any ungeot­agged pho­tos that were taken while the phone was log­ging get tagged. This works because the pho­tos have a record of the time they were taken. If you remem­ber to take your phone around with you when to take a shot, then you can have a reas­on­ably accur­ate log of where you are. At $5 it’s a lot more sane than buy­ing one of those ded­ic­ated photo-loggers you can buy. On the other hand you do have to have the phone to go with it.

Being able to log pho­tos quite accur­ately could well be very use­ful next time I go on a sur­vey. At the very least it could be a usable way of map­ping the loc­a­tion of many tombs, so long as the tombs are 10m or more apart. Uploading to Flickr to log them is a nuis­ance, I should sort out my home net­work, but it’s pos­sibly also an oppor­tun­ity thanks to the Flickr API. The API makes it very easy to get machine-readable data out of Flickr. Here’s an example.

Fire remains (distant) aligned with two megaliths at Nine Ladies.

Fire remains (dis­tant) aligned with two mega­liths at Nine Ladies.

This is a photo of an align­ment I saw at Nine Ladies. If you fol­low the line from fore­ground over the back stone and on, you might be able to see two black patches in the grass. These are the ash remains of fires which had been lit at the site. Burning, even small fires, is not help­ful. The risk of rampant fire is slim because the grass is short and, because it’s in the UK, it’s nearly always damp. However, at the very least it’ll cause a spike in any future mag­neto­metry sur­veys of the area. Also if there is some­thing bur­ied beneath the ground which hasn’t been found yet, heat­ing is a great way to des­troy it. So I now have some data which I might want to log in a database.

I can put some inform­a­tion about a site into Flickr tags. In this case it’s a Bronze Age stone circle on Stanton Moor with some dam­age. So long as I have a uni­form set of tags I use to describe that like “loc­a­tion: Stanton Moor” then I can use the API as a search engine. For example I could:

Search for any photos where tag == project: My Project

which would list all pho­tos in My Project.
It would be easier to be able to lift the data from Flickr and put it into a SQL data­base but that shouldn’t be dif­fi­cult with stand­ard tags. Here’s an example of what inform­a­tion Flickr has about the photo above.

<rsp stat="ok">
  <photo id="3890427837" secret="c89e5a1e94" server="3530" farm="4" dateuploaded="1252190752"
   isfavorite="0" license="5" rotation="0" originalsecret="3a9cc5e6bf" originalformat="jpg"
    <owner nsid="79983635@N00" username="Alun Salt" realname="Alun Salt" location="Derby and 
     Leicester, UK"/>
    <title>Alignment at 9 Ladies.jpg</title>
      Or, how not to photograph burning. If you follow the line from the foreground over the 
      back stone and beyond, you might be able to see two black patches in the grass.
      <a href=";size=large" rel="nofollow">
      A larger view might help.</a>

      Burning, even small fires, is not helpful. The risk of rampant fire is slim because the 
      grass is short and, because it's in the UK, it's nearly always damp. However, at the very 
      least it'll cause a spike in any future magnetometry surveys of the area. Also if there 
      is something buried beneath the ground which hasn't been found yet, heating is a great way
      to destroy it.

      I took the photo from this angle as there were some people behind me, which meant a HDR 
      shot from the opposite direction wasn't viable at the time. When I did set up some shots 
      from the other side I'd forgotten about getting the shot of the fires.
    <visibility ispublic="1" isfriend="0" isfamily="0"/>
    <dates posted="1252190752" taken="2009-09-05 18:58:27" takengranularity="0" 
    <editability cancomment="0" canaddmeta="0"/>
    <usage candownload="1" canblog="0" canprint="0"/>
      <note id="72157622266401280" author="79983635@N00" authorname="Alun Salt" x="233"
       y="108" w="29" h="16">A patch from a small fire.</note>
      <note id="72157622141844777" author="79983635@N00" authorname="Alun Salt" x="238" 
       y="95" w="31" h="16">A patch from a larger fire.</note>
      <tag id="204526-3890427837-771" author="79983635@N00" raw="archaeology"
      <tag id="204526-3890427837-1520781" author="79983635@N00" raw="stanton moor"
      <tag id="204526-3890427837-98094" author="79983635@N00" raw="bronze age"
      <tag id="204526-3890427837-110" author="79983635@N00" raw="UK" machine_tag="0">uk</tag>
      <tag id="204526-3890427837-5933" author="79983635@N00" raw="Derbyshire"
      <tag id="204526-3890427837-778" author="79983635@N00" raw="megalithic"
      <tag id="204526-3890427837-38882" author="79983635@N00" raw="prehistoric"
      <tag id="204526-3890427837-56210" author="79983635@N00" raw="HDR"
      <tag id="204526-3890427837-45290559" author="79983635@N00" raw="project: test project"
      <tag id="204526-3890427837-45290561" author="79983635@N00" raw="location: Stanton Moor"
      <tag id="204526-3890427837-45290563" author="79983635@N00" raw="period: Bronze Age"
      <tag id="204526-3890427837-45290565" author="79983635@N00" raw="type: stone circle"
      <tag id="204526-3890427837-45290567" author="79983635@N00" raw="damage: yes"
      <url type="photopage"></url>

So with some fairly simple code I could get Flickr and the data­base to talk to each other.

GET all photos WHERE project == My Project
FOR EACH photo_id in the list of results
 { GET INFO for photo_id
   INSERT into database id = photo_id;
   READ latitude tag;
   INSERT into database latitude = latitude_tag;
   READ longitude tag;
   INSERT into database longitude = longitude;
   READ period tag;
   INSERT into database period = period_tag;
   READ location tag;
   INSERT into database location = location_tag;
   AND SO ON with the rest of the relevant tags;

You could use the photo date tags to log when the site was vis­ited, the author tag to log who vis­ited it and so on. There are some poten­tial prob­lems. You can add tags to my pho­tos because I let any­one tag them. That could come back to bite me if someone decides it would be fun to add a period: Neolithic tag onto the photo. However if you look at the tags in the data file it also notes who is author of those tags, so you can alter the search to reads TAGS where author == PERMITTED AUTHOR. The API also allow you to search groups, so a group of people could con­trib­ute to a pool of data if there were agreed tag­ging standards.

It’s also just occurred to me that if you made pro­ject tags in the format Project Identifier : Tag : Content like StonehengeSurvey:Location:In the pub, then the same pho­tos could be incor­por­ated into mul­tiple pro­jects, so there’s no need to have a uni­ver­sal defin­i­tion of terms like Early or Late.

Another thing I’d be wary of it mak­ing my data pub­lic as I cre­ate it. Some things I’m work­ing on are likely to be very simple. If I’m out in the field and you can read my data from your home you could be in a pos­i­tion to scoop me, even if you credit me as the source of data. One way round that is to upload pho­tos as private. GeoLogTag is happy work­ing with private pho­tos (I’ve tested it). A group work­ing together would have to make use of the con­tacts fea­ture in Flickr, pos­sibly accept­ing that for the pro­ject they’re all fam­ily so they share access to each other’s uploads.

Certainly my future pro­jects are going to have a very large photo com­pon­ent to them. Geotagging is the hook which everything else can use­fully fit on to. What’ll be inter­est­ing to see is what effect this will have on GIS, if any­one can eas­ily pro­duce masses of geo­graph­ic­ally use­ful data.


When he's not tired, fixing his car or caught in train delays, Alun Salt works part-time for the Annals of Botany weblog. His PhD was in ancient science at the University of Leicester, but he doesn't know Richard III.