npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

reproject-crs-geojson

v1.0.1

Published

![npm license](https://img.shields.io/npm/l/reproject-crs-geojson) ![npm version](https://img.shields.io/npm/v/reproject-crs-geojson) ![npm downloads](https://img.shields.io/npm/dt/reproject-crs-geojson)

Downloads

14

Readme

reproject-crs-geojson

npm license npm version npm downloads

Small package to reproject the vertex coordinates of a GeoJSON between coordinate reference systems (CRS).

Accepts objects of type Feature, FeatureCollection, Geometry, or GeometryCollection, as well as all geometry types: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, and GeometryCollection.

The Turf.js coordEach function is used to iterate through all the object's coordinate pairs and reproject them with Proj4js. Additionally, to make CRS selection easier, proj4-list is added.

Documentation

https://f4gm.github.io/reproject-crs-geojson/

Usage

Install the package

npm install reproject-crs-geojson

Imports

import {
  reprojectGeoJSON,
  getEPSG,
  epsgExist,
  toWGS84
} from "reproject-crs-geojson";

Reproject

The reprojectGeoJSON it does not affect the properties, geometry type or number of vertices, it only converts the CRS.

import { reprojectGeoJSON } from "reproject-crs-geojson";

const Point = {
  type: "Feature",
  geometry: {
    type: "Point",
    coordinates: [1060479.7, 865010.7]
  }
}

const converted = reprojectGeoJSON(
  Point,
  "EPSG:3115",
  "EPSG:4326" // WGS84
);

console.log(converted);

// Expected

// {
//   type: 'Feature',
//   geometry: {
//     type: 'Point',
//     coordinates: [ -76.53327992507303, 3.3753051396728866 ]
//   }
// }

You can also include the string PROJ.4:

import { reprojectGeoJSON } from "reproject-crs-geojson";

const epsg_3115 = "+proj=tmerc +lat_0=4.59620041666667 +lon_0=-77.0775079166667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs";

const Point = {
  type: "Feature",
  geometry: {
    type: "Point",
    coordinates: [1060479.7, 865010.7]
  }
}

const converted = reprojectGeoJSON(
  Point,
  epsg_3115,
  "EPSG:4326" // WGS84
);

To convert directly to WGS84 (EPSG:4326) you can use the function toWGS84:

import { toWGS84 } from "reproject-crs-geojson";

const epsg_3115 = "+proj=tmerc +lat_0=4.59620041666667 +lon_0=-77.0775079166667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs";

const Point = {
  type: "Feature",
  geometry: {
    type: "Point",
    coordinates: [1060479.7, 865010.7]
  }
}

const converted = toWGS84(
  Point,
  epsg_3115
);

console.log(converted);

EPSG utils

If you want to know if an epsg code is in proj4-list:

import { epsgExist } from "reproject-crs-geojson";

console.log(epsgExist("foo"));
// false

console.log(epsgExist("EPSG:3115"));
// true

If you need the PROJ.4 string:

import { getEPSG } from "reproject-crs-geojson";

console.log(getEPSG("EPSG:4326"));
// +proj=longlat +datum=WGS84 +no_defs

In theory, according to the specification, GeoJSON objects should be in the World Geodetic System 1984 (WGS 84). However, in many cases, we find it necessary to perform these types of transformations.

This is my first npm package, as well as my first foray into the TypeScript language. I apologize in advance for any mistakes.