gpt4 book ai didi

openrefine - 尝试使用 Open Refine GREL 解析 Json

转载 作者:行者123 更新时间:2023-12-04 02:06:05 24 4
gpt4 key购买 nike

我正在尝试解析这个 JSON,但真的找不到提取我想要的数据的方法。

{ "results" :
[ { "address_components" :
[
{ "long_name" : "44", "short_name" : "44", "types" : [ "street_number" ] },
{ "long_name" : "Rue Montaigne", "short_name" : "Rue Montaigne", "types" : [ "route" ] },
{ "long_name" : "Agen", "short_name" : "Agen", "types" : [ "locality", "political" ] },
{ "long_name" : "Lot-et-Garonne", "short_name" : "Lot-et-Garonne", "types" : [ "administrative_area_level_2", "political" ] },
{ "long_name" : "Aquitaine", "short_name" : "Aquitaine", "types" : [ "administrative_area_level_1", "political" ] },
{ "long_name" : "France", "short_name" : "FR", "types" : [ "country", "political" ] },
{ "long_name" : "47000", "short_name" : "47000", "types" : [ "postal_code" ] }
],
"formatted_address" : "44 Rue Montaigne, 47000 Agen, France",
"geometry" : {
"bounds" : {
"northeast" : { "lat" : 44.1994907, "lng" : 0.6172573 },
"southwest" : { "lat" : 44.19949039999999, "lng" : 0.6172388999999999 }
},
"location" : { "lat" : 44.19949039999999, "lng" : 0.6172573 },
"location_type" : "RANGE_INTERPOLATED",
"viewport" : {
"northeast" : { "lat" : 44.20083953029149, "lng" : 0.618597080291502 },
"southwest" : { "lat" : 44.1981415697085, "lng" : 0.6158991197084979 }
}
},
"partial_match" : true,
"types" : [ "street_address" ]
} ],
"status" : "OK" }

我试图从我使用 Google Refine GREL 进行地理定位的点("location": { "lat": 44.19949039999999, "lng": 0.6172573 } )中分离出 lat 和 lng。

你能给我一个提示,告诉我应该怎么做才能成功吗?

最佳答案

试试这个:

with(value.parseJson().results[0].geometry.location, pair, pair.lat +", " + pair.lng)

关于openrefine - 尝试使用 Open Refine GREL 解析 Json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18444834/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com