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

nord-sahara-projection

v0.2.0

Published

Typed horizontal transformations and Algeria UTM projections for Nord Sahara 1959 and WGS 84.

Readme

nord-sahara-projection

An independent, typed Node.js and browser library for horizontal coordinate operations across Nord Sahara 1959 and WGS 84 in Algeria.

It supports geographic and UTM coordinates on both datums for zones 29N, 30N, 31N, and 32N. Datum changes use Algeria's official 2022 seven-parameter transformation. Projection-only operations stay on their source datum. The package ships ESM and CommonJS builds and validates its results against official control points and independent projection fixtures.

Why this package exists

Datum transformation code is easy to duplicate and easy to get subtly wrong. Rotation signs, axis order, UTM zone selection, and the difference between geographic and projected coordinates can each produce a large positional error.

This package provides one documented API with:

  • directionally explicit WGS 84 and Nord Sahara 1959 functions;
  • the 2022 INCT transformation represented by EPSG operation 10296;
  • same-datum WGS 84 and Nord Sahara 1959 UTM projection helpers;
  • direct, datum-aware projected-to-projected helpers;
  • validated decimal-degree and DMS representation helpers;
  • strict TypeScript types and named coordinate fields;
  • automatic Algeria UTM-zone detection and batch conversion helpers;
  • low-level PROJ strings for GIS interoperability; and
  • tests based on official paired control points and independent projection fixtures.

Supported coordinate reference systems

| Coordinate reference system | EPSG code(s) | | ------------------------------------ | -------------------- | | WGS 84 geographic 2D | EPSG:4326 | | WGS 84 / UTM zones 29N-32N | EPSG:32629-32632 | | Nord Sahara 1959 geographic 2D | EPSG:4307 | | Nord Sahara 1959 / UTM zones 29N-32N | EPSG:30729-30732 |

Geographic-to-UTM operations within one datum use the reversible UTM Transverse Mercator method (EPSG:9807) and do not apply a datum shift. Operations that change between Nord Sahara 1959 and WGS 84 use EPSG:10296.

Installation

npm install nord-sahara-projection

Node.js 18 or newer is supported.

Quick start

ESM / TypeScript

import { nordSaharaUtmToWgs84, wgs84ToNordSaharaUtm } from 'nord-sahara-projection';

const wgs84 = nordSaharaUtmToWgs84({
  easting: 506129.608,
  northing: 4070666.691,
  zone: 31,
});

console.log(wgs84);
// { longitude: 3.067948..., latitude: 36.784504... }

const nordSahara = wgs84ToNordSaharaUtm(
  { longitude: 3.06794878, latitude: 36.78450494 },
  { zone: 31 },
);

CommonJS

const { nordSaharaUtmToWgs84 } = require('nord-sahara-projection');

const coordinate = nordSaharaUtmToWgs84({
  easting: 506129.608,
  northing: 4070666.691,
  zone: 31,
});

Geographic datum transformation

import { nordSaharaGeographicToWgs84 } from 'nord-sahara-projection';

const result = nordSaharaGeographicToWgs84({
  longitude: 3.0686945,
  latitude: 36.78440075,
});

Longitude is always east/west (x) and latitude is always north/south (y). Named object fields are used deliberately to prevent accidental latitude/longitude or easting/northing swaps.

Projection-only conversion

Use the datum-explicit projection helpers when the source and target stay on the same datum:

import {
  nordSaharaGeographicToNordSaharaUtm,
  wgs84GeographicToWgs84Utm,
  wgs84UtmToWgs84Geographic,
} from 'nord-sahara-projection';

const wgs84Utm = wgs84GeographicToWgs84Utm(
  { longitude: 3.06794878, latitude: 36.78450494 },
  { zone: 31 },
);

const wgs84Geographic = wgs84UtmToWgs84Geographic(wgs84Utm);

const nordSaharaUtm = nordSaharaGeographicToNordSaharaUtm(
  { longitude: 3.0686945, latitude: 36.78440075 },
  { zone: 31 },
);

The Nord Sahara projection-only functions use matching Clarke 1880 definitions on both sides and never pass through WGS 84.

Direct UTM-to-UTM transformation

The target zone is required for direct projected transformations, which prevents a source zone from being silently reused:

import { wgs84UtmToNordSaharaUtm } from 'nord-sahara-projection';

const result = wgs84UtmToNordSaharaUtm(
  { easting: 506062.834, northing: 4070969.391, zone: 31 },
  { targetZone: 31 },
);

This helper composes inverse WGS 84 UTM, EPSG:10296, and forward Nord Sahara UTM. The seven-parameter transformation is never applied directly to easting and northing.

Decimal degrees and DMS

import { decimalDegreesToDms, dmsToDecimalDegrees } from 'nord-sahara-projection';

const latitude = decimalDegreesToDms(36.78450494444444, 'latitude');
// { degrees: 36, minutes: 47, seconds: 4.2178..., hemisphere: 'N' }

