关于jsonObject.getJSONObject的求助

blob.png

getaddress.jsp


FineReport nhb2318 发布于 2019-12-27 14:45 (编辑于 2019-12-27 15:46)
1min目标场景问卷 立即参与
回答问题
悬赏:4 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
nhb2318Lv4初级互助
发布于2019-12-27 17:29

获取到addressComponent之后再转化为json对象,然后getString

getaddress11.jsp

但是还有个问题,用这种方法,获取到一些生僻字,返回结果是个问号

比如:

blob.png

最佳回答
0
619172745Lv6初级互助
发布于2019-12-27 15:20(编辑于 2019-12-27 16:24)

你自己封装的程序你不知道吗?,xml-->json-->解析获取..

你应该把你的程序放出来,才能帮你看看image.png

这里输出的内容是什么?

  • nhb2318 nhb2318(提问者) 上传了
    2019-12-27 15:46 
  • nhb2318 nhb2318(提问者) {\"status\":0,\"result\":{\"location\":{\"lng\":121.49879999999993,\"lat\":31.22559986579442},\"formatted_address\":\"上海市黄浦区净土街31弄-4号\",\"business\":\"老西门,城隍庙,西藏南路\",\"addressComponent\":{\"country\":\"中国\",\"country_code\":0,\"country_code_iso\":\"CHN\",\"country_code_iso2\":\"CN\",\"province\":\"上海市\",\"city\":\"上海市\",\"city_level\":2,\"district\":\"黄浦区\",\"town\":\"\",\"town_code\":\"\",\"adcode\":\"310101\",\"street\":\"净土街\",\"street_number\":\"31弄-4号\",\"direction\":\"附近\",\"distance\":\"47\"},\"pois\":[{\"addr\":\"上海市黄浦区净土街77号\",\"cp\":\" \",\"direction\":\"东北\",\"distance\":\"103\",\"name\":\"黄浦区牙病防治所分所\",\"poiType\":\"医疗\",\"point\":{\"x\":121.49812884985905,\"y\":31.225044586428419},\"tag\":\"医疗;诊所\",\"tel\":\"\",\"uid\":\"d305db1f9a880527932ca35c\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"上海市黄浦区净土街77弄\",\"cp\":\" \",\"direction\":\"北\",\"distance\":\"88\",\"name\":\"净土街77弄小区\",\"poiType\":\"房地产\",\"point\":{\"x\":121.49865885010994,\"y\":31.224928785896183},\"tag\":\"房地产;住宅区\",\"tel\":\"\",\"uid\":\"34102549ad7e51a4d92f2814\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"上海市黄浦区蓬莱路115号\",\"cp\":\" \",\"direction\":\"北\",\"distance\":\"136\",\"name\":\"上海老西门国际青年旅舍\",\"poiType\":\"酒店\",\"point\":{\"x\":121.49880257899153,\"y\":31.224542783087196},\"tag\":\"酒店;其他\",\"tel\":\"\",\"uid\":\"dbf4d6eed486b4336fa3cc1a\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"上海市黄浦区河南南路666号\",\"cp\":\" \",\"direction\":\"东北\",\"distance\":\"166\",\"name\":\"黄浦公安分局\",\"poiType\":\"政府机构\",\"point\":{\"x\":121.49783240904076,\"y\":31.224619983776369},\"tag\":\"政府机构;公检法机构\",\"tel\":\"\",\"uid\":\"a0b56699fa7f332a4d2fdf29\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"黄浦区河南南路555号(靠近复兴东路)\",\"cp\":\" \",\"direction\":\"东南\",\"distance\":\"180\",\"name\":\"士林华苑\",\"poiType\":\"房地产\",\"point\":{\"x\":121.49799410403254,\"y\":31.226804736876589},\"tag\":\"房地产;住宅区\",\"tel\":\"\",\"uid\":\"0a46dc0f46e6e15f316212aa\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"蓬莱路82号\",\"cp\":\" \",\"direction\":\"西北\",\"distance\":\"158\",\"name\":\"蓬莱路幼儿园-东区\",\"poiType\":\"教育培训\",\"point\":{\"x\":121.49935054535261,\"y\":31.22447330241251},\"tag\":\"教育培训;幼儿园\",\"tel\":\"\",\"uid\":\"ced338e91e479df085420ec8\",\"zip\":\"\",\"parent_poi\":{\"name\":\"蓬莱路幼儿园(蓬莱路)\",\"tag\":\"教育培训;幼儿园\",\"addr\":\"蓬莱路82号(柳江街文庙路)\",\"point\":{\"x\":121.49858698566914,\"y\":31.224118178158468},\"direction\":\"北\",\"distance\":\"193\",\"uid\":\"14076deee4402af502294f58\"}},{\"addr\":\"上海市黄浦区复兴东路702号\",\"cp\":\" \",\"direction\":\"南\",\"distance\":\"212\",\"name\":\"格林豪泰联盟酒店(上海城隍庙外滩店)\",\"poiType\":\"酒店\",\"point\":{\"x\":121.49864986705484,\"y\":31.227237049466266},\"tag\":\"酒店;快捷酒店\",\"tel\":\"\",\"uid\":\"fcb8154e1a6a3ac128d7abac\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"上海市黄浦区蓬莱路24弄\",\"cp\":\" \",\"direction\":\"西\",\"distance\":\"186\",\"name\":\"万象新村\",\"poiType\":\"房地产\",\"point\":{\"x\":121.500374613634,\"y\":31.22509862662777},\"tag\":\"房地产;住宅区\",\"tel\":\"\",\"uid\":\"6bcbf640cf3db82240ab9a78\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"河南南路660\",\"cp\":\" \",\"direction\":\"东北\",\"distance\":\"173\",\"name\":\"上海市公安局黄浦分局接待室\",\"poiType\":\"政府机构\",\"point\":{\"x\":121.49766173099386,\"y\":31.224681744281847},\"tag\":\"政府机构;公检法机构\",\"tel\":\"\",\"uid\":\"da27e78943c5df197069d32f\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}},{\"addr\":\"小桃园街52号\",\"cp\":\" \",\"direction\":\"东南\",\"distance\":\"326\",\"name\":\"上海西城回教堂旧址\",\"poiType\":\"旅游景点\",\"point\":{\"x\":121.4961346116269,\"y\":31.226650339039119},\"tag\":\"旅游景点;教堂\",\"tel\":\"\",\"uid\":\"a94eb04a9f9a189508ccdd79\",\"zip\":\"\",\"parent_poi\":{\"name\":\"\",\"tag\":\"\",\"addr\":\"\",\"point\":{\"x\":0.0,\"y\":0.0},\"direction\":\"\",\"distance\":\"\",\"uid\":\"\"}}],\"roads\":[],\"poiRegions\":[],\"sematic_description\":\"黄浦区牙病防治所分所东北103米\",\"cityCode\":289}}
    2019-12-27 16:36 
  • 619172745 619172745 回复 nhb2318(提问者) 帆软的json包在哪找的?
    2019-12-27 17:00 
  • nhb2318 nhb2318(提问者) 回复 619172745 没有用帆软的包,用的是百度API
    2019-12-28 16:55 
  • 1关注人数
  • 877浏览人数
  • 最后回答于:2019-12-27 17:29
    请选择关闭问题的原因
    确定 取消
    返回顶部