diff --git a/README.md b/README.md index ce02b85..1c8a007 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ const feature = geojson2h3.h3SetToFeature(hexagons); ## geojson2h3 * [geojson2h3](#module_geojson2h3) - * [.featureToH3Set(feature, resolution)](#module_geojson2h3.featureToH3Set) ⇒ Array.<String> + * [.featureToH3Set(feature, resolution, [options])](#module_geojson2h3.featureToH3Set) ⇒ Array.<String> * [.h3ToFeature(hexAddress, [properties])](#module_geojson2h3.h3ToFeature) ⇒ Feature * [.h3SetToFeature(hexagons, [properties])](#module_geojson2h3.h3SetToFeature) ⇒ Feature * [.h3SetToMultiPolygonFeature(hexagons, [properties])](#module_geojson2h3.h3SetToMultiPolygonFeature) ⇒ Feature @@ -62,7 +62,7 @@ const feature = geojson2h3.h3SetToFeature(hexagons); -### geojson2h3.featureToH3Set(feature, resolution) ⇒ Array.<String> +### geojson2h3.featureToH3Set(feature, resolution, [options]) ⇒ Array.<String> Convert a GeoJSON feature to a set of hexagons. *Only hexagons whose centers fall within the feature will be included.* Note that conversion from GeoJSON is lossy; the resulting hexagon set only approximately describes the original @@ -82,6 +82,7 @@ the `ensureOutput` option. | --- | --- | --- | | feature | Object | Input GeoJSON: type must be either `Feature` or `FeatureCollection`, and geometry type must be either `Polygon` or `MultiPolygon` | | resolution | Number | Resolution of hexagons, between 0 and 15 | +| [options] | Object | Options | | [options.ensureOutput] | Boolean | Whether to ensure that at least one cell is returned in the set | diff --git a/package.json b/package.json index b2b6a5c..89d3606 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "geojson2h3", "description": "Conversion utilities between H3 indexes and GeoJSON", - "version": "1.1.1", + "version": "1.2.0", "author": "Nick Rabinowitz ", "keywords": [ "h3", diff --git a/src/geojson2h3.js b/src/geojson2h3.js index 5fdda6e..89fff93 100644 --- a/src/geojson2h3.js +++ b/src/geojson2h3.js @@ -104,6 +104,7 @@ function featureCollectionToH3Set(featureCollection, resolution) { * `FeatureCollection`, and geometry type must be * either `Polygon` or `MultiPolygon` * @param {Number} resolution Resolution of hexagons, between 0 and 15 + * @param {Object} [options] Options * @param {Boolean} [options.ensureOutput] Whether to ensure that at least one * cell is returned in the set * @return {String[]} H3 indexes