aneka-spatial
v0.0.5
Published
Spatial functions
Readme
aneka-spatial
ES6 geospatial functions for daily life
Installation
$ npm install aneka-spatialUsage
import { isValidCoord } from 'aneka-spatial/index.js'
const longitude = 200
const latitude = 100
const valid = isValidCoord(longitude, latitude)
console.log(valid) // false
Functions
angleIn90Deg (angle)
boundsToTiles (bounds, zoom, allTiles, withZ)
ddToDms (value, secPrecision)
Convert latitude/longitude in decimal degree to its string representation in degree, minute and second.
Parameter:
value (float): value to convert tosecPrecision (integer): number of digits after period in second (defaults to: 2)
Return: string
divideBounds (bounds, count)
Divide bounds into smaller pieces of bounds
Parameter:
bounds (array of floats): bounds to dividecount (integer): number of pieces (horizontally AND vertically)
Return: array of bounds
dmsToDd (value)
Parse string representation of a coordinate value in degree, minute, second into its decimal value
Parameter:
value (string): dms value
Return: float
enlargeBounds (bounds, zoom)
Enlarge bounds at zoom level
Parameter:
bounds (array): bounds to enlargezoom (integer): zoom level
Return: array
