Skip to content

Commit

Permalink
Merge pull request #17 from matthiasfeist/master
Browse files Browse the repository at this point in the history
Added example image to featureToH3Set
  • Loading branch information
nrabinowitz committed Feb 22, 2021
2 parents 14232e9 + f2ec9c2 commit 55733fb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install geojson2h3

## Example Usage

```
```javascript
import geojson2h3 from 'geojson2h3';

const polygon = {
Expand Down Expand Up @@ -57,11 +57,13 @@ const feature = geojson2h3.h3SetToFeature(hexagons);
<a name="module_geojson2h3.featureToH3Set"></a>

### geojson2h3.featureToH3Set(feature, resolution) ⇒ <code>Array.&lt;String&gt;</code>
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 [<code>geojson2h3</code>](#module_geojson2h3)
**Returns**: <code>Array.&lt;String&gt;</code> - H3 indexes

Expand Down
2 changes: 1 addition & 1 deletion doc-files/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install geojson2h3

## Example Usage

```
```javascript
import geojson2h3 from 'geojson2h3';

const polygon = {
Expand Down
Binary file added doc-files/featureToH3Set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/geojson2h3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55733fb

Please sign in to comment.