Place

## Place Place — Places in the real world. |

## Synopsis

                        flickcurl_place;
    void                flickcurl_free_place                (flickcurl_place *place);
    void                flickcurl_free_places               (flickcurl_place **places_object);
    enum                flickcurl_place_type;
    flickcurl_place**   flickcurl_places_find               (flickcurl *fc,
                                                             const char *query);
    flickcurl_place*    flickcurl_places_findByLatLon       (flickcurl *fc,
                                                             double lat,
                                                             double lon,
                                                             int accuracy);
    flickcurl_place_type flickcurl_get_place_type_by_label  (const char *place_label);
    const char*         flickcurl_get_place_type_label      (flickcurl_place_type place_type);
    flickcurl_place*    flickcurl_places_resolvePlaceId     (flickcurl *fc,
                                                             const char *place_id);
    flickcurl_place*    flickcurl_places_resolvePlaceURL    (flickcurl *fc,
                                                             const char *url);

## Description

Places in the real world.

## Details

### flickcurl_place

    typedef struct {
      char* names[FLICKCURL_PLACE_LAST+1];
      char* ids[FLICKCURL_PLACE_LAST+1];
      char* urls[FLICKCURL_PLACE_LAST+1];
      flickcurl_place_type type;
      char* woe_ids[FLICKCURL_PLACE_LAST+1];
    } flickcurl_place;

A Place.

Index 0 in the array is the location itself. `flickcurl_get_place_type_label()` can give labels for the array indexes of type flickcurl_place_type.

char *`names`[FLICKCURL_PLACE_LAST+1]; | Array of place names
char *`ids`[FLICKCURL_PLACE_LAST+1]; | Array of place IDs
char *`urls`[FLICKCURL_PLACE_LAST+1]; | Array of place urls.
flickcurl_place_type `type`; | Location type of index 0 (the location) usually FLICKCURL_PLACE_LOCATION but may be wider
char *`woe_ids`[FLICKCURL_PLACE_LAST+1]; | Array of WOE IDs

### flickcurl_free_place ()

    void                flickcurl_free_place                (flickcurl_place *place);

Destructor for place object

`place` : | place object

### flickcurl_free_places ()

    void                flickcurl_free_places               (flickcurl_place **places_object);

Destructor for array of place object

`places_object` : | place object array

### enum flickcurl_place_type

    typedef enum {
      FLICKCURL_PLACE_LOCATION,
      FLICKCURL_PLACE_NEIGHBORHOOD,
      FLICKCURL_PLACE_LOCALITY,
      FLICKCURL_PLACE_COUNTY,
      FLICKCURL_PLACE_REGION,
      FLICKCURL_PLACE_COUNTRY,
      FLICKCURL_PLACE_LAST = FLICKCURL_PLACE_COUNTRY
    } flickcurl_place_type;

Place type

`FLICKCURL_PLACE_LOCATION` | a general location
`FLICKCURL_PLACE_NEIGHBORHOOD` | neighborhood (narrowest place)
`FLICKCURL_PLACE_LOCALITY` | locality
`FLICKCURL_PLACE_COUNTY` | county
`FLICKCURL_PLACE_REGION` | region
`FLICKCURL_PLACE_COUNTRY` | country (widest place)
`FLICKCURL_PLACE_LAST` | internal offset to last in enum list

### flickcurl_places_find ()

    flickcurl_place**   flickcurl_places_find               (flickcurl *fc,
                                                             const char *query);

Return a list of place IDs for a query string.

The flickr.places.find method is NOT a geocoder. It will round up to the nearest place type to which place IDs apply. For example, if you pass it a street level address it will return the city that contains the address rather than the street, or building, itself.

This API announced 2008-01-18 http://tech.groups.yahoo.com/group/yws-flickr/message/3716

Implements flickr.places.find (1.1)

`fc` : | flickcurl context
`query` : | The query string to use for place ID lookups
Returns : | non-0 on failure

### flickcurl_places_findByLatLon ()

    flickcurl_place*    flickcurl_places_findByLatLon       (flickcurl *fc,
                                                             double lat,
                                                             double lon,
                                                             int accuracy);

Return a place ID for a latitude, longitude and accuracy triple.

The flickr.places.findByLatLon method is not meant to be a (reverse) geocoder in the traditional sense. It is designed to allow users to find photos for "places" and will round up to the nearest place type to which corresponding place IDs apply.

This API announced 2008-01-23 http://tech.groups.yahoo.com/group/yws-flickr/message/3735

Implements flickr.places.findByLatLon (1.1)

`fc` : | flickcurl context
`lat` : | The latitude whose valid range is -90 to 90. Anything more than 4 decimal places will be truncated.
`lon` : | The longitude whose valid range is -180 to 180. Anything more than 4 decimal places will be truncated.
`accuracy` : | Recorded accuracy level of the location information. World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. The default is 16.
Returns : | non-0 on failure

### flickcurl_get_place_type_by_label ()

    flickcurl_place_type flickcurl_get_place_type_by_label  (const char *place_label);

Get a place type by label

`place_label` : | place type
Returns : | place type

### flickcurl_get_place_type_label ()

    const char*         flickcurl_get_place_type_label      (flickcurl_place_type place_type);

Get label for a place type

`place_type` : | place type
Returns : | label string or NULL if none valid

### flickcurl_places_resolvePlaceId ()

    flickcurl_place*    flickcurl_places_resolvePlaceId     (flickcurl *fc,
                                                             const char *place_id);

Find Flickr Places information by Place Id

Implements flickr.places.resolvePlaceId (1.0)

`fc` : | flickcurl context
`place_id` : | A Flickr Places ID
Returns : | non-0 on failure

### flickcurl_places_resolvePlaceURL ()

    flickcurl_place*    flickcurl_places_resolvePlaceURL    (flickcurl *fc,
                                                             const char *url);

Find Flickr Places information by Place URL

Implements flickr.places.resolvePlaceURL (1.0)

`fc` : | flickcurl context
`url` : | A Flickr Places URL. Flickr Place URLs are of the form /country/region/city
Returns : | non-0 on failure