const decimal = dmsToDecimalDegrees({
  degrees: 3,
  minutes: 4,
  seconds: 4.6156,
  hemisphere: 'E',
});

DMS conversion changes only angular representation. It does not project coordinates, change a datum, or alter the accuracy metadata of a geodetic operation.

Automatic UTM-zone selection

When no target zone is supplied to a geographic-to-UTM function, the library derives it from longitude:

import { wgs84GeographicToWgs84Utm } from 'nord-sahara-projection';

const result = wgs84GeographicToWgs84Utm({
  longitude: -8.0,
  latitude: 35.0,
});

console.log(result.zone); // 29

Only Algeria's official UTM zones 29N through 32N are accepted. Supplying an unsupported zone throws a NordSaharaProjectionError with a stable error code.

Batch conversion

import { wgs84GeographicToWgs84UtmBatch } from 'nord-sahara-projection';

const projected = wgs84GeographicToWgs84UtmBatch([
  { longitude: -8, latitude: 35 },
  { longitude: 3, latitude: 36 },
  { longitude: 10, latitude: 32 },
]);

Every geographic/UTM and direct UTM/UTM operation has a matching ...Batch export. Batch helpers preserve input order and return new arrays without modifying input objects.

Public API

| Export | Purpose | | --------------------------------------------- | --------------------------------------------------- | | nordSaharaUtmToWgs84 | Nord Sahara 1959 / UTM to WGS 84 geographic | | wgs84ToNordSaharaUtm | WGS 84 geographic to Nord Sahara 1959 / UTM | | nordSaharaGeographicToWgs84 | Geographic datum transformation to WGS 84 | | wgs84ToNordSaharaGeographic | Geographic datum transformation to Nord Sahara 1959 | | wgs84GeographicToWgs84Utm | Project WGS 84 geographic to WGS 84 / UTM | | wgs84UtmToWgs84Geographic | Unproject WGS 84 / UTM to WGS 84 geographic | | nordSaharaGeographicToNordSaharaUtm | Project Nord Sahara geographic to Nord Sahara / UTM | | nordSaharaUtmToNordSaharaGeographic | Unproject Nord Sahara / UTM to geographic | | wgs84UtmToNordSaharaUtm | Transform WGS 84 / UTM to Nord Sahara / UTM | | nordSaharaUtmToWgs84Utm | Transform Nord Sahara / UTM to WGS 84 / UTM | | decimalDegreesToDms / dmsToDecimalDegrees | Convert angular representation with validation | | deriveAlgeriaUtmZone | Derive zone 29-32 from longitude | | isWithinTransformationArea | Check the EPSG 10296 area-of-use bounding box | | getNordSaharaUtmProj4 / getWgs84UtmProj4 | Build explicit PROJ definitions | | INCT_2022_TRANSFORMATION | Source, accuracy, direction, and operation metadata |

All transformation functions also expose typed coordinate interfaces, stable validation errors, EPSG-code maps, and matching batch helpers.

Method and official sources

The Algerian decree of 10 November 2022 defines Nord Sahara 1959 on the Clarke 1880 ellipsoid, UTM zones 29-32, and a seven-parameter Bursa-Wolf transformation. The parameters apply to geocentric Cartesian coordinates, not directly to UTM easting and northing. The library delegates the complete projection and geocentric pipeline to proj4.

The published parameters are in the WGS 84 to Nord Sahara 1959 direction. PROJ's +towgs84 definition uses the reverse direction, matching EPSG operation 10296. Both parameter directions are exported separately to make the sign convention visible.

EPSG states an accuracy of 1 metre and notes that the parameters were derived from approximately 40 points in northern Algeria. This is metadata for the datum transformation, not a universal per-coordinate error bound or a guarantee by this package. Same-datum projection operations do not use EPSG:10296, so its 1-metre figure does not apply to them. Confirm that the operation's accuracy and area of use are suitable for your work. This package is not a replacement for a licensed surveyor or an official geodetic service.

Deliberate limits

Version 0.2 remains horizontal-only. It does not accept, return, preserve, or transform ellipsoidal height, orthometric altitude, ECEF coordinates, or vertical datums. The NGA altitudes printed with the official control points are orthometric and are not valid ellipsoidal-height fixtures. Vertical conversion requires an appropriate geoid model, which is not bundled.

The package also excludes the legacy 2006 transformation (EPSG:5660), Lambert Nord/Sud Algerie (EPSG:30791 and EPSG:30792), zero/custom transformation parameters, arbitrary CRS conversion, and UTM zones outside Algeria's 29N-32N scope. These operations require their own metadata, validation, and authoritative fixtures rather than being inferred from this horizontal API.

Development

npm install
npm run check
npm run coverage
npm pack --dry-run

npm run check runs formatting, linting, type checking, official-fixture tests, and both package builds.

Non-affiliation notice

This is an independent open-source implementation. It is not an official publication of, and is not endorsed by, Algeria's Institut national de cartographie et de teledetection (INCT). The INCT name is used only to identify the published source of the transformation parameters.

License

MIT (c) 2026 Brahim Kedjar