大家好,
我正在尝试获取大约 700 个点的高程数据。我想我可能会使用提供给同一问题的代码(在 R 中将纬度/经度转换为高度),不幸的是,我在使用 geonames 包时遇到错误,并且提供的最佳答案网站没有可用的澳大利亚高程数据(错误仅供参考)。
我找到了另一个为澳大利亚提供非常准确的海拔数据的网站,但我不知道如何从网页中提取信息。我认为它正在使用谷歌海拔 API,但我也不知道如何访问它。
当我将“纬度,经度”坐标放入“搜索位置”框中时,它会给出地图下方的高程数据。但是,我似乎无法在源页面中找到它。该网站是http://www.daftlogic.com/sandbox-google-maps-find-altitude.htm。
一些有效的经纬度值示例:
-36.0736, 146.9442
-36.0491、146.4622
我想知道是否有人可以帮助我从 R 查询该站点并提取高程数据?还是看起来很麻烦?我意识到网站上有一个批处理功能(最多 100 个位置),但是能够从 R 中执行此操作会很酷。
谢谢大家,对不起,如果这非常明显。
干杯,亚当
错误
使用地名时:
elevation <- GNgtopo30(adult$lat, adult$lon)
Error in getJson("gtopo30JSON", list(lat = lat, lng = lng)) :
error code 10 from server: Please add a username to each call in order for geonames to be able to identify the calling application and count the credits usage.
In addition: Warning message:
In readLines(u) :
incomplete final line found on 'http://ws.geonames.org/gtopo30JSON? lat=-36.0736&lng=146.9442'
使用查询代码时:
library(RCurl)
library(XML)
url <- paste("http://earthtools.org/height", adult$lat, adult$lon, sep = '/')
page <- getURL(url)
ans <- xmlTreeParse(page, useInternalNodes = TRUE)
Space required after the Public Identifier
SystemLiteral " or ' expected
SYSTEM or PUBLIC, the URI is missing
Extra content at the end of the document
Error: 1: Space required after the Public Identifier
2: SystemLiteral " or ' expected
3: SYSTEM or PUBLIC, the URI is missing
4: Extra content at the end of the document