Forward & Reverse Geocoding

부분 유료
Verified
분류별 Geocoding | 업데이트됨 22日前 | Mapping
인기

9.9 / 10

지연 시간

92ms

서비스 수준

100%

Health Check

100%

모든 토론으로 돌아가기

Bug: Request with empty query parameter

When using geocoding search I am able to send empty string for the parameter ‘q’ even though it’s required.
The URL used is: https://forward-reverse-geocoding.p.rapidapi.com/v1/search?q=&addressdetails=1&limit=1
As a result I get this Object:
{
“lat”: “52.720615499999994”,
“lon”: “58.66574618108943”,
“displayName”: “Sibay, городской округ Сибай, Baschkortostan, Föderationskreis Wolga, UNDEFINED, Russland”
}
(It’s in German, but yeah, it’s somewhere in Russia)

Rapid account: Geocode Support
GeocodeSupport Commented 1年前

Yes, so it’s best to first check if your variable for q (or any other field in the query) is not empty|undefined|null|none etc. (depending on the language used).

Rapid account: Andreas Pradel Caruso
AndreasPradelCaruso Commented 1年前

Ah, then it looks like the Angular HTTP Client automatically adds “undefined” to URLs when it detects an empty parameter. Good to know!
Also thanks for pointing it out, I printed the URL into my console before I gave it to the HTTP Client and there it didn’t contain “undefined”.

Rapid account: Geocode Support
GeocodeSupport Commented 1年前

Hi Andreas, this did not happen with an empty string for q, but with a string of “undefined” (which is not undefined but just a string with the value “undefined”).

So you searched for https://forward-reverse-geocoding.p.rapidapi.com/v1/search?q=undefined&addressdetails=1&limit=1

Now “undefined” should be a stop word but currently is not (these are always hard edge cases, e.g. how would you treat a store that is called “Undefined”? We do have the same edge case with “null”).

If you do send an empty string for q at the search endpoint, you won’t get a result.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입