Web Analytics

cogeotiff

⭐ 111 stars Korean by blacha

cogeotiff

Cloud optimized GeoTIFF (COG) 작업을 위한 도구

사용법

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

빌드

NodeJs >=24.0 필요

n 또는 fnm을 사용하여 nodeJs 버전 관리하기

# Download the latest nodejs
n latest

Install node deps

npm install

Build everything into /build

npm run build

Run the unit tests

npm run test

--- Tranlated By Open Ai Tx | Last indexed: 2026-07-28 ---