Skip to content

Instantly share code, notes, and snippets.

View craigsc's full-sized avatar

Craig Campbell craigsc

View GitHub Profile
@craigsc
craigsc / geotiff.client.ts
Created July 9, 2023 22:11
MapLibre GeoTiff source support
import { encode } from "fast-png";
import type { GeoTIFFImage, ReadRasterResult } from "geotiff";
import { fromUrl, Pool } from "geotiff";
import type { RasterSourceSpecification } from "maplibre-gl";
import maplibregl from "maplibre-gl";
const tileSize = 256;
const decoderPool = new Pool();
/**