
Returns the complete collection of place types supported in GeoPlanet. The resources in the collection each describe a single place type. Additional placetypes will be included in future versions of GeoPlanet.
The only supported filter for this collection is
.type. This filter allows a user to limit the results to one or more
specified place types.
The following matrix parameters are supported
for this collection: start, count.
The start parameter allows a user to skip resources.
The count parameter allows a user to control the number of resources
to be returned.
These parameters effectively provide a mechanism for paging through large result sets.
The following query parameters are supported
for this collection:
lang, format, callback,
select, and appid.
The lang parameter allows a user to choose the
language used in the response.
The format parameter allows a user to choose the
content type of the response (XML, JSON, GeoJSON).
The callback parameter allows a user to encapsulate a JSON response
within a JavaScript function call.
The select parameter allows a user to choose the
representation of the response (short, long).
The appid parameter grants authorization to use the Web service,
and is required.
The short representation contains the placeTypeName element.
The long representation additionally contains the description element.
The following errors can be returned:
A valid appid parameter is required for this resource; please visit http://developer.yahoo.com/wsregapp to get an appid
Be sure to provide the appid parameter for each GeoPlanet request you make.
URI has no match in the display map
Be sure that you have spelled the resource correctly and are using one of the supported filters for this collection.
Could not find the resource xxx
Be sure to provide a valid woeid in requests for this collection.
Requested representation not available for this resource
Be sure that you have included an Accept header or format parameter with a supported value.
Example 20. Retrieving a Collection of Place Types
The request:
http://where.yahooapis.com/v1/placetypes?appid=[yourappidhere]
produces the following:
<?xml version="1.0" encoding="UTF-8"?>
<placeTypes xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="35" yahoo:total="35">
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/0" xml:lang="en-us">
<placeTypeName code="0">Undefined</placeTypeName>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/1" xml:lang="en-us">
<placeTypeName code="1">Building</placeTypeName>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/2" xml:lang="en-us">
<placeTypeName code="2">Street Segment</placeTypeName>
</placeType>
...
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/35" xml:lang="en-us">
<placeTypeName code="35">Historical Town</placeTypeName>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/36" xml:lang="en-us">
<placeTypeName code="36">Aggregate</placeTypeName>
</placeType>
</placeTypes>
Example 21. Retrieving a Collection of Place Types and their descriptions
The request:
http://where.yahooapis.com/v1/placetypes?select=long&appid=[yourappidhere]
produces the following:
<?xml version="1.0" encoding="UTF-8"?>
<placeTypes xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="35" yahoo:total="35">
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/0" xml:lang="en-us">
<placeTypeName code="0">An undefined place</placeTypeDescription>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/1" xml:lang="en-us">
<placeTypeName code="1">Building</placeTypeName>
<placeTypeDescription>A building that matches the house number from an address</placeTypeDescription>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/2" xml:lang="en-us">
<placeTypeName code="2">Street Segment</placeTypeName>
<placeTypeDescription>A street segment that matches the street from an address>/placeTypeDescription>
</placeType>
...
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/35" xml:lang="en-us">
<placeTypeName code="35">Historical Town</placeTypeName>
<placeTypeDescription>A historical populated settlement that is no longer known by its original name</placeTypeDescription>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/36" xml:lang="en-us">
<placeTypeName code="36">Aggregate</placeTypeName>
<placeTypeDescription>An aggregate place</placeTypeDescription>
</placeType>
</placeTypes>
Example 22. Retrieving a Partial Collection of Place Types
The request:
http://where.yahooapis.com/v1/placetypes.type(0,2)?appid=[yourappidhere]
produces the following:
<?xml version="1.0" encoding="UTF-8"?>
<placeTypes xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="2" yahoo:total="2">
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/0" xml:lang="en-us">
<placeTypeName code="0">Undefined</placeTypeName>
</placeType>
<placeType yahoo:uri="http://where.yahooapis.com/v1/placetype/2" xml:lang="en-us">
<placeTypeName code="2">Street Segment</placeTypeName>
</placeType>
</placeTypes>