com.aetrion.flickr.photos.geo
Class GeoInterface

java.lang.Object
  extended by com.aetrion.flickr.photos.geo.GeoInterface

public class GeoInterface
extends java.lang.Object

Access to the flickr.photos.geo methods.

Version:
$Id: GeoInterface.java,v 1.5 2009/07/22 22:39:36 x-mago Exp $
Author:
till (Till Krech - flickr:extranoise)

Field Summary
static java.lang.String METHOD_BATCH_CORRECT_LOCATION
           
static java.lang.String METHOD_CORRECT_LOCATION
           
static java.lang.String METHOD_GET_LOCATION
           
static java.lang.String METHOD_GET_PERMS
           
static java.lang.String METHOD_PHOTOS_FOR_LOCATION
           
static java.lang.String METHOD_REMOVE_LOCATION
           
static java.lang.String METHOD_SET_CONTEXT
           
static java.lang.String METHOD_SET_LOCATION
           
static java.lang.String METHOD_SET_PERMS
           
 
Constructor Summary
GeoInterface(java.lang.String apiKey, java.lang.String sharedSecret, Transport transport)
           
 
Method Summary
 void batchCorrectLocation(GeoData location, java.lang.String placeId, java.lang.String woeId)
          Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy.
 void correctLocation(java.lang.String photoId, java.lang.String placeId, java.lang.String woeId)
           
 GeoData getLocation(java.lang.String photoId)
          Get the geo data (latitude and longitude and the accuracy level) for a photo.
 GeoPermissions getPerms(java.lang.String photoId)
          Get permissions for who may view geo data for a photo.
 PhotoList photosForLocation(GeoData location, java.util.Set extras, int perPage, int page)
          Return a list of photos for a user at a specific latitude, longitude and accuracy.
 void removeLocation(java.lang.String photoId)
          Removes the geo data associated with a photo.
 void setContext(java.lang.String photoId, int context)
          Indicate the state of a photo's geotagginess beyond latitude and longitude.
 void setLocation(java.lang.String photoId, GeoData location)
          Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo.
 void setPerms(java.lang.String photoId, GeoPermissions perms)
          Set the permission for who may view the geo data associated with a photo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_GET_LOCATION

public static final java.lang.String METHOD_GET_LOCATION
See Also:
Constant Field Values

METHOD_GET_PERMS

public static final java.lang.String METHOD_GET_PERMS
See Also:
Constant Field Values

METHOD_REMOVE_LOCATION

public static final java.lang.String METHOD_REMOVE_LOCATION
See Also:
Constant Field Values

METHOD_SET_LOCATION

public static final java.lang.String METHOD_SET_LOCATION
See Also:
Constant Field Values

METHOD_SET_PERMS

public static final java.lang.String METHOD_SET_PERMS
See Also:
Constant Field Values

METHOD_BATCH_CORRECT_LOCATION

public static final java.lang.String METHOD_BATCH_CORRECT_LOCATION
See Also:
Constant Field Values

METHOD_CORRECT_LOCATION

public static final java.lang.String METHOD_CORRECT_LOCATION
See Also:
Constant Field Values

METHOD_PHOTOS_FOR_LOCATION

public static final java.lang.String METHOD_PHOTOS_FOR_LOCATION
See Also:
Constant Field Values

METHOD_SET_CONTEXT

public static final java.lang.String METHOD_SET_CONTEXT
See Also:
Constant Field Values
Constructor Detail

GeoInterface

public GeoInterface(java.lang.String apiKey,
                    java.lang.String sharedSecret,
                    Transport transport)
Method Detail

getLocation

public GeoData getLocation(java.lang.String photoId)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Get the geo data (latitude and longitude and the accuracy level) for a photo. This method does not require authentication.

Parameters:
photoId - reqired photo id, not null
Returns:
Geo Data, if the photo has it.
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException - if photo id is invalid, if photo has no geodata or if any other error has been reported in the response.

getPerms

public GeoPermissions getPerms(java.lang.String photoId)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               FlickrException
Get permissions for who may view geo data for a photo. This method requires authentication with 'read' permission.

Parameters:
photoId - reqired photo id, not null
Returns:
the permissions
Throws:
org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
java.io.IOException
FlickrException
FlickrException - if photo id is invalid, if photo has no geodata or if any other error has been reported in the response.

removeLocation

public void removeLocation(java.lang.String photoId)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Removes the geo data associated with a photo. This method requires authentication with 'write' permission.

Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

setLocation

public void setLocation(java.lang.String photoId,
                        GeoData location)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        FlickrException
Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo. Before users may assign location data to a photo they must define who, by default, may view that information. Users can edit this preference at flickr. If a user has not set this preference, the API method will return an error. This method requires authentication with 'write' permission.

Parameters:
photoId - The id of the photo to cet permissions for.
location - geo data with optional accuracy (1-16), accuracy 0 to use the default.
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

setPerms

public void setPerms(java.lang.String photoId,
                     GeoPermissions perms)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Set the permission for who may view the geo data associated with a photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The id of the photo to set permissions for.
perms - Permissions, who can see the geo data of this photo
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

batchCorrectLocation

public void batchCorrectLocation(GeoData location,
                                 java.lang.String placeId,
                                 java.lang.String woeId)
                          throws java.io.IOException,
                                 org.xml.sax.SAXException,
                                 FlickrException
Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy.

Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user's photos.

Parameters:
location - The latitude/longitude and accuracy of the photos to be update.
placeId - A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)
woeId - A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.)
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

correctLocation

public void correctLocation(java.lang.String photoId,
                            java.lang.String placeId,
                            java.lang.String woeId)
                     throws java.io.IOException,
                            org.xml.sax.SAXException,
                            FlickrException
Parameters:
photoId - Photo id (required).
placeId - A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)
woeId - A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.)
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

photosForLocation

public PhotoList photosForLocation(GeoData location,
                                   java.util.Set extras,
                                   int perPage,
                                   int page)
                            throws java.io.IOException,
                                   org.xml.sax.SAXException,
                                   FlickrException
Return a list of photos for a user at a specific latitude, longitude and accuracy.

Parameters:
location -
extras -
perPage -
page -
Returns:
The collection of Photo objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException
See Also:
Extras

setContext

public void setContext(java.lang.String photoId,
                       int context)
                throws java.io.IOException,
                       org.xml.sax.SAXException,
                       FlickrException
Indicate the state of a photo's geotagginess beyond latitude and longitude.

Note : photos passed to this method must already be geotagged (using the setLocation(String, GeoData) method).

Parameters:
photoId - Photo id (required).
context - Context is a numeric value representing the photo's geotagginess beyond latitude and longitude. For example, you may wish to indicate that a photo was taken "indoors" (1) or "outdoors" (2).
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException


Copyright (C) 2005-2008 Aetrion LLC. All Rights Reserved.