# geo.h3

Working with H3.

### compact

`(compact cells)`

Given a set of H3 cells, return a compacted set of cells, at possibly coarser resolutions.

### edge-length

`(edge-length res)`

`(edge-length res unit)`

Average edge length for indices at resolution 'res.' Optional second argument allows returning length in :m or :km. Defaults to m.

### geo-coords

`(geo-coords s)`

Return all coordinates for a given Shapelike as GeoCoords

### get-resolution-long

`(get-resolution-long h)`

Long helper to return the resolution of a cell.

### h3-inst

### H3Index

#### protocol

#### members

### edge

`(edge from to)`

Given both 'from' and 'to' cells, get a unidirectional edge index.

### edge-boundary

`(edge-boundary this)`

Get coordinates representing the edge.

### edge-destination

`(edge-destination this)`

Given a unidirectional edge, get its destination.

### edge-origin

`(edge-origin this)`

Given a unidirectional edge, get its origin.

### edges

`(edges this)`

Get all edges originating from an index.

### get-resolution

`(get-resolution this)`

Return the resolution of a cell.

### h3->pt

`(h3->pt this)`

Return a GeoCoord of the center point of a cell.

### h3-distance

`(h3-distance this cell)`

Return the grid distance, which is the distance expressed in number of cells.

### is-valid?

`(is-valid? this)`

Check if an index is valid.

### k-ring

`(k-ring this k)`

Return a list of neighboring indices in all directions for 'k' rings.

### k-ring-distances

`(k-ring-distances this k)`

Return a list of neighboring indices in all directions for 'k' rings, ordered by distance from the origin index.

### neighbors?

`(neighbors? this cell)`

Check if two indexes are neighbors.

### pentagon?

`(pentagon? this)`

Check if an index is a pentagon.

### to-jts

`(to-jts this)`

Given an H3 identifier, return a Polygon of that cell.

### to-long

`(to-long this)`

Return index as a long.

### to-string

`(to-string this)`

Return index as a string.

### hex-area

`(hex-area res)`

`(hex-area res unit)`

Average area for indices at resolution 'res.' Optional second argument allows returning area in :m2 or :km2. Defaults to m2.

### multi-polygon

`(multi-polygon cells)`

Given a contiguous set of H3 cells, return a JTS MultiPolygon.

### Polygonal

#### protocol

#### members

### polyfill

`(polyfill this res)`

Return all resolution 'res' cells in Long form that cover a given Shapelike, excluding internal holes. If the set of cells is especially large, the set may return partially compacted.

### polyfill-address

`(polyfill-address this res)`

Return all resolution 'res' cells in String form that cover a given Shapelike, excluding internal holes. If the set of cells is especially large, the set may return partially compacted.

### to-polygon

`(to-polygon this)`

`(to-polygon this srid)`

Ensure that an object is 2D, with lineal boundaries.

### pt->h3

`(pt->h3 pt res)`

`(pt->h3 lat lng res)`

Return the Long index of the resolution 'res' cell that a point or lat/lng pair is contained within.

### pt->h3-address

`(pt->h3-address pt res)`

`(pt->h3-address lat lng res)`

Return the String index of the resolution 'res' cell that a point or lat/lng pair is contained within.

### safe-polyfill-hexagon-maximum

Lowering this will reduce the likelihood of H3's polyfill crashing, but will cause this library's polyfill to run more slowly due to more frequent subdivision

### safe-uncompact-hexagon-maximum

Lowering this will reduce the likelihood of this library's internal safe-uncompact throwing a heap error, but will make this library's polyfill more likely to return an uncompacted set

### uncompact

`(uncompact cells res)`

Given a set of H3 cells, return an uncompacted set of cells to a certain resolution.