地形グリッドAPI

アクセス & 制限Public, no key needed · Heavy▾

誰でも利用可能です。プロファイルからの無料APIキーは制限を引き上げます: X-API-Key ヘッダー、またはとして api_key= アドレスで。

5分時間日
キーなし20120500
キーを使用して604002,000

Each 100 square km of area counts as one request, so a 10 km square is 1 and a 30 km square is 9.

プロフィールページで無料キーを作成するにはログインしてください。

すべての回答には X-RateLimit-Remaining and X-RateLimit-Reset制限を超えると、エラーになります 429 〜と retry_after 秒単位。拒否されたリクエストはカウントされません。

GET キーは不要 JSON または ESRI ASCII グリッド 最大100 km × 100 km 高さ 0.1 m 1時間あたりアドレスあたり60リクエスト

あるエリア内のすべての地面の高度を1つのリクエストで、同じ地形ストアから 地形標高 API と同じ高度を返しています。ポイントを 1 つずつ取得するのではなく、マップ、3D モデル、パス研究に使用してください。

GEThttps://www.altimetercloud.com/api/terrain_grid/lat lon size_km

パラメータ

領域を 2 つの方法のいずれかで指定します: その中心と大きさ、またはその端。

パラメータ意味
lat, lonエリアの中央、十進度(lng 受け入れられます)
size_km各辺がこれだけ km の正方形領域、最大 100
width_km, height_km代わりに size_km: 矩形、東から西、北から南へ、それぞれ最大100km
north, south, west, east中央と寸法の代わりに:十進度での領域の端、最大100 km。180度を横切るボックスは east 未満 west.
spacing_mオプション。ポイント間のメートル数、30 ~ 5000。省略した場合、グリッドを 100 万ポイントに保つ最良の間隔: 約 30 km の地域で 30 m、100 km で約 100 m。
formatオプション。 json (デフォルト)または asc, GIS software(QGIS など)が直接開く ESRI ASCII grid
encodingJSON用のオプションです。 base64 (デフォルト):パックされたバイナリ値としての高さ、コンパクトでデコードが速い、次のようにパック: pack によると。 array: 高さを0.1 m単位のネストされた数値リストとして、読みやすいが複数倍のサイズ。
packオプション、base64用。各高度のパック方法: uint16 (デフォルト), int16 または float32. 参照 パッキング 以下。

パッキング

デフォルトの base64 エンコーディングでは、高さはバイナリ値のブロック 1 つで、リトルエンディアン、ポイント 1 つごとに 1 つの値として出力されます。その領域に適したパッキングを選択してください:

pack1高さあたりのバイト数高さ(メートル)解像度範囲1,000,000ポイント
uint16 (デフォルト)2value * 0.1 - 1000.1 m-100 m~6,453.5 m約2.7 MB
int162value1 m地球上の全ての高度約2.7 MB
float324valuefull precision地球上の全ての高度約5.3 MB

デフォルトはほとんどすべての飛行場所に適しています。そのrange外の高度(例えば死海の岸辺(海面下約430m)または海抜6,453m以上の頂上)は最も近い制限に設定され、カウントされます。 pack.clamped, を含む note_clamped saying so; ask for int16 または float32 there. The answer always says how it is packed in pack, コードが読めるように scale and offset それを推測するのではなく取得することから。

A grid can hold at most 1,000,000 points. The finest spacing is 30 m, the resolution of the best terrain the store holds; where the store is coarser, closer points simply interpolate between its values.

例

https://www.altimetercloud.com/api/terrain_grid/?lat=54.45&lon=-3.05&size_km=10&spacing_m=100
https://www.altimetercloud.com/api/terrain_grid/?north=54.6&south=54.4&west=-3.2&east=-2.9&spacing_m=250&encoding=array
https://www.altimetercloud.com/api/terrain_grid/?lat=54.45&lon=-2.95&size_km=4&spacing_m=100&format=asc

回答の配置方法

グリッドは緯度と経度で規則的です。 行0は北辺、列0は西辺です; rows run south and columns run east, and the point in row j, 列 i 北緯にあります north - j * lat_step および経度 west + i * lon_step. 間隔はエリアの中央で要求されたスペース(メートル単位)です。

{
  "success": true,
  "rows",                               how many rows, north to south
  "cols", "points_per_row",             how many points in each row, west to east (the same number)
  "points",                             rows * cols
  "north", "south", "west", "east",     the first and last rows and columns, degrees
  "lat_step", "lon_step",               degrees between rows and between columns
  "spacing_m", "width_km", "height_km",
  "min_m", "max_m",                     lowest and highest height in the grid
  "tiers": { "ultra", "fine", "medium", "coarse", "none" },   how many points came from each resolution
  "encoding",
  "pack": { "type", "bytes_per_value", "scale", "offset", "formula",
            "resolution_m", "byte_order", "clamped" },            encoding=base64
  "heights_b64",                        encoding=base64: rows * cols packed values, row 0 first
  "note_clamped",                       only when some heights were outside the packing's range
  "heights": [ [ ... ], [ ... ] ],      encoding=array: one list per row, north first, to 0.1 m
  "order", "datum", "units", "no_data", "seconds",
  "credits": { "terrain", "full_statements", "attribution", "source" }
}

