Skip to content

Instantly share code, notes, and snippets.

@vincent178
Last active December 21, 2015 15:38
Show Gist options
  • Save vincent178/6327533 to your computer and use it in GitHub Desktop.
Save vincent178/6327533 to your computer and use it in GitHub Desktop.
Google location to address
curl http://maps.google.com/maps/api/geocode/json?latlng=39.910093,116.403945&language=zh-CN&sensor=false
{
"results" : [
{
"address_components" : [
{
"long_name" : "128号",
"short_name" : "128号",
"types" : [ "street_number" ]
},
{
"long_name" : "南池子大街",
"short_name" : "南池子大街",
"types" : [ "route" ]
},
{
"long_name" : "东城区",
"short_name" : "东城区",
"types" : [ "sublocality", "political" ]
},
{
"long_name" : "北京",
"short_name" : "北京",
"types" : [ "locality", "political" ]
},
{
"long_name" : "北京市",
"short_name" : "北京市",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "中国",
"short_name" : "CN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "中国北京市东城区南池子大街128号",
"geometry" : {
"location" : {
"lat" : 39.910242,
"lng" : 116.403911
},
"location_type" : "ROOFTOP",
"viewport" : {
"northeast" : {
"lat" : 39.91159098029149,
"lng" : 116.4052599802915
},
"southwest" : {
"lat" : 39.90889301970849,
"lng" : 116.4025620197085
}
}
},
"types" : [ "street_address" ]
},
{
"address_components" : [
{
"long_name" : "皇史宬站",
"short_name" : "皇史宬站",
"types" : [ "bus_station", "transit_station", "establishment" ]
},
{
"long_name" : "东城区",
"short_name" : "东城区",
"types" : [ "sublocality", "political" ]
},
{
"long_name" : "北京",
"short_name" : "北京",
"types" : [ "locality", "political" ]
},
{
"long_name" : "北京市",
"short_name" : "北京市",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "中国",
"short_name" : "CN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "中国北京市东城区皇史宬",
"geometry" : {
"location" : {
"lat" : 39.909975,
"lng" : 116.403203
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 39.91132398029149,
"lng" : 116.4045519802915
},
"southwest" : {
"lat" : 39.90862601970849,
"lng" : 116.4018540197085
}
}
},
"types" : [ "bus_station", "transit_station", "establishment" ]
},
{
"address_components" : [
{
"long_name" : "东城区",
"short_name" : "东城区",
"types" : [ "sublocality", "political" ]
},
{
"long_name" : "北京",
"short_name" : "北京",
"types" : [ "locality", "political" ]
},
{
"long_name" : "北京市",
"short_name" : "北京市",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "中国",
"short_name" : "CN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "中国北京市东城区",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 39.9740366,
"lng" : 116.4523907
},
"southwest" : {
"lat" : 39.8586253,
"lng" : 116.3771342
}
},
"location" : {
"lat" : 39.92835300000001,
"lng" : 116.416357
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 39.9740366,
"lng" : 116.4523907
},
"southwest" : {
"lat" : 39.8586253,
"lng" : 116.3771342
}
}
},
"types" : [ "sublocality", "political" ]
},
{
"address_components" : [
{
"long_name" : "北京市",
"short_name" : "北京市",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "中国",
"short_name" : "CN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "中国北京市",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 41.0608159,
"lng" : 117.514625
},
"southwest" : {
"lat" : 39.4427581,
"lng" : 115.4234116
}
},
"location" : {
"lat" : 39.90403,
"lng" : 116.407526
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 41.0608159,
"lng" : 117.514625
},
"southwest" : {
"lat" : 39.4427581,
"lng" : 115.4234116
}
}
},
"types" : [ "administrative_area_level_1", "political" ]
},
{
"address_components" : [
{
"long_name" : "北京",
"short_name" : "北京",
"types" : [ "locality", "political" ]
},
{
"long_name" : "北京市",
"short_name" : "北京市",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "中国",
"short_name" : "CN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "中国北京市",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 41.0608159,
"lng" : 117.514625
},
"southwest" : {
"lat" : 39.4427581,
"lng" : 115.4234116
}
},
"location" : {
"lat" : 39.90403,
"lng" : 116.407526
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 40.2164962,
"lng" : 116.7829835
},
"southwest" : {
"lat" : 39.6612714,
"lng" : 116.0119343
}
}
},
"types" : [ "locality", "political" ]
},
{
"address_components" : [
{
"long_name" : "中国",
"short_name" : "CN",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "中国",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 53.56097399999999,
"lng" : 134.7728099
},
"southwest" : {
"lat" : 18.1535216,
"lng" : 73.4994136
}
},
"location" : {
"lat" : 35.86166,
"lng" : 104.195397
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 53.56097399999999,
"lng" : 134.7728099
},
"southwest" : {
"lat" : 18.1535216,
"lng" : 73.4994136
}
}
},
"types" : [ "country", "political" ]
}
],
"status" : "OK"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment