Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPlace errors #8

Open
guyabel opened this issue Oct 12, 2017 · 4 comments
Open

getPlace errors #8

guyabel opened this issue Oct 12, 2017 · 4 comments

Comments

@guyabel
Copy link

guyabel commented Oct 12, 2017

I am having trouble with the getPlace(). When I try the example code in the help file I get the following error...

> sh_mcdonald = getPlace('麦当劳', '上海')
Get records, Inf page. 
    Getting  0 th page 
Error in 1:total_page : result would be too long a vector

When I set pages = 10 I get an empty data frame.

> sh_mcdonald = getPlace('麦当劳', '上海', pages = 10)
Get records, 10 page. 
    Getting  0 th page 
    Getting  1 th page 
Done! 
> sh_mcdonald 
[1] lat lon
<0 rows> (or 0-length row.names)

Any ideas what I can do to get this working?

n.b. I think I managed to apply for the key correctly (I don't speak Chinese, so not 100% sure),... downloading a map works fine e.g. p <- getBaiduMap(c(116.354431, lat=39.942333)) once I set my key using options(baidumap.key = 'i_put_my_key_here')

@badbye
Copy link
Owner

badbye commented Oct 12, 2017

You may run out of your quota. Come here and check it: http://lbsyun.baidu.com/apiconsole/quota

@guyabel
Copy link
Author

guyabel commented Oct 12, 2017

Thanks for the reply... I think they are all at 0% used?

untitled

@badbye
Copy link
Owner

badbye commented Oct 13, 2017

Just check the "Place API v2" (BTW, it is not real time).
According to your screenshot, you can only call the API 2000 times every day.
When running the "getPlace" function, each page(in the log) is counted as one call. The "getPlace" function usually return 20 pages, so run "getPlace" 100 times will spend all your quota.

@guyabel
Copy link
Author

guyabel commented Oct 13, 2017

Defiantly run getPlace() less than 100 times... and the usage is still 0% this morning. Been playing around directly with API and I seem to get this message when using some their examples....

untitled

which as far as I can understand is saying my AK is not recognized (which might explain the 0% usage)... but I have copied and pasted the AK directly from the page where my keys are...

untitled2

... I was not too sure what I was doing when setting up the keys (I never really stray outside of R and google translate does not always make sense). Does anything look odd? What type of application should I be setting up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants