Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

epsg-index

A machine-readable index of EPSG coordinate systems.

Similar to epsg and node-proj4js-defs, but kept up to date. Like python-epsg, but in JavaScript/JSON.

npm version ISC-licensed minimum Node.js version

Installing

npm install @zwishing/epsg-index

Usage

Load a single PROJJSON definition by EPSG code:

import {createRequire} from 'node:module'

const require = createRequire(import.meta.url)
const epsg4326Projjson = require('@zwishing/epsg-index/s/4326.json')

console.log(epsg4326Projjson.type)

Load the lightweight index of all coordinate systems:

import {createRequire} from 'node:module'

const require = createRequire(import.meta.url)
const all = require('@zwishing/epsg-index/all.json')

console.log(all['4326'])

In all.json, projjson is a path to the per-code PROJJSON file. The full PROJJSON payload can be loaded only when needed:

import {createRequire} from 'node:module'

const require = createRequire(import.meta.url)
const all = require('@zwishing/epsg-index/all.json')

const epsg4326Projjson = require('@zwishing/epsg-index/' + all['4326'].projjson)

console.log(epsg4326Projjson.type)

CommonJS usage:

const all = require('@zwishing/epsg-index/all.json')
const epsg4326Projjson = require('@zwishing/epsg-index/' + all['4326'].projjson)

console.log(epsg4326Projjson)

Data Layout

  • all.json contains the searchable index for all EPSG records.
  • all.json[code].projjson points to s/<code>.json when PROJJSON is available.
  • s/<code>.json contains only the PROJJSON object for one code.

Related

  • transform-coordinates transforms coordinates from one coordinate system to another. Built on top of epsg-index.
  • python-epsg is a Python API to the EPSG Geodetic Parameter Dataset.

Contributing

If you have a question or have difficulties using epsg-index, please double-check your code and setup first. If you found a bug or want to propose a feature, refer to the issues page.

About

A machine-readable index of all EPSG coordinate systems.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages