Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added example image to featureToH3Set #17

Merged
merged 5 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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