高さはEGM96平均海面上のメートル単位です。海および店舗にデータがない場所は0であり、これらのポイントはカウントされます tiers.none。行の高さ j, 列 i は値の番号 j * cols + i.

高さを読む

// JavaScript
const d = await (await fetch('https://www.altimetercloud.com/api/terrain_grid/?lat=54.45&lon=-3.05&size_km=10')).json();
const bytes = Uint8Array.from(atob(d.heights_b64), c => c.charCodeAt(0));
const P = d.pack;                                       // typed arrays are little endian on nearly every machine
const raw = P.type === 'uint16' ? new Uint16Array(bytes.buffer)
          : P.type === 'int16'  ? new Int16Array(bytes.buffer)
          :                       new Float32Array(bytes.buffer);
const heightAt = (row, col) => raw[row * d.cols + col] * P.scale + P.offset;
const latOf = row => d.north - row * d.lat_step;
const lonOf = col => d.west + col * d.lon_step;

# Python
import base64, requests, numpy as np
d = requests.get('https://www.altimetercloud.com/api/terrain_grid/',
                 params={'lat': 54.45, 'lon': -3.05, 'size_km': 10}).json()
P = d['pack']
dtype = {'uint16': '<u2', 'int16': '<i2', 'float32': '<f4'}[P['type']]
h = np.frombuffer(base64.b64decode(d['heights_b64']), dtype=dtype).reshape(d['rows'], d['cols']) * P['scale'] + P['offset']
lats = d['north'] - np.arange(d['rows']) * d['lat_step']
lons = d['west'] + np.arange(d['cols']) * d['lon_step']

ESRI ASCII グリッド

以下 format=asc 答えは平文です。短いヘッダー、その後1行あたり1行、北が最初で、1列あたり1つの高さ、0.1 mまで。赤道から離れると、ポイントは度で正方形ではないため、ヘッダーはステップを dx and dy, GDAL とQGIS が読むもの。 座標はWGS 84緯度経度(EPSG:4326)です。 このフォーマットには表示枠の余地がないため、彼らはこちらに来ます。 X-Data-Credits and Link 回答のヘッダー。

ncols 41
nrows 41
xllcenter -2.98090096
yllcenter 54.43203378
dx 0.0015450478
dy 0.0008983112
nodata_value -32768
256.9 261.7 265.6 268.3 270 271 271 270.2 ...
264.9 269.4 273.6 276.9 278.7 279.7 280.1 279.3 ...
...

エラー

エラーは JSON として返されます "success": false, コードとメッセージ。

コード意味
412パラメータが不足しているか有効ではありません。またはエリアが100 km角を超えています
413The spacing asked for would give more than 1,000,000 points; least_spacing_m この領域に適合する最高のものを提供します
429アドレスからのリクエストが多すぎるか、まだ処理中です

試してみる

緯度 中央の

経度 中央の

サイズ (km、最大 100)

間隔 (メートル、30~5000、または空白のままにしてください)

フォーマット (json or asc)

パッキング (uint16、int16、または float32)

待機中

このデータで作成: 3Dマップ

これはグリッドから構築されたものの例で、API の一部ではありません。 APIは高度のグリッドのみを返します。ここで、ブラウザはAPIにグリッドをリクエストし(1リクエスト、1時間のクォータでカウント)、高度を3D サーフェスに変換します。 three.js, 他のサービスからマップ画像をその上に重ねます。これはAltimeter Cloudの独自ツール内の3Dビューと同じアプローチです。その後、マップを変更すると同じ高さが再利用されます。

緯度 中央の

経度 中央の

サイズ (km、この例では最大 40)

AltimeterCloud に謝辞を表す

無料で使用できます。使用する場合 this API, or anything made from the answers, in a commercial product or service, credit AltimeterCloud with a link to www.altimetercloud.com 使用時点:データが表示されている画面、ページ、または印刷物上など “Data from AltimeterCloud.com”. このページにリストされている、データ自体のソースが要求するいかなるクレジットも同様に適用されます。

Terrain data credits

The ground heights come from the Terrain Tiles dataset (Mapzen / Tilezen, on AWS Open Data), reduced into resolution tiers by Altimeter Cloud. Wherever you show heights from this API, credit their sources. Each answer carries a short form of the list below in its credits field.

  • ArcticDEM terrain data DEM(s) were created from DigitalGlobe, Inc., imagery and funded under National Science Foundation awards 1043681, 1559691, and 1542736
  • Australia terrain data © Commonwealth of Australia (Geoscience Australia) 2017
  • Austria terrain data © offene Daten Österreichs – Digitales Geländemodell (DGM) Österreich
  • Canada terrain data contains information licensed under the Open Government Licence – Canada
  • Europe terrain data produced using Copernicus data and information funded by the European Union - EU-DEM layers
  • Global ETOPO1 terrain data U.S. National Oceanic and Atmospheric Administration
  • Mexico terrain data source: INEGI, Continental relief, 2016
  • New Zealand terrain data Copyright 2011 Crown copyright (c) Land Information New Zealand and the New Zealand Government (All rights reserved)
  • Norway terrain data © Kartverket
  • United Kingdom terrain data © Environment Agency copyright and/or database right 2015. All rights reserved
  • United States 3DEP (formerly NED) and global GMTED2010 and SRTM terrain data courtesy of the U.S. Geological Survey

The licences behind each statement are on the terrain tiles attribution page.