hilbert

package
v0.0.0-...-6689d22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package hilbert implements 2D and 3D meshes using the S2 Hilbert curve described at https://s2geometry.io/resources/earthcube.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bounds

type Bounds = s2.Region

Bounds defines the boundaries of the mesh.

func RectBounds

func RectBounds(centerLat, centerLon, sizeLat, sizeLon float64) Bounds

RectBounds creates an approximate rectangular boundary for the mesh.

type Mesh2D

type Mesh2D struct {
	// contains filtered or unexported fields
}

Mesh2D represents a 2D quasi-rectangular mesh.

func NewMesh2D

func NewMesh2D(b Bounds, level int) *Mesh2D

NewMesh2D returns a new 2D mesh at the specified resolution level, approximately covering the area specified by b. Information regarding resolution levels is available at https://s2geometry.io/resources/s2cell_statistics.html.

func (*Mesh2D) Cell

func (m *Mesh2D) Cell(i int) mesh.Cell

Cell returns the cell at the given index (where i < Cells())

func (*Mesh2D) Cells

func (m *Mesh2D) Cells() int

Cells returns the number of cells in this mesh.

func (*Mesh2D) Dims

func (m *Mesh2D) Dims() int

Dims returns that this mesh is 2D.

func (*Mesh2D) Face

func (m *Mesh2D) Face(i int) mesh.Face

Face returns the face at the given index, where i < Faces(). The face has 1 dimension.

func (*Mesh2D) Faces

func (m *Mesh2D) Faces() int

Faces returns the total number of faces in the mesh

func (*Mesh2D) MarshalBinary

func (m *Mesh2D) MarshalBinary() []byte

MarshalBinary serializes this mesh into a byte array.

func (*Mesh2D) PlotBoundaryCells

func (m *Mesh2D) PlotBoundaryCells(p Projection) []plot.XYs

PlotBoundaryCells returns the polygons that make up the mesh boundary cells for plotting with the given projection.

func (*Mesh2D) PlotCells

func (m *Mesh2D) PlotCells(p Projection) []plot.XYs

PlotCells returns the polygons that make up the mesh cells for plotting with the given projection.

func (*Mesh2D) PlotEdges

func (m *Mesh2D) PlotEdges(p Projection) []plot.XYs

PlotEdges returns the lines that make up the mesh edges for plotting with the given projection.

func (*Mesh2D) UnmarshalBinary

func (m *Mesh2D) UnmarshalBinary(b []byte) error

UnmarshalBinary initializes this mesh from a byte array.

type Projection

type Projection = s2.Projection

A Projection maps the spherical geometry to planar coordinates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL