gpt4 book ai didi

linux - 无法打开: HTTP status was '403 Forbidden' - The "sensor" parameter specified in the request must be set to either "true" or "false"

转载 作者:太空宇宙 更新时间:2023-11-04 04:49:21 26 4
gpt4 key购买 nike

最初这个问题及其前身是在 R-Sig-Geo 上提出的:

https://stat.ethz.ch/pipermail/r-sig-geo/2012-July/015648.html

“mow.R”包含:

library (RgoogleMaps)
png (filename="RgoogleMaps-package_%03d_med.png", width=480, height=480)

MyMap <- GetMap(markers =
'40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc',
sensor = "false", destfile = "MyTile1.png");

tmp <- PlotOnStaticMap(MyMap,lat = c(40.702147,40.711614,40.718217),
lon = c(-74.015794,-74.012318,-73.998284), cex=1.5,pch=20,col=c('red',
'blue', 'green'), add=F)

从 R 执行此命令会导致:

> source('mow.R')
[1] "Note that when center and zoom are not specified, no meta
information on the map tile can be stored. This basically means that R
cannot compute proper coordinates. You can still download the map tile
and view it in R but overlays are not possible. Do you want to proceed
? (y/n)"
y
[1] "40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc"
[1] "http://maps.google.com/maps/api/staticmap?size=640x640&maptype=terrain&format=png32&sensor=false40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc"
Error in download.file(url, destfile, mode = "wb", quiet = TRUE) :
cannot open URL
'http://maps.google.com/maps/api/staticmap?size=640x640&maptype=terrain&format=png32&sensor=false40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc'
In addition: Warning message:
In download.file(url, destfile, mode = "wb", quiet = TRUE) :
cannot open: HTTP status was '403 Forbidden'
>

我复制了它的网址并将其粘贴到浏览器中:

http://maps.google.com/maps/api/staticmap?size=640x640&maptype=terrain&format=png32&sensor=false40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc

结果是以下消息:

The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false".

当我更改上述网址中“&sensor=false”的位置时,它工作正常:

http://maps.google.com/maps/api/staticmap?size=640x640&maptype=terrain&format=png3240.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc&sensor=false

现在如何将此更改合并到“mow.R”文件中?请帮忙;

最佳答案

您不仅仅是更改传感器参数的位置。在您的第二个网址中,您正确设置了它,在第一个网址上,您根本没有设置它,因为您在错误值后面缺少一个与号“&”。

http://maps.google.com/maps/api/staticmap?size=640x640&maptype=terrain&format=png32&sensor=false40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc

应该是:

http://maps.google.com/maps/api/staticmap?size=640x640&maptype=terrain&format=png32&sensor=false&40.702147,-74.015794,blues%7C40.711614,-74.012318,greeng%7C40.718217,-73.998284,redc

关于linux - 无法打开: HTTP status was '403 Forbidden' - The "sensor" parameter specified in the request must be set to either "true" or "false",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11504329/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com