大家好,
我正在尝试获取大约700个点的高程数据。我想使用提供给同样问题的代码(R中纬度/经度转高度的转换),但不幸的是,在使用geonames包时会出现错误,并且最佳答案提供的网站没有澳大利亚高程数据可用(下面提供了错误信息以供参考)。
我找到了另一个网站,该网站为澳大利亚提供了非常准确的高程数据,但我不知道如何从网页中提取信息。我认为它正在使用google高程API,但我不知道如何访问它。
当我将“纬度,经度”坐标放入“搜索位置”框中时,它会在地图下方提供高程数据。但是,我似乎找不到这个数据在源页面中的位置。该网站是http://www.daftlogic.com/sandbox-google-maps-find-altitude.htm。
一些示例经纬度值:
-36.0736, 146.9442
-36.0491, 146.4622
我想知道是否有人可以帮助我从R查询此网站,并提取高程数据?或者这似乎太麻烦了吗?我意识到该网站有一个批处理功能(最多100个位置),但能够从R中完成这项工作将是很不错的。
谢谢大家,如果这显然明显请原谅我。
谢谢, Adam
错误信息:
当使用geonames时:
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