Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 14 — Merging with Flickr Photos 285


Again, using the REST interface, a URL requests the XML document containing the infor-
mation about the photo:


http://maps.mcslp.com//examples/ch14-02flickrproxy.pl?method= ;
flickr.photos.getInfo&api_key=XXX&photo_id=24910903


The preceding returns a hefty XML document:



dateuploaded=”1121009689” isfavorite=”0” license=”0” rotation=”0” ;
originalformat=”jpg”>
location=””/>
IMG_0776


takengranularity=”0” lastupdate=”1140791972”/>

0



toronto
raw=”geo:lon=-79.38724994659424”>geolon7938724994659424
raw=”geotagged”>geotagged
raw=”geo:lat=43.64178982199113”>geolat4364178982199113


http://www.flickr.com/photos/mcslp/24910903/



There are two portions of this document that you are particularly interested in. The first is the
main photo information (within the tag) about the secretand server. You need
this information to enable you to embed a thumbnail of the photo within your info window.


The second is the portion, because that is where the geotagging information is stored.
Note the use of the rawattribute to a ; this contains the real data required. The
value is a “flattened” version, used internally by Flickr, and is also the version you would use
when searching for a specific tag.


The bulk of the XML generated by Flickr in this process is going to be parsed by an XSL
Transformation.

Free download pdf