Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Yahoo Placefinder Geocoding #95

@GoogleCodeExporter

Description

@GoogleCodeExporter
Here's working Code for Geolocation via YAHOO Placefinder API:

// Yahoo Geocoding API
// Compose YQL query
$_yql_query = 'select * from geo.placefinder where text = "' . str_replace('"', 
'\"', $address) . '"';
// Compose URL
$_url = 'http://query.yahooapis.com/v1/public/yql';
$_url .= '?q=' . rawurlencode($_yql_query);
$_url .= '&format=json';
// Make HTTP call and process result
if($_result = $this->fetchURL($_url)) {
  $_result_parts = json_decode($_result);
  if(isset($_result_parts->error) || !isset($_result_parts->query->results)){
    return false;
  }
  $_coords['lat'] = (float) $_result_parts->query->results->Result->latitude;
  $_coords['lon'] = (float) $_result_parts->query->results->Result->longitude;
  $_result = true;
}

I wrote this some time ago for an much older version og GoogleMapAPI, but it 
should be straightforward to integrate. The puplic api for non commercial use 
is limited to 2000 queries/day.

See http://developer.yahoo.com/boss/geo/docs/free_YQL.html for more info.

Original issue reported on code.google.com by Felix.Bu...@gmail.com on 19 Mar 2014 at 11:04

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions