我在R studio中使用以下代码来检索给定城市中所有超市的坐标。但是,我仅获得前20个结果,并且我想查询更多结果,直到用尽为止。任何有关如何做到这一点的建议都欢迎。
library(RCurl)
library(tidyverse)
library(sf)
library(dplyr)
library(jsonlite)
key = "########" #Google Places API key
location <- "37.975474, 23.734812"
radius <- 10000
type <- "supermarket"
searchURL <- paste("https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=",
key,
"&location=",location,
"&radius=",radius,
"&type=",type,
sep="")
result <- getURL(url = URLencode(searchURL),ssl.verifypeer = FALSE)
tmp <- jsonlite::fromJSON(result)
supermarkets <- tmp$results