cogeotiff
Cloud optimized GeoTIFF (COG) 작업을 위한 도구
- 완전 자바스크립트 기반, 브라우저와 nodejs에서 작동
- TIFF 이미지와 메타데이터를 지연 로드
- 100GB 이상의 거대한 COG 지원
- GDAL TIFF 최적화 사용, 일반적으로 타일당 한두 번의 읽기만 수행!
- URL, 파일, Google Cloud 또는 AWS S3에서 TIFF 로드
- 수십억 개의 타일이 COG에서 가져오는 LINZ의 Basemaps 프로덕션에서 사용됨!
사용법
fetch를 사용하여 URL에서 COG 로드하기
import { SourceHttp } from '@chunkd/source-http';const source = new SourceHttp('https://example.com/cog.tif');
const cog = await Tiff.create(source);
const img = cog.images[0];
if (img.isTiled()) throw new Error('Tiff is not tiled');
const tile = await img.getTile(2, 2); // Fetch a tile from a tiff x:2, y:2
// Tiff tags can be directly accessed too
img.value(TiffTag.GdalNoData); // "-9999"
// or tag metadata can be fetched
img.tags.get(TiffTag.GdalNoData);
/
{
type: 'inline', // How the tag was read "inline" vs "lazy"
id: 42113, // Tag Id (@see TiffTag)
name: 'GdalNoData', // Tag Name
count: 6, // Number of values
value: '-9999',
dataType: 2, // Char
tagOffset: 194 // Bytes into the file where the tag was read.
}
*/
명령줄 인터페이스
npm i -g @cogeotiff/cli코지오티프 정보
COG에 대한 기본 정보를 표시합니다.
cogeotiff info webp.cog.tif
출력:COG File Info - /home/blacha/Downloads/tif-new/bg43.webp.cog.tif Tiff type BigTiff (v43)
Chunk size 64 KB
Bytes read 64 KB (1 Chunk)
Images
Compression image/webp
Origin 18550349.52047286,-5596413.462927464,0
Resolution 19.10925707129406,-19.10925707129415,0
BoundingBox 18550349.52047286,-5713820.738373496,19098250.139221005,-5596413.462927464
Info
Id Size Tile Size Tile Count
0 28672x6144 56x12 672
1 14336x3072 28x6 168
2 7168x1536 14x3 42
3 3584x768 7x2 14
4 1792x384 4x1 4
5 896x192 2x1 2
6 448x96 1x1 1
GDAL
COG optimized true
COG broken false
Tile order RowMajor
Tile leader uint32 - 4 Bytes
Mask interleaved false
cogeotiff 덤프
이미지의 모든 타일 덤프 (경고 큰 cog에 대해 이 작업을 수행하면 수백만 개의 파일이 생성됩니다.)
cogeotiff dump --image 2 --output output빌드
# Download the latest nodejs
n latestInstall node deps
npm installBuild everything into /build
npm run buildRun the unit tests
npm run test--- Tranlated By Open Ai Tx | Last indexed: 2026-07-28 ---