diff --git a/README.md b/README.md index f300a19..a3d5f39 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ npm install geojson2h3 ## Example Usage -``` +```javascript import geojson2h3 from 'geojson2h3'; const polygon = { @@ -57,11 +57,13 @@ const feature = geojson2h3.h3SetToFeature(hexagons); ### geojson2h3.featureToH3Set(feature, resolution) ⇒ 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 +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 shape, at a level of precision determined by the hexagon resolution. +![featureToH3Set](./doc-files/featureToH3Set.png) + **Kind**: static method of [geojson2h3](#module_geojson2h3) **Returns**: Array.<String> - H3 indexes diff --git a/doc-files/README.md.tmpl b/doc-files/README.md.tmpl index 4f94d47..f89fb8b 100644 --- a/doc-files/README.md.tmpl +++ b/doc-files/README.md.tmpl @@ -15,7 +15,7 @@ npm install geojson2h3 ## Example Usage -``` +```javascript import geojson2h3 from 'geojson2h3'; const polygon = { diff --git a/doc-files/featureToH3Set.png b/doc-files/featureToH3Set.png new file mode 100644 index 0000000..239cf35 Binary files /dev/null and b/doc-files/featureToH3Set.png differ diff --git a/src/geojson2h3.js b/src/geojson2h3.js index 05ac86b..6dc61a1 100644 --- a/src/geojson2h3.js +++ b/src/geojson2h3.js @@ -69,10 +69,12 @@ function featureCollectionToH3Set(featureCollection, resolution) { // Public API functions /** - * 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 + * 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 * shape, at a level of precision determined by the hexagon resolution. + * + * ![featureToH3Set](./doc-files/featureToH3Set.png) * @static * @param {Object} feature Input GeoJSON: type must be either `Feature` or * `FeatureCollection`, and geometry type must be