Documentation ¶
Overview ¶
Package hilbert implements 2D and 3D meshes using the S2 Hilbert curve described at https://s2geometry.io/resources/earthcube.
Index ¶
- type Bounds
- type Mesh2D
- func (m *Mesh2D) Cell(i int) mesh.Cell
- func (m *Mesh2D) Cells() int
- func (m *Mesh2D) Dims() int
- func (m *Mesh2D) Face(i int) mesh.Face
- func (m *Mesh2D) Faces() int
- func (m *Mesh2D) MarshalBinary() []byte
- func (m *Mesh2D) PlotBoundaryCells(p Projection) []plot.XYs
- func (m *Mesh2D) PlotCells(p Projection) []plot.XYs
- func (m *Mesh2D) PlotEdges(p Projection) []plot.XYs
- func (m *Mesh2D) UnmarshalBinary(b []byte) error
- type Projection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
Bounds defines the boundaries of the mesh.
func RectBounds ¶
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 ¶
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) Face ¶
Face returns the face at the given index, where i < Faces(). The face has 1 dimension.
func (*Mesh2D) MarshalBinary ¶
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 ¶
UnmarshalBinary initializes this mesh from a byte array.
type Projection ¶
type Projection = s2.Projection
A Projection maps the spherical geometry to planar coordinates.