Comparing version 3.3.0 to 3.4.0
@@ -8,4 +8,10 @@ # Change Log | ||
## [3.3.0] - 2019-1-8 | ||
## [3.4.0] - 2019-01-24 | ||
### Changed | ||
- Updated the core library to v3.4.0 (#31) | ||
### Added | ||
- Added `getRes0Indexes` binding (#31) | ||
## [3.3.0] - 2019-01-08 | ||
### Changed | ||
- Updated the core library to v3.3.0 (#29) | ||
@@ -12,0 +18,0 @@ ### Added |
@@ -78,3 +78,5 @@ /* | ||
['edgeLengthKm', NUMBER, [RESOLUTION]], | ||
['numHexagons', NUMBER, [RESOLUTION]] | ||
['numHexagons', NUMBER, [RESOLUTION]], | ||
['getRes0Indexes', null, [POINTER]], | ||
['res0IndexCount', NUMBER] | ||
]; |
@@ -1144,2 +1144,18 @@ /* | ||
/** | ||
* Get all H3 indexes at resolution 0. As every index at every resolution > 0 is | ||
* the descendant of a res 0 index, this can be used with h3ToChildren to iterate | ||
* over H3 indexes at any resolution. | ||
* @static | ||
* @return {H3Index[]} All H3 indexes at res 0 | ||
*/ | ||
function getRes0Indexes() { | ||
var count = H3.res0IndexCount(); | ||
var hexagons = C._malloc(SZ_H3INDEX * count); | ||
H3.getRes0Indexes(hexagons); | ||
var out = readArrayOfHexagons(hexagons, count); | ||
C._free(hexagons); | ||
return out; | ||
} | ||
/** | ||
* Convert degrees to radians | ||
@@ -1200,2 +1216,3 @@ * @static | ||
numHexagons: numHexagons, | ||
getRes0Indexes: getRes0Indexes, | ||
degsToRads: degsToRads, | ||
@@ -1202,0 +1219,0 @@ radsToDegs: radsToDegs, |
@@ -78,3 +78,5 @@ /* | ||
['edgeLengthKm', NUMBER, [RESOLUTION]], | ||
['numHexagons', NUMBER, [RESOLUTION]] | ||
['numHexagons', NUMBER, [RESOLUTION]], | ||
['getRes0Indexes', null, [POINTER]], | ||
['res0IndexCount', NUMBER] | ||
]; |
@@ -1086,2 +1086,18 @@ /* | ||
/** | ||
* Get all H3 indexes at resolution 0. As every index at every resolution > 0 is | ||
* the descendant of a res 0 index, this can be used with h3ToChildren to iterate | ||
* over H3 indexes at any resolution. | ||
* @static | ||
* @return {H3Index[]} All H3 indexes at res 0 | ||
*/ | ||
function getRes0Indexes() { | ||
const count = H3.res0IndexCount(); | ||
const hexagons = C._malloc(SZ_H3INDEX * count); | ||
H3.getRes0Indexes(hexagons); | ||
const out = readArrayOfHexagons(hexagons, count); | ||
C._free(hexagons); | ||
return out; | ||
} | ||
/** | ||
* Convert degrees to radians | ||
@@ -1142,2 +1158,3 @@ * @static | ||
numHexagons, | ||
getRes0Indexes, | ||
degsToRads, | ||
@@ -1144,0 +1161,0 @@ radsToDegs, |
{ | ||
"name": "h3-js", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "Emscripten transpiled libh3 'bindings' for Node/Web JS", | ||
@@ -5,0 +5,0 @@ "author": "David Ellis <isv.damocles@gmail.com>", |
# h3-js | ||
[![H3 Version](https://img.shields.io/badge/h3_api-v3.3.0-blue.svg)](https://github.com/uber/h3/releases/tag/v3.3.0) [![Build Status](https://travis-ci.org/uber/h3-js.svg?branch=master)](https://travis-ci.org/uber/h3-js) [![Coverage Status](https://coveralls.io/repos/github/uber/h3-js/badge.svg?branch=master)](https://coveralls.io/github/uber/h3-js?branch=master) | ||
[![H3 Version](https://img.shields.io/badge/h3_api-v3.4.0-blue.svg)](https://github.com/uber/h3/releases/tag/v3.4.0) [![Build Status](https://travis-ci.org/uber/h3-js.svg?branch=master)](https://travis-ci.org/uber/h3-js) [![Coverage Status](https://coveralls.io/repos/github/uber/h3-js/badge.svg?branch=master)](https://coveralls.io/github/uber/h3-js?branch=master) | ||
@@ -102,2 +102,3 @@ The `h3-js` library provides a pure-JavaScript version of the [H3 Core Library](https://github.com/uber/h3), a hexagon-based geographic grid system. It can be used either in Node >= 4 or in the browser. The core library is transpiled from C using [emscripten](http://kripken.github.io/emscripten-site), offering full parity with the C API and highly efficient operations. | ||
* [.numHexagons(res)](#module_h3.numHexagons) ⇒ <code>Number</code> | ||
* [.getRes0Indexes()](#module_h3.getRes0Indexes) ⇒ <code>Array.<H3Index></code> | ||
* [.degsToRads(deg)](#module_h3.degsToRads) ⇒ <code>Number</code> | ||
@@ -662,2 +663,13 @@ * [.radsToDegs(rad)](#module_h3.radsToDegs) ⇒ <code>Number</code> | ||
<a name="module_h3.getRes0Indexes"></a> | ||
### h3.getRes0Indexes() ⇒ <code>Array.<H3Index></code> | ||
Get all H3 indexes at resolution 0. As every index at every resolution > 0 is | ||
the descendant of a res 0 index, this can be used with h3ToChildren to iterate | ||
over H3 indexes at any resolution. | ||
**Returns**: <code>Array.<H3Index></code> - All H3 indexes at res 0 | ||
* * * | ||
<a name="module_h3.degsToRads"></a> | ||
@@ -664,0 +676,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
3748
769
576709
22