raster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllIterator

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

func NewAllIterator

func NewAllIterator(r *Raster) *AllIterator

func (*AllIterator) Error

func (it *AllIterator) Error() error

func (*AllIterator) Get

func (it *AllIterator) Get() *Cell

func (*AllIterator) Next

func (it *AllIterator) Next() bool

type Bitmap

type Bitmap struct {
	Data  []bool
	Xsize int
	Ysize int
	Size  int
}

func NewBitmap

func NewBitmap(xsize, ysize int) *Bitmap

func NewBitmapWithRaster

func NewBitmapWithRaster(r *Raster) *Bitmap

func (*Bitmap) Get

func (bm *Bitmap) Get(x, y int) bool

func (*Bitmap) GetWithCell

func (bm *Bitmap) GetWithCell(c *Cell) bool

func (*Bitmap) IsInRegion

func (bm *Bitmap) IsInRegion(x, y int) bool

func (*Bitmap) Set

func (bm *Bitmap) Set(x, y int)

func (*Bitmap) SetWithCell

func (bm *Bitmap) SetWithCell(c *Cell)

func (*Bitmap) String

func (bm *Bitmap) String() string

func (*Bitmap) Unset

func (bm *Bitmap) Unset(x, y int)

func (*Bitmap) UnsetWithCell

func (bm *Bitmap) UnsetWithCell(c *Cell)

type BorderIterator

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

func NewBorderIterator

func NewBorderIterator(r *Raster) *BorderIterator

func (*BorderIterator) Error

func (it *BorderIterator) Error() error

func (*BorderIterator) Get

func (it *BorderIterator) Get() *Cell

func (*BorderIterator) Next

func (it *BorderIterator) Next() bool

type Cell

type Cell struct {
	Value  *float64
	Xindex int
	Yindex int
}

func (*Cell) EdgeDirection

func (c *Cell) EdgeDirection(r *Raster) Direction

func (*Cell) GetValue

func (c *Cell) GetValue() float64

func (*Cell) RelativeDirection

func (c *Cell) RelativeDirection(neighbor *Cell) Direction

func (*Cell) SetValue

func (c *Cell) SetValue(val float64)

type Direction

type Direction int
const (
	None        Direction = 0
	Right       Direction = 1
	BottomRight Direction = 2
	Bottom      Direction = 4
	BottomLeft  Direction = 8
	Left        Direction = 16
	TopLeft     Direction = 32
	Top         Direction = 64
	TopRight    Direction = 128
)

func (Direction) IsDiagonal

func (d Direction) IsDiagonal() bool

type InnerRegionIterator

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

func NewInnerRegionIterator

func NewInnerRegionIterator(r *Raster) *InnerRegionIterator

func (*InnerRegionIterator) Error

func (it *InnerRegionIterator) Error() error

func (*InnerRegionIterator) Get

func (it *InnerRegionIterator) Get() *Cell

func (*InnerRegionIterator) Next

func (it *InnerRegionIterator) Next() bool

type Intmap

type Intmap struct {
	Data  []int
	Xsize int
	Ysize int
	Size  int
}

func NewIntmap

func NewIntmap(xsize, ysize int) *Intmap

func NewIntmapWithRaster

func NewIntmapWithRaster(r *Raster) *Intmap

func (*Intmap) Get

func (bm *Intmap) Get(x, y int) int

func (*Intmap) GetWithCell

func (bm *Intmap) GetWithCell(c *Cell) int

func (*Intmap) IsInRegion

func (bm *Intmap) IsInRegion(x, y int) bool

func (*Intmap) Set

func (bm *Intmap) Set(x, y, val int)

func (*Intmap) SetWithCell

func (bm *Intmap) SetWithCell(c *Cell, val int)

func (*Intmap) String

func (bm *Intmap) String() string

type Iterator

type Iterator interface {
	Next() bool
	Get() *Cell
	Error() error
}

type NeighborIterator

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

func NewNeighborIterator

func NewNeighborIterator(r *Raster, xCenter int, yCenter int) *NeighborIterator

func NewNeighborIteratorWithCell

func NewNeighborIteratorWithCell(r *Raster, c *Cell) *NeighborIterator

func (*NeighborIterator) Error

func (it *NeighborIterator) Error() error

func (*NeighborIterator) Get

func (it *NeighborIterator) Get() *Cell

func (*NeighborIterator) Next

func (it *NeighborIterator) Next() bool

type Raster

type Raster struct {
	Data      []float64
	Xsize     int
	Ysize     int
	Size      int
	CellXSize float64
	CellYSize float64
	Nodata    float64
}

func CopyRaster

func CopyRaster(r *Raster) *Raster

func NewRaster

func NewRaster(xsize, ysize int, cellXSize, cellYSize, noData float64) *Raster

func NewRasterWithRaster

func NewRasterWithRaster(r *Raster) *Raster

func (*Raster) Get

func (r *Raster) Get(x, y int) float64

func (*Raster) GetWithCell

func (r *Raster) GetWithCell(c *Cell) float64

func (*Raster) IsInRegion

func (r *Raster) IsInRegion(x, y int) bool

func (*Raster) Set

func (r *Raster) Set(x, y int, val float64)

func (*Raster) SetWithCell

func (r *Raster) SetWithCell(c *Cell, val float64)

func (*Raster) String

func (r *Raster) String() string

Jump to

Keyboard shortcuts

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