Skip to content

feat: New @developmentseed/epsg package for shipping compressed EPSG code bundle#262

Merged
kylebarron merged 27 commits intomainfrom
kyle/epsg
Mar 2, 2026
Merged

feat: New @developmentseed/epsg package for shipping compressed EPSG code bundle#262
kylebarron merged 27 commits intomainfrom
kyle/epsg

Conversation

@kylebarron
Copy link
Copy Markdown
Member

@kylebarron kylebarron commented Feb 24, 2026

The full EPSG projection database, compressed to 309kb for the web.

Some existing EPSG amalgamations exist, but all are uncompressed, incomplete, outdated, and/or not reproducible 1 2 3 4. This package uses the DecompressionStream API, now widely available in browsers, to bundle a gzip-compressed text file of WKT definitions for all 7352 defined EPSG codes.

Usage

Currently, the only package entrypoint is @developmentseed/epsg/all, which loads a Map<number, string>, with all EPSG definitions in OGC WKT2 format.

import loadEPSG from "@developmentseed/epsg/all";
import proj4 from "proj4";

// Load the EPSG database
const epsg = await loadEPSG();

// Access WKT strings by EPSG code.
const wkt4326 = epsg.get(4326);
const wkt3857 = epsg.get(3857);

// Then use proj4.js as normal
const converter = proj4(wkt4326, wkt3857);
const inputPoint = [1, 52];
const outputPoint = converter.forward(inputPoint);

Footnotes

  1. epsg includes only 3912 definitions, stores older, deprecated proj strings, and is uncompressed, coming to 500kb.

  2. epsg-index stores extra parsed information for each projection and is 7.7 MB.

  3. proj4-list includes only 5434 definitions, stores older, deprecated proj strings, and is 759KB of uncompressed strings.

  4. @esri/proj-codes ships a lot of redundant information, coming to nearly 15MB of JSON.

Comment thread packages/epsg/tests/all.test.ts
@kylebarron
Copy link
Copy Markdown
Member Author

just noting that proj can be compiled to Wasm now: https://willcohen.github.io/clj-proj/

@kylebarron kylebarron changed the title Kyle/epsg feat: New @developmentseed/epsg package for shipping compressed EPSG code bundle Mar 2, 2026
@github-actions github-actions bot added the feat label Mar 2, 2026
@kylebarron kylebarron merged commit 510498a into main Mar 2, 2026
3 checks passed
@kylebarron kylebarron deleted the kyle/epsg branch March 2, 2026 17:03
@ds-release-bot ds-release-bot bot mentioned this pull request Mar 2, 2026
@kylebarron kylebarron mentioned this pull request Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant