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

@geodetic-lse/geodesy

v1.0.1

Published

Geodesy library for Geodetic LSE

Readme

@geodetic-lse/geodesy

Geodesy tools for least squares adjustment of surveying networks. Currently supports levelling networks (1D height adjustment).

npm version npm downloads License: MPL-2.0 TypeScript

Built on top of @geodetic-lse/core.

Installation

npm install @geodetic-lse/geodesy

Quick start

import { loadLevellingNetwork, adjustLevellingNetwork } from '@geodetic-lse/geodesy'

const input = {
    network: {
        name: 'My levelling network',
        points: [
            { id: 'A', height: 100.0, is_fixed: true },
            { id: 'B', height: 0, is_fixed: false },
            { id: 'C', height: 0, is_fixed: false },
        ],
        observations: [
            { station: 'A', target: 'B', type: 'delta_height', value: 5.123, sigma: 1.0 },
            { station: 'B', target: 'C', type: 'delta_height', value: 3.456, sigma: 1.0 },
            { station: 'A', target: 'C', type: 'delta_height', value: 8.58, sigma: 1.0 },
        ],
        parameters: {
            type_computation: 'constrained',
            sigma_0: 1.0,
        },
    },
}

const network = loadLevellingNetwork(input)
const result = adjustLevellingNetwork(network)

console.log('Redundancy:', result.redundancy)
console.log('s0 (a posteriori):', result.s0.toFixed(4))
console.table(result.adjustedPoints)
console.table(result.residuals)

Input format

The input is a JSON object with a network key:

{
    "network": {
        "name": "Network name",
        "source": "Data source",
        "description": "Description",
        "crsVertical": "IGN69",
        "points": [...],
        "observations": [...],
        "parameters": {...}
    }
}

Points

| Field | Type | Required | Description | | ---------- | --------- | -------- | ------------------------------------------------------------------- | | id | string | yes | Unique point identifier | | height | number | yes | Height in metres (initial approximation for unknowns) | | is_fixed | boolean | yes | Whether the point is held fixed | | sigma | number | no | Precision in mm — required for fixed points in free-adjusted mode |

Observations

Only delta_height observations are currently supported.

| Field | Type | Required | Description | | --------- | -------- | -------- | ------------------------------------ | | station | string | yes | Origin point ID | | target | string | yes | Target point ID | | type | string | yes | Must be "delta_height" | | value | number | yes | Observed height difference in metres | | sigma | number | yes | Observation precision in mm |

Parameters

| Field | Type | Default | Description | | ------------------ | -------- | --------------- | ------------------------------------------------------------- | | sigma_0 | number | 1.0 | A priori reference standard deviation | | type_computation | string | "constrained" | Adjustment mode — see Computation modes |

Computation modes

| Mode | Description | | --------------- | ------------------------------------------------------------------------------------- | | constrained | Fixed points define a rigid reference frame (default) | | free | One fixed point defines the datum; others are adjusted freely | | free-adjusted | Fixed point heights are used as weighted pseudo-observations; all points are unknowns |

In free-adjusted mode, each fixed point must have a sigma value defined.

API

loadLevellingNetwork(input)

Parses and validates a raw input object. Throws descriptive errors on invalid data.

Returns a NetWork object ready for adjustment.


adjustLevellingNetwork(network)

Performs the least squares adjustment.

Returns a LevellingAdjustmentResult:

| Field | Type | Description | | ---------------- | ----------------------- | ---------------------------------------------------- | | adjustedPoints | AdjustedPoint[] | Adjusted heights with corrections and sigmas | | residuals | ObservationResidual[] | Residuals and reliability indicators per observation | | s0 | number | A posteriori standard deviation | | sigma0 | number | A priori standard deviation | | redundancy | number | Degrees of freedom | | Kll | Matrix | Variance-covariance matrix of observations | | Qll | Matrix | Weight coefficient matrix |

AdjustedPoint

| Field | Type | Description | | ------------ | --------- | -------------------------------- | | id | string | Point identifier | | height | number | Adjusted height [m] | | correction | number | Applied correction [m] | | sigma | number | Standard deviation [mm] | | is_fixed | boolean | Whether the point was held fixed |

ObservationResidual

| Field | Type | Description | | ---------- | -------- | ---------------------------------------------------- | | station | string | Origin point | | target | string | Target point | | observed | number | Observed height difference [m] | | computed | number | Computed height difference from adjusted heights [m] | | residual | number | Residual v [mm] | | sigma | number | Standard deviation of residual [mm] | | wi | number | Normalized residual — Baarda's test statistic | | zi | number | Local redundancy number [%] | | gi | number | Estimated gross error [mm] |

License

MPL-2.0