지형 그리드 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 그리고 X-RateLimit-Reset제한을 초과하면 오류 응답 429 포함 retry_after 초 단위입니다. 거부된 요청은 계산되지 않습니다.

GET 키가 필요 없음 JSON 또는 ESRI ASCII 격자 최대 100 km x 100 km 0.1m 단위 높이 시간당 주소당 60개 요청

한 요청에서 한 지역의 모든 지표 높이, 동일한 지형 저장소에서 지형 고도 API와 동일한 높이. 한 번에 한 점씩 요청하는 대신 지도, 3D 모델 및 경로 연구에 사용하세요.

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

매개변수

영역을 두 가지 방법 중 하나로 지정하십시오: 중심과 크기, 또는 모서리.

파라미터의미
lat, lon해당 지역의 중앙, 십진도 (lng 도 허용됨)
size_km한쪽에 이만큼의 정사각형 영역(km, 최대 100)
width_km, height_km대신에 size_km: 동쪽에서 서쪽, 북쪽에서 남쪽으로 각각 최대 100km의 직사각형
north, south, west, east중앙과 크기 대신: 영역의 가장자리를 10진수도 단위로, 각 방향 최대 100km입니다. 180도를 가로지르는 상자는 다음을 포함할 수 있습니다: east 미만 west.
spacing_m선택사항. 포인트 사이의 미터, 30~5000. 생략하면 그리드를 1,000,000포인트로 유지하는 가장 미세한 간격: 약 30km 너비의 영역의 경우 30m, 약 100km의 경우 약 100m.
format선택 사항. json (기본값) 또는 asc, QGIS 같은 GIS 소프트웨어가 직접 열 수 있는 ESRI ASCII 격자
encodingJSON의 경우 선택 사항입니다. base64 (기본값): 높이를 압축된 이진값으로 표시하며, 압축되고 빠르게 디코딩됨: pack 말합니다. array: 높이를 소수점 첫째 자리까지 중첩된 숫자 목록으로, 읽기 쉽지만 크기가 여러 배.
pack선택사항, base64용. 각 높이가 압축되는 방식: uint16 (기본값), int16 또는 float32참고 패킹 아래.

패킹

기본 base64 인코딩을 사용하면 높이가 하나의 이진 값 블록으로 제공되며, 리틀 엔디안, 포인트당 하나의 값입니다. 영역에 맞는 패킹을 선택하세요:

pack높이당 바이트높이(미터)해상도범위1,000,000개 포인트
uint16 (기본값)2value * 0.1 - 1000.1 m-100m ~ 6,453.5m약 2.7 MB
int162value1 m지구의 모든 높이약 2.7 MB
float324value완전 정밀도지구의 모든 높이약 5.3 MB

기본값은 거의 모든 곳에서 로켓 비행에 적합합니다. 사해 해안(해수면 아래 약 430 m) 또는 6,453 m 이상의 봉우리와 같이 범위를 벗어난 높이는 가장 가까운 한계로 설정되고 계산됩니다 pack.clamped, 함께 note_clamped saying so; ask for int16 또는 float32 거기. 답변은 항상 어떻게 포장되는지 설명합니다 pack, 코드가 읽을 수 있도록 scale 그리고 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 답은 일반 텍스트입니다: 짧은 헤더, 각 행마다 한 줄씩 북쪽 먼저, 열당 높이 하나씩, 0.1 m 단위입니다. 적도에서 멀리 떨어진 점들은 도 단위로 정사각형이 아니므로 헤더에 단계가 주어집니다 dx 그리고 dy, GDAL과 QGIS가 읽는 형식입니다. 좌표는 WGS 84 위도와 경도(EPSG:4326)입니다. 이 형식에는 크레딧이 들어갈 공간이 없으므로 X-Data-Credits 그리고 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 또는 asc)

패킹 (uint16, int16 또는 float32)

Várakozik

이 데이터로 만들어짐: 3D 맵

이것은 API의 일부가 아닌 그리드에서 만든 것의 예입니다. API는 높이의 그리드만 반환합니다. 여기서 브라우저는 API에 그리드(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.