Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stepankuzmin/h3-polyfill
Uber h3 polyfill CLI
https://github.com/stepankuzmin/h3-polyfill
geospatial h3 hexagon spatial-index turf uber
Last synced: 24 days ago
JSON representation
Uber h3 polyfill CLI
- Host: GitHub
- URL: https://github.com/stepankuzmin/h3-polyfill
- Owner: stepankuzmin
- Created: 2018-11-14T11:00:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T19:59:18.000Z (over 1 year ago)
- Last Synced: 2024-08-01T00:47:31.115Z (3 months ago)
- Topics: geospatial, h3, hexagon, spatial-index, turf, uber
- Language: JavaScript
- Size: 1.85 MB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-starred - stepankuzmin/h3-polyfill - Uber h3 polyfill CLI (others)
README
# h3-polyfill
[![Build Status](https://travis-ci.org/stepankuzmin/h3-polyfill.svg?branch=master)](https://travis-ci.org/stepankuzmin/h3-polyfill)
`h3-polyfill` is a library and a command line interface to Uber [h3 polyfill](https://github.com/uber/h3-js#module_h3.polyfill).
It takes an input polygon as a GeoJSON file and outputs hex as a GeoJSON polygon feature collection.
![screenshot](https://raw.githubusercontent.com/stepankuzmin/h3-polyfill/master/example.png)
## Installation
```shell
npm i h3-polyfill
```## Usage
```js
const h3Polyfill = require("h3-polyfill");const polygon = {
type: "Feature",
properties: {},
geometry: {
type: "Polygon",
coordinates: [
[
[-122.40898669999721, 37.81331899998324],
[-122.35447369999936, 37.71980619999785],
[-122.4798767000009, 37.815157199999845],
[-122.40898669999721, 37.81331899998324]
]
]
}
};const hex = h3Polyfill(polygon, 7);
```## CLI Usage
```shell
Usage: h3-polyfill
```Example:
```shell
npx h3-polyfill polygon.geojson 7 > hex.geojson
```