Documentation
¶
Index ¶
- Constants
- type Batch
- type Cell
- func (c Cell) ChildPos(res int, opts ...OptionsFunc) int
- func (c Cell) ChildPosToCell(pos, res int, opts ...OptionsFunc) Cell
- func (c Cell) Children(resolution int, opts ...OptionsFunc) []Cell
- func (c Cell) DirectedEdge(other Cell, opts ...OptionsFunc) DirectedEdge
- func (c Cell) DirectedEdges(opts ...OptionsFunc) []DirectedEdge
- func (c Cell) ImmediateChildren(opts ...OptionsFunc) []Cell
- func (c Cell) ImmediateParent(opts ...OptionsFunc) Cell
- func (c Cell) IsNeighbor(other Cell, opts ...OptionsFunc) bool
- func (c Cell) IsPentagon(opts ...OptionsFunc) bool
- func (c Cell) IsValid(opts ...OptionsFunc) bool
- func (c Cell) LatLng(opts ...OptionsFunc) LatLng
- func (c Cell) Parent(resolution int, opts ...OptionsFunc) Cell
- func (c Cell) Resolution(opts ...OptionsFunc) int
- func (c Cell) String() string
- type CellBoundary
- type DirectedEdge
- type GeoLoop
- type H3Index
- type LatLng
- type Options
- type OptionsFunc
Examples ¶
Constants ¶
const ( // MaxCellBndryVerts is the maximum number of vertices that can be used // to represent the shape of a cell. MaxCellBndryVerts = ch3.DMAX_CELL_BNDRY_VERTS )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) CellToLatLng ¶
CellToLatLng returns the geographic centerpoint of a Cell.
type Cell ¶
type Cell uint64
Cell is an Index that identifies a single hexagon cell at a resolution.
func LatLngToCell ¶
func LatLngToCell(latLng LatLng, resolution int, opts ...OptionsFunc) Cell
LatLngToCell returns the Cell at resolution for a geographic coordinate.
Example ¶
package main import ( "fmt" h3 "github.com/akhenakh/goh3" ) func main() { latLng := h3.NewLatLng(37.775938728915946, -122.41795063018799) resolution := 9 c := h3.LatLngToCell(latLng, resolution) fmt.Printf("%s", c) }
Output: 8928308280fffff
func (Cell) ChildPos ¶
func (c Cell) ChildPos(res int, opts ...OptionsFunc) int
ChildPos returns the position of the cell within an ordered list of all children of the cell's parent at the specified resolution res.
func (Cell) ChildPosToCell ¶
func (c Cell) ChildPosToCell(pos, res int, opts ...OptionsFunc) Cell
ChildPosToCell returns the child cell at a given position within an ordered list of all children at the specified resolution res.
func (Cell) Children ¶
func (c Cell) Children(resolution int, opts ...OptionsFunc) []Cell
Children returns the children or grandchildren cells of this Cell.
func (Cell) DirectedEdge ¶
func (c Cell) DirectedEdge(other Cell, opts ...OptionsFunc) DirectedEdge
DirectedEdge returns a DirectedEdge from this Cell to other.
func (Cell) DirectedEdges ¶
func (c Cell) DirectedEdges(opts ...OptionsFunc) []DirectedEdge
DirectedEdges returns 6 directed edges with h as the origin.
func (Cell) ImmediateChildren ¶
func (c Cell) ImmediateChildren(opts ...OptionsFunc) []Cell
ImmediateChildren returns the children or grandchildren cells of this Cell.
func (Cell) ImmediateParent ¶
func (c Cell) ImmediateParent(opts ...OptionsFunc) Cell
Parent returns the parent or grandparent Cell of this Cell.
func (Cell) IsNeighbor ¶
func (c Cell) IsNeighbor(other Cell, opts ...OptionsFunc) bool
IsNeighbor returns true if this Cell is a neighbor of the other Cell.
func (Cell) IsPentagon ¶
func (c Cell) IsPentagon(opts ...OptionsFunc) bool
IsPentagon returns true if this is a pentagon.
func (Cell) IsValid ¶
func (c Cell) IsValid(opts ...OptionsFunc) bool
IsValid returns if a Cell is a valid cell (hexagon or pentagon).
func (Cell) LatLng ¶
func (c Cell) LatLng(opts ...OptionsFunc) LatLng
LatLng returns the Cell at resolution for a geographic coordinate.
func (Cell) Parent ¶
func (c Cell) Parent(resolution int, opts ...OptionsFunc) Cell
Parent returns the parent or grandparent Cell of this Cell.
func (Cell) Resolution ¶
func (c Cell) Resolution(opts ...OptionsFunc) int
type CellBoundary ¶
type CellBoundary []LatLng
CellBoundary is a slice of LatLng. Note, len(CellBoundary) will never exceed MaxCellBndryVerts.
type DirectedEdge ¶
type DirectedEdge int64
func (DirectedEdge) Boundary ¶
func (e DirectedEdge) Boundary(opts ...OptionsFunc) CellBoundary
Boundary provides the coordinates of the boundary of the directed edge. Note, the type returned is CellBoundary, but the coordinates will be from the center of the origin to the center of the destination. There may be more than 2 coordinates to account for crossing faces.
func (DirectedEdge) Cells ¶
func (e DirectedEdge) Cells(opts ...OptionsFunc) []Cell
Cells returns the origin and destination cells in that order.
func (DirectedEdge) Destination ¶
func (e DirectedEdge) Destination(opts ...OptionsFunc) Cell
Destination returns the destination cell of this directed edge.
func (DirectedEdge) IsValid ¶
func (e DirectedEdge) IsValid(opts ...OptionsFunc) bool
func (DirectedEdge) Origin ¶
func (e DirectedEdge) Origin(opts ...OptionsFunc) Cell
Origin returns the origin cell of this directed edge.
type LatLng ¶
type LatLng struct {
Lat, Lng float64
}
LatLng is a struct for geographic coordinates in degrees.
func CellToLatLng ¶
func CellToLatLng(c Cell, opts ...OptionsFunc) LatLng
CellToLatLng returns the geographic centerpoint of a Cell.
type OptionsFunc ¶
type OptionsFunc func(*Options)
func WithTLS ¶
func WithTLS(tls *libc.TLS) OptionsFunc
WithMultipleFences enable multi fences in responses