
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@math.gl/geospatial
Advanced tools
@math.gl/geospatial is a library that provides geospatial math utilities for handling and manipulating geographic data. It includes functions for coordinate transformations, geodesic calculations, and other spatial operations.
Coordinate Transformations
This feature allows you to transform coordinates from one system to another. In this example, we convert geographic coordinates (longitude, latitude, altitude) to Cartesian coordinates.
const { Ellipsoid } = require('@math.gl/geospatial');
const wgs84 = Ellipsoid.WGS84;
const cartesian = wgs84.cartographicToCartesian([0.1, 0.1, 0]);
console.log(cartesian);
Geodesic Calculations
This feature allows you to perform geodesic calculations, such as finding the distance between two points on the surface of an ellipsoid. In this example, we calculate the surface distance between two geographic points.
const { Ellipsoid, EllipsoidGeodesic } = require('@math.gl/geospatial');
const wgs84 = Ellipsoid.WGS84;
const geodesic = new EllipsoidGeodesic([0.1, 0.1], [0.2, 0.2], wgs84);
console.log(geodesic.surfaceDistance);
Bounding Volumes
This feature allows you to compute bounding volumes for a set of points. In this example, we create a bounding sphere that encompasses a set of 3D points.
const { BoundingSphere } = require('@math.gl/geospatial');
const points = [[0, 0, 0], [1, 1, 1], [2, 2, 2]];
const boundingSphere = BoundingSphere.fromPoints(points);
console.log(boundingSphere);
Turf is a JavaScript library for advanced geospatial analysis. It provides a wide range of spatial operations, including transformations, measurements, and data manipulation. Compared to @math.gl/geospatial, Turf offers a more extensive set of geospatial functions but may be more complex to use for simple tasks.
Proj4 is a library for performing coordinate transformations. It supports a wide range of coordinate reference systems and is widely used in the geospatial community. While @math.gl/geospatial also supports coordinate transformations, Proj4 is more specialized and offers more comprehensive support for different coordinate systems.
Geolib is a library for geospatial calculations, including distance, area, and bounding box calculations. It is simpler and more lightweight compared to @math.gl/geospatial, making it suitable for basic geospatial tasks.
math.gl is a suite of math modules for 3D and geospatial applications.
This module contains geospatial math, primarly ellipsoid math for dealing with the WGS84 (World Geodetic System) coordinate system.
For documentation please visit the website.
v4.1.0
FAQs
Geospatial classes
The npm package @math.gl/geospatial receives a total of 151,240 weekly downloads. As such, @math.gl/geospatial popularity was classified as popular.
We found that @math.gl/geospatial demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.