GeomancerProject/geomancer-api — pull request #48 by eightysteele (2013-01-29 20:27:04+00:00)
Title: WIP: Initial support for geocodes from multiple sources

The `geocode.lookup(name)` API now returns a dictionary with sources (some or all of google-geocode-api, bg_geocodes, plss_geocodes).

For example, `lookup.geocode('jeongeup')`:

```json
{
"jeongeup":{
"bg_geocodes":[
{
"status":"OK",
"results":[
{
"geometry":{
"location_type":"APPROXIMATE",
"bounds":{
"northeast":{
"lat":35.7249052,
"lng":127.0445299
},
"southwest":{
"lat":35.4084288,
"lng":126.6554701
}
},
"viewport":{
"northeast":{
"lat":35.7249052,
"lng":127.0445299
},
"southwest":{
"lat":35.4084288,
"lng":126.6554701
}
},
"location":{
"lat":35.566667,
"lng":126.85
}
},
"address_components":[
{
"long_name":"Jeongeup",
"short_name":"Jeongeup",
"types":[
"locality",
"political"
]
}
],
"formatted_address":"Jeongeup",
"types":[
"locality",
"political"
]
}
]
}
],
"google-geocode-api":{
"status":"OK",
"results":[
{
"geometry":{
"location_type":"APPROXIMATE",
"bounds":{
"northeast":{
"lat":35.7589731,
"lng":127.1174566
},
"southwest":{
"lat":35.4621792,
"lng":126.7156821
}
},
"viewport":{
"northeast":{
"lat":35.60279999999999,
"lng":126.8839
},
"southwest":{
"lat":35.549,
"lng":126.8352
}
},
"location":{
"lat":35.5698855,
"lng":126.8558955
}
},
"address_components":[
{
"long_name":"Jeongeup-si",
"types":[
"locality",
"political"
],
"short_name":"Jeongeup-si"
},
{
"long_name":"Jeollabuk-do",
"types":[
"administrative_area_level_1",
"political"
],
"short_name":"Jeollabuk-do"
},
{
"long_name":"South Korea",
"types":[
"country",
"political"
],
"short_name":"KR"
}
],
"formatted_address":"Jeongeup-si, Jeollabuk-do, South Korea",
"types":[
"locality",
"political"
]
}
]
}
}
}
```