Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@id-sdk/geo
Advanced tools
🌐 Geographic (spherical) math functions
npm install @id-sdk/geo
This library is distributed in ESM format only. It cannot be require()
'd from CommonJS.
For more, please read Sindre Sorhus’s FAQ.
import * as geo from '@id-sdk/geo';
import { geoLatToMeters } from '@id-sdk/geo';
This project is just getting started! 🌱
We're not able to support external contributors at this time, but check back in a bit when things have matured.
# geoLatToMeters(dLat: number): number <>
Convert degrees latitude to meters.
geoLatToMeters(1); // returns ≈111319
# geoLonToMeters(dLon: number, atLat: number): number <>
Convert degrees longitude to meters at a given latitude.
geoLonToMeters(1, 0); // returns ≈110946 at equator
# geoMetersToLat(m: number): number <>
Convert meters to degrees latitude.
geoMetersToLat(111319); // returns ≈1°
# geoMetersToLon(m: number, atLat: number): number <>
Convert meters to degrees longitude at a given latitude.
geoMetersToLon(110946, 0); // returns ≈1° at equator
# geoMetersToOffset(m: Vec2, tileSize?: number): Vec2 <>
Convert offset in meters (for example, imagery offset) to offset in tile pixels. tileSize
defaults to 256px.
geoMetersToOffset([100, 100]); // returns ≈[0.00064, -0.00064] pixels
# geoOffsetToMeters(offset: Vec2, tileSize?: number): Vec2 <>
Convert imagery offset in tile pixels to offset in meters. tileSize
defaults to 256px.
geoOffsetToMeters([0.00064, -0.00064]); // returns ≈[100, 100] meters
# geoSphericalDistance(a: Vec2, b: Vec2): number <>
Equirectangular approximation of spherical distances on Earth.
geoSphericalDistance([0, 0], [1, 0]); // returns ≈110946 meters
# geoScaleToZoom(k: number, tileSize?: number): number <>
Projection scale factor to tile zoom level. tileSize
defaults to 256px.
geoScaleToZoom(5340353.7154); // returns ≈17
# geoZoomToScale(z: number, tileSize?: number): number <>
Tile zoom to projection scale factor. tileSize
defaults to 256px.
geoZoomToScale(17); // returns ≈5340353.7154
# geoSphericalClosestPoint(points: Vec2[], a: Vec2): Closest | null <>
Returns info about the point from points
closest to the given test point a
.
# Vec2
An array of two numbers.
[number, number]
# Closest
An Object containing index
, distance
, and point
properties. Used as the return value for geoSphericalClosestPoint().
{ index: number, distance: number, point: Vec2 }
FAQs
Geographic (spherical) math functions
The npm package @id-sdk/geo receives a total of 0 weekly downloads. As such, @id-sdk/geo popularity was classified as not popular.
We found that @id-sdk/geo demonstrated a not healthy version release cadence and project activity because the last version was released 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.