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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@oriient/coordinates-convert

v1.0.0

Published

Coordinates conversion utilities for Oriient system

Downloads

58

Readme

@oriient/coordinates-convert

This package enables to convert from Oriient building local coordinates to geodetic (lat, long, alt aligned to google maps) coordinates. It also includes some utility functions that support general coordinates convertion for non Oriient related functionality, such as converting from ENU coordinates system to WGS 84 or to ECEF.

Also supports convertion of Oriient building coordinates to ENU.

The building data can be obtained form Oriient's REST API

Usage

All the examples below are using building data that can be obtained from REST API. For simplicity, here the building data is the following variables:

const buildingToEnuRotation = 284;
const buildingOrigin = {
    latitude: 32.06866,
    longitude: 34.79419,
    altitude: 0,
};

Converting Oriient's building coordinates to geodetic ones

const { buildingCoordinatesToLatLng } = require('@oriient/coordinates-convert');

// The buildingToEnuRotation and buildingOrigin can be obtained from oriient REST API
const { lat, lng, alt } = buildingCoordinatesToLatLng(
        buildingToEnuRotation,
        buildingOrigin.latitude,
        buildingOrigin.longitude,
        buildingOrigin.altitude,
        { x: 100, y: 50, height: 0 } // coordinates to convert
    );
    console.log(`lat: ${lat}, lng: ${lng}, alt: ${alt}`);

Converting Oriient's building coordinates to ENU ones

const { e, n } = buildingToENU(buildingToEnuRotation, { x: 100, y: 50 });
console.log(`e:${e}, n:${n}`);

Converting from ENU to ECEF

const { x, y, z } = enuToECEF({
        enuE: -24.32259675383305,
        enuN: 1.09125667407583e2,
        enuU: 0,
        buildingLat: buildingOrigin.latitude,
        buildingLng: buildingOrigin.longitude,
        buildingAlt: buildingOrigin.altitude,
    });
    console.log(`x:${x}, y:${y}, z: ${z}`);

converting from ENU to geodetic

const {lat, lng, alt} = enuToGeodetic(-24.32259675383305, 1.09125667407583e2, 0, buildingOrigin.latitude, buildingOrigin.longitude,  buildingOrigin.altitude);
    console.log(`lat:${lat} lng: ${lng} alt: ${alt}`);