|
NAMENet::GeoPlanet - Access Yahoo's GeoPlanet location serviceSYNOPSISuse Net::GeoPlanet; use Data::Dumper; my $geoplanet = Net::GeoPlanet->new(api_key => $api_key); print Dumper($geoplanet->places(place => "Woodside, NY 11377")); print Dumper($geoplanet->place( woeid => "2507854", format => "json" )); print Dumper($geoplanet->parent( woeid => "638242", select => "long", lang => "fr-CA" )); ABOUTYahoo! GeoPlanet helps bridge the gap between the real and virtual worlds by providing an open, permanent, and intelligent infrastructure for geo-referencing data on the Internet.For more information see http://developer.yahoo.com/geo/ METHODSnewCreates the object that will be used. It takes an arguement, which is the key assigned to you by Yahoo.placesReturns a collection of places that match a specified place name, and optionally, a specified place type. The resources in the collection are long representations of each place (unless short representations are explicitly requested).placeReturns a resource containing the long representation of a place (unless a short representation is explicitly requested).parentReturns a resource for the parent of a place. A place has only one parent. The resource is the short representation of the parent (unless a long representation is requested).ancestorsReturns a collection of places in the parent hierarchy (the parent, the parent of parent, etc.). The resources in the collection are short representations of each place (unless a long representation is specifically requested).belongtosReturns a collection of places that have a place as a child or descendant (child of a child, etc). The resources in the collection are short representations of each place (unless a long representation is specifically requested).neighborsReturns a collection of places that neighbor of a place. The resources in the collection are short representations of each place (unless a long representation is requested).Note that neighbors are not necessarily geographically contiguous. siblingsReturns a collection of places that are siblings of a place. Siblings share the same parent and place type as the given place. The resources in the collection are short representations of each place (unless a long representation is requested).childrenReturns a collection of places that are children of a place. The resources in the collection are short representations of each place (unless a long representation is requested).placetypesReturns the complete collection of place types supported in GeoPlanet. The resources in the collection each describe a single place type.placetypeReturns a resource that describes a single place type.MATRIX PARAMETERSGeoPlanet supports several parameters (name/value pairs) called "matrix parameters" that allow users to request small portions of potentially large collections. Matrix parameters follow the collection name or filter they refer to. The place, parent, ancestors and palcetype subroutines do not support these parameters.startSkip first 'N' results$geoplanet->places(place => "Woodside, NY 11377", start => 1); countReturn a maximum of N results. A count of 0 is interpreted as 'no maximum'$geoplanet->children(woeid => "23424977", count => 5); QUERY PARAMETERSGeoPlanet supports several parameters (name/value pairs) called "query parameters" that allow users to specify a particular language or format for the response. Query parameters follow the resource/collection name, filter, and any matrix parameters.langReturn names in specified language (RFC 4646)$geoplanet->places(place => "Woodside, NY 11377", lang => "fr-CA"); formatReturn results in specified format. Accepted values are "xml", "json", "geojson".$geoplanet->neighbors(woeid => "2347563", format =>"json"); callbackReturn JSON results wrapped in a JavaScript function call. Only used when format=json or format=geojson$geoplanet->neighbors( woeid => "2347563", format =>"json", callback => "myfunction" ); selectReturn results in specified representation. Accepted values are "short", "long".$geoplanet->belongtos(woeid => "23424900", select => "short"); BUGSNone knownDEVELOPERSThe latest code for this module can be found athttp://www.exit2shell.com/cgi-bin/cvsweb.cgi/Net-GeoPlanet/ AUTHORWritten by Steven Kreuzer <skreuzer@exit2shell.com>COPYRIGHTCopyright (c) 2008, Steven KreuzerAll rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |