client.photos_geo_setLocation(photo_id=18389540,lat=37.8721,
lon=-122.257704,accuracy=16)
In addition to reading and writing the location and geopermissions of an individual photo,
you can use the Flickr API to search for photos that have an associated location. You do so by
using the flickr.photos.search method (the one to which you were introduced in Chapter 6),
documented here:
http://www.flickr.com/services/api/flickr.photos.search.html
To do a search for geotagged photos, you add the search parameters of the following form:
bbox=lon0,lat0,lon1,lat1
CHAPTER 10 ?– CREATING MASHUPS OF SEVERAL SERVICES 247
Here lon0,lat0 and lon1,lat1 are the longitude and latitude of the southwest and northeast
corners of the bounding box, respectively. Note that you can also use the accuracy parameter
to specify the minimum accuracy level you demand of the specified locations.
Let??™s consider the example of searching for photos around Berkeley in a bounding box
with the following parameters:
SW: 37.81778516606761, -122.34374999999999
NE: 37.92619056937629, -122.17208862304686
The following will get the first page of all the publicly available geotagged photos in Flickr,
including photos of all accuracies (with this call, you can get at the total number of such photos):
http://api.flickr.com/services/rest/?api_key={api_key}&method=flickr.photos.search???
&bbox=-180%2C-90%2C180%2C90&min_upload_date=820483200&accuracy=1
You can get the first page of photos with a bounding box around the UC Berkeley campus:
http://api.
Pages:
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413