Tree Canopy 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 또는 바이너리 파일 최대 30 km² 1비트 또는 4비트 셀 시간당 주소당 60개 요청

나무가 있는 위치와 높이(지점 주변 사각형, 캐노피 저장소의 각 셀, 약 3 x 5미터, 동일한 데이터 수목 캐노피 높이 맵 draws합니다. 웹 페이지 또는 스크립트용 JSON으로 요청하거나, flight computer 또는 ground station이 보유하고 몇 줄의 코드로 읽을 수 있는 작은 바이너리 파일로 요청하세요. 그러면 launch site의 트리를 당일 가져오지 않고도 firmware에 구축할 수 있습니다.

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

매개변수

파라미터의미
lat, lon정사각형의 중앙, 십진도 (lng 도 허용됨)
size_km제곱형의 한 변의 거리(km), 0 이상 30 이하. 생략하면 1. 10 km를 초과하는 사각형은 다음과 같이 표시됩니다 format=bin 만 가능하며 준비하는 데 더 오래 걸립니다: 30km의 경우 최대 30초.
bits선택 사항. 4 (기본값): 각 셀은 고도 대역, 0~15입니다. 1: 각 셀은 3m 이상의 나무일 경우 1, 없을 경우 0으로, 크기의 1/4입니다.
format선택 사항. json (기본값, 10km까지의 사각형): base64로 인코딩된 셀과 읽기에 필요한 모든 것을 포함한 JSON 답변. bin: 32바이트 헤더와 셀을 모든 크기의 파일로.
compress선택 사항. none (기본값), zlib 또는 lzma~와 함께 format=bin the whole file is compressed; with json base64 이전의 셀입니다. lzma 은 LZMA-alone (.lzma작은 장치용으로 제작됨: 참조 LZMA 아래.
download선택 사항. 1 브라우저가 저장하도록 만듭니다 format=bin 파일로 답변하며, 사각형 이름으로 지정됩니다.

셀

Windermere 근처 1km 정사각형 지역, 4비트 다운로드에서 직접 그린 동일한 정사각형 옆

Windermere 근처 1km 정사각형: 왼쪽은 Tree Canopy Height Map이 표시한 대로, 오른쪽은 4비트 다운로드에서 직접 그린 것으로, 각 셀은 대역별로 색칠되고 나무가 없는 곳은 검은색.

그리드는 캐노피 저장소 자체이므로 리샘플링되지 않습니다. 각 셀은 정확히 1도의 1/24000이며, 북쪽에서 남쪽으로 약 4.6m이고, 영국 위도에서는 동쪽에서 서쪽으로 약 2.7m입니다. 행 0은 북쪽 가장자리이고 열 0은 서쪽 가장자리입니다; rows run south and columns east. Every row starts on a whole byte, so row j 바이트 위치에서 시작 j * row_bytes.

bits셀당패킹
4높이 대역 0~15한 바이트에 두 개의 셀, 첫 번째는 상위 4비트에
11 = 3m 이상의 나무, 0 = 없음8비트는 1바이트, 첫 번째는 최상위 비트

높이 대역, 각 대역의 최저 높이:

대역0123456789101112131415
로부터없음3 m5 m7 m10 m13 m16 m19 m22 m26 m30 m35 m40 m46 m53 m61 m

높이는 위성 이미지가 촬영되었을 때의 나무 높이입니다: 2017년~2020년, 대부분 2018년~2020년(메타 데이터), 그리고 2020년(ETH 채우기). 그 이후로 베어링하거나 심은 산림은 아직 표시되지 않습니다.

Band 0 is open ground, water, and anything under 3 m, including scrub and hedges. Ground not yet in the database is 0 as well; the JSON answer's sources.none counts those cells.

크기

영국 위도에서 압축 전:

정사각형셀4비트1비트
1 km217 × 36839 KB10 KB
3 km648 × 1,102349 KB87 KB
5 km1,079 × 1,835967 KB242 KB
10 km2,157 × 3,6693.8 MB967 KB
20 km4,313 × 7,33715.1 MB3.8 MB
30 km6,469 × 11,00533.9 MB8.5 MB

Compression takes these down a long way. File sizes near Windermere in the Lake District (54°N), over mixed woodland, fells and fields; the 1, 3 and 10 km rows are real downloads, and the rows marked ~ are estimated from them:

정사각형4-bit, height bands1비트, 트리 또는 아님
원본zliblzma원본zliblzma
1 km40 KB13 KB13 KB10 KB4 KB4 KB
3 km352 KB90 KB82 KB88 KB28 KB23 KB
5 km967 KB~250 KB~230 KB242 KB~70 KB~60 KB
10 km3.8 MB1.0 MB0.9 MB967 KB268 KB217 KB
20 km15.1 MB~4 MB~3.6 MB3.8 MB~1 MB~0.85 MB
30 km33.9 MB~9 MB~8 MB8.5 MB~2.4 MB~1.9 MB

두 가지가 이동을 결정합니다. 적도에서 멀어질수록 사각형의 열이 적어져 원본 파일이 축소됩니다. 45°N에서 30km 4비트 사각형은 28.5 MB이고 여기서는 33.9 MB입니다. 그리고 밀집된 숲은 개방된 땅보다 압축이 덜합니다. Aix-les-Bains 근처 프랑스 알프스의 실제 30km 4비트 사각형(대부분 숲)은 9.5 MB였습니다. lzma, 약 원래 크기의 1/3이며, Windermere 정사각형은 약 1/4까지 감소했습니다. lzma 는 항상 가장 작으며, 4-bit의 경우 약 1/10, 1-bit의 경우 약 1/5입니다.

LZMA

compress=lzma LZMA 단독 스트림을 제공하고, .lzma format, not .xz: a 13 byte header (one properties byte, 0x5D for lc=3 lp=0 pb=2; a 4 byte dictionary size, 65536; the 8 byte uncompressed length, little endian) and then the compressed data. The 64 KB dictionary keeps the memory a decoder needs small enough for a microcontroller such as an ESP32, and the length is always the true one, so a decoder such as the LZMA SDK's LzmaDec 정확히 예상할 수 있습니다. 컴퓨터에서, xz --format=lzma -d 또는 Python lzma 모듈 FORMAT_ALONE 압축을 풉니다.

binary file

함께 format=bin: 32 바이트 헤더, 리틀 엔디안, 그 다음 행, 북쪽 먼저.

바이트유형값
0char[4]ACTR
4uint8버전, 1
5uint8셀당 비트, 1 또는 4
6uint16셀/도, 24000
8int32북쪽 가장자리(셀 단위): 위도 × 24000
12int32서쪽 가장자리 셀 단위: 경도 × 24000
16uint32행
20uint32열
24uint32행당 바이트
28uint320, 예약됨

가장자리는 셀의 정수 단위이므로 위치가 정확히 해당 셀에 매핑됩니다: 행 north_edge - 1 - floor(lat * 24000), 열 floor(lon * 24000) - west_edge.

예시

https://www.altimetercloud.com/api/trees/?lat=54.35&lon=-3.03&size_km=3
https://www.altimetercloud.com/api/trees/?lat=54.35&lon=-3.03&size_km=5&bits=1&format=bin&compress=zlib
https://www.altimetercloud.com/api/trees/?lat=54.35&lon=-3.03&size_km=10&format=bin&compress=lzma&download=1

JSON 답변

{
  "success": true,
  "lat", "lon", "size_km", "bits",
  "rows", "cols", "cells", "row_bytes",      the grid, as above
  "cells_per_degree", "north_edge_cell", "west_edge_cell",
  "north", "south", "west", "east",          the square's edges, degrees
  "cell_deg", "cell_m_north_south", "cell_m_east_west",
  "wooded_pct",                              cells with trees of 3 m or more
  "coverage_pct",                            cells the database holds
  "sources": { "meta_chmv2", "eth_fine", "eth_medium", "eth_coarse", "none" },
  "band_min_m": [ 0, 3, 5, ... ],            bits=4
  "meaning", "order", "compress", "bytes",
  "data_b64",                                the rows, row 0 first, compressed if asked
  "file_name", "seconds",
  "credits": { "canopy", "source", "source_eth", "licence", "full" }
}

Reading the cells

On a device: what's below me

Give a position and get the cell it is in: every position falls in exactly one cell, so this is the ground directly underneath. The file sits in flash or on a card, and cells is the bytes straight after the 32 byte header. Use doubles for the position: a float's 24 bits leave only about an eighth of a cell to spare.

// C
typedef struct __attribute__((packed)) {
  char     magic[4];        // "ACTR"
  uint8_t  version;         // 1
  uint8_t  bits;            // 1 or 4
  uint16_t cells_per_deg;   // 24000
  int32_t  north_edge;      // latitude of the north edge * 24000
  int32_t  west_edge;       // longitude of the west edge * 24000
  uint32_t rows, cols, row_bytes, reserved;
} TreeHeader;

// the band (0 to 15), or 1/0 for tree or not, at a position; -1 outside the square
int treeAt(const TreeHeader *h, const uint8_t *cells, double lat, double lon) {
  int32_t j = h->north_edge - 1 - (int32_t)floor(lat * h->cells_per_deg);
  int32_t i = (int32_t)floor(lon * h->cells_per_deg) - h->west_edge;
  if (j < 0 || i < 0 || j >= (int32_t)h->rows || i >= (int32_t)h->cols) return -1;
  const uint8_t *row = cells + (uint32_t)j * h->row_bytes;
  if (h->bits == 4) { uint8_t b = row[i >> 1]; return (i & 1) ? (b & 15) : (b >> 4); }
  return (row[i >> 3] >> (7 - (i & 7))) & 1;
}

// a band's height range in metres; max_m is 0 for band 15 (61 m and over) and band 0
static const uint8_t BAND_MIN_M[16] = { 0, 3, 5, 7, 10, 13, 16, 19, 22, 26, 30, 35, 40, 46, 53, 61 };
void bandMetres(int band, int *min_m, int *max_m) {
  band &= 15;
  *min_m = BAND_MIN_M[band];
  *max_m = (band > 0 && band < 15) ? BAND_MIN_M[band + 1] : 0;
}

내 근처 나무

착륙의 경우: 위치로부터의 반경 내에 중심이 있는 모든 셀 중 나무를 보유하고 있는 셀의 개수, 가장 가까운 거리, 그리고 그 중 가장 키 큰 것. 전체 버전은 treesWithin() in the reader download below; it works in metres from the cell size, which is 111320 / 24000 남북 방향 m과 위도의 코사인 곱하기 동서 방향.

TreeNear t = treesWithin(h, cells, lat, lon, 50.0f);   // within 50 m
// t.wooded     cells with trees of 3 m or more
// t.cells      cells in the circle (fewer near the square's edge)
// t.nearest_m  to the nearest wooded cell, -1 if none
// t.tallest    the highest band in the circle

나무와 지면

여기의 높이는 나무의 해수면 위 또는 발사대 위의 높이가 아니라 나무가 서 있는 땅 위의 높이입니다. 따라서 파일은 아래에 나무가 있고 얼마나 큰지 알려주지만, 나무 꼭대기가 얼마나 아래에 있는지는 알려주지 않습니다. 계곡이나 비탈에서는 땅에 나무만큼 의존합니다. 그 경우, 다음에서 지상 높이와 결합하세요: 지형 고도 API 또는 지형 그리드 API for a whole square to keep alongside the tree file on a device. An altimeter measures height above the pad, and the pad's ground height turns that into height above sea level; the tree tops below you are the ground height there plus the tree height.

// the pad's ground height and the ground height below you, both from the terrain APIs
double rocket_asl = pad_ground_m + height_above_pad_m;

int lo, hi;
bandMetres(treeAt(h, cells, lat, lon), &lo, &hi);
if (hi == 0 && lo > 0) hi = 70;                  // band 15 is 61 m and over: pick your own top
double canopy_asl = ground_below_m + hi;          // the top of the band, to be on the safe side
double clearance  = rocket_asl - canopy_asl;      // metres between you and the tree tops

마이크로컨트롤러에서 압축 풀기

A compress=lzma 파일 압축 해제 LzmaDecode() ~에서 LZMA SDK Igor Pavlov: 2개의 C 파일, LzmaDec.c 그리고 LzmaDec.h, 공개 도메인이며, decoder는 Altimeter Cloud Jupiter가 제공합니다. 한 번에 최종 버퍼로 직접 압축 해제되므로, 해당 버퍼는 사전 역할을 하므로 파일 자체 외에 작동하는 동안 약 16KB만 필요합니다. ESP32에서, compress=zlib 추가 항목이 필요 없습니다: miniz는 tinfl 이미 ROM에 있습니다. xz-embedded는 사용할 수 없습니다: 읽기 .xz, 아님 .lzma.

트리 판독기 및 LZMA 디코더zip, 26/09/2026에 압축됨

zip 파일 내: tree_reader.h 그리고 tree_reader.c 위의 모든 항목 외에 treeUnpackLzma(), 및 Jupiter가 빌드된 LZMA SDK 디코더 파일입니다. Arduino의 경우 스케치 폴더에 복사하고 추가하세요 #include "tree_reader.h"; the LZMA part builds itself only when the SDK files are there. They were current on that date; for anything newer, check the LZMA SDK 페이지.

컴퓨터에서

# Python
import requests, struct, zlib, numpy as np
r = requests.get('https://www.altimetercloud.com/api/trees/',
                 params={'lat': 54.35, 'lon': -3.03, 'size_km': 3, 'format': 'bin', 'compress': 'zlib'})
f = zlib.decompress(r.content)            # or lzma.decompress(r.content, format=lzma.FORMAT_ALONE)
magic, ver, bits, cpd, north, west, rows, cols, rb, _ = struct.unpack('<4sBBHiiIIII', f[:32])
g = np.frombuffer(f[32:], np.uint8).reshape(rows, rb)
if bits == 4:
    cells = np.empty((rows, rb * 2), np.uint8); cells[:, 0::2] = g >> 4; cells[:, 1::2] = g & 15
else:
    cells = np.unpackbits(g, axis=1)
cells = cells[:, :cols]                       # row 0 north, column 0 west
lat_of_row = lambda j: (north - j - 0.5) / cpd
lon_of_col = lambda i: (west + i + 0.5) / cpd

오류

오류는 JSON으로 반환됩니다 "success": false, 코드와 메시지입니다.

코드의미
412매개변수가 누락되었거나 유효하지 않음, 사각형이 30km를 초과, 또는 10km를 초과한 JSON 요청됨
413사각형의 셀이 너무 많으며, 이는 극지방 매우 가까이에서만 발생
429귀하의 주소에서 너무 많은 요청이 있거나 아직 처리 중입니다
501요청한 압축이 현재 사용 불가능합니다

시도해 보세요

그 수목 캐노피 높이 맵 다운로드 패널이 있습니다: 맵을 이동하여 십자가가 발사 사이트 위에 오도록 하고, 크기, 셀 및 압축을 선택하면 이 API에서 파일을 저장합니다.

Canopy data credits

Canopy heights: Meta and World Resources Institute (WRI) 2026, Version 2 High Resolution Canopy Height Maps (CHMv2), source imagery for CHM © 2016 Vantor, licensed under CC BY 4.0. Where that is not yet in the database: ETH Global Canopy Height 2020, Lang, Jetz, Schindler and Wegner, ETH Zurich, CC BY 4.0. Both are reduced here to the height bands above, which changes them: they are not the original data.

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”. 이 페이지에 나열된 데이터의 출처가 요청하는 모든 출처 표시가 적용됩니다.