皆様、
私が持っている約 700 ポイントの標高データを取得しようとしています。同じ質問 ( R で緯度/経度から高度への変換) に提供されたコードを使用する可能性があると思いましたが、残念ながら geonames パッケージを使用するとエラーが発生し、最良の回答が提供する Web サイトにはオーストラリアの標高データがありません (エラー参考までに以下に示します)。
オーストラリアの非常に正確な標高データを提供する別の Web サイトを見つけましたが、Web ページから情報を抽出する方法がわかりません。Google標高APIを使用していると思いますが、それにアクセスする方法がわかりません。
「場所の検索」ボックスに「緯度、経度」座標を入力すると、地図の下に標高データが表示されます。ただし、ソースページでこれを見つけることができないようです。Web サイトはhttp://www.daftlogic.com/sandbox-google-maps-find-altitude.htmです。
機能する緯度経度値の例:
-36.0736、146.9442
-36.0491、146.4622
R からこのサイトにクエリを実行し、標高データを抽出するのを手伝ってくれる人がいるかどうか疑問に思っています。それとも、面倒なように思えますか?Web サイトにバッチ機能 (最大 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