Socket
Book a DemoInstallSign in
Socket

a5-to-geojson

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a5-to-geojson

A lightweight utility library for converting A5 cells to GeoJSON features and geometries, along with additional tools for working with the [A5 geoindexing system](https://a5geo.org/).

2.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

a5-to-geojson

A lightweight utility library for converting A5 cells to GeoJSON features and geometries, along with additional tools for working with the A5 geoindexing system.

Features

  • Convert A5 cells to GeoJSON Point and Polygon features or geometries.
  • Convert coordinates to A5 cells and vice versa.
  • Calculate the bounding box (BBox) of an A5 cell.
  • Get the resolution of an A5 cell.

Installation

Install the library:

npm install a5-to-geojson

or

pnpm add a5-to-geojson

Usage

Here is an example of how to use the library:

import {
  coordToA5,
  a5ToCoord,
  a5ToPointFeature,
  a5ToPolygonFeature,
} from 'a5-to-geojson';

// Convert coordinates to an A5 cell
const coord = [-3.6886, 40.4201]; // Madrid [longitude, latitude]
const resolution = 9;
const a5Cell = coordToA5(coord, resolution);
console.log('A5 Cell:', a5Cell);

// Convert an A5 cell back to coordinates
const backToCoord = a5ToCoord(a5Cell);
console.log('Coordinates:', backToCoord);

// Convert an A5 cell to a GeoJSON Point feature
const pointFeature = a5ToPointFeature(a5Cell);
console.log('GeoJSON Point Feature:', pointFeature);

// Convert an A5 cell to a GeoJSON Polygon feature
const polygonFeature = a5ToPolygonFeature(a5Cell);
console.log('GeoJSON Polygon Feature:', polygonFeature);

Documentation

See DOCS

License

This project is licensed under the MIT License.

Acknowledgements

FAQs

Package last updated on 12 Jun 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.