2015-11-20 26 views
0

https://reverse.geocoder.cit.api.here.com/6.2/multi-reversegeocode.json?app_id=MYID&app_code=MYCODE&gen=8&mode=retrieveAddress多反向地址解析API 500錯誤

獲取參數

app_id=MYID 
app_code=MYCODE 
gen=8 
mode=retrieveAddress 

頁眉

Content-Type=* 
Cache-Control=no-cache 

帖子正文

prox=44.97750,-93.26899,50 
prox=44.93909,-93.28083,50 

返回500錯誤與響應主體是

{"type":"SystemError"} 

這個錯誤並沒有提供任何有用的信息,說明什麼是錯的。我的請求有什麼問題嗎?或者這是否是我的要求?

回答

0

這裏是對API的描述,應該幫助你成功的POST請求的鏈接:https://developer.here.com/rest-apis/documentation/geocoder/topics/request-first-multi-reverse-geocode.html

看起來你的身體後不包括「ID」。但是您需要這樣做,否則您將無法輸入結果,當您不將maxresults限制爲「1」時很重要,並且您很可能會得到每個輸入座標的多個結果。

我也建議設置gen = 9並將半徑從50增加到至少250米。因爲當您的輸入點距離道路50米以外時,您可以輕鬆獲得區域級回退。結果按照距輸入座標的距離排列,所以更大的半徑根本不會受到傷害。

id=0001&prox=44.97750,-93.26899,250 
id=002&prox=44.93909,-93.28083,250 
+0

請指教如何在python中使用'requests',而不是'geocoder'模塊。 – mel