raster

package
v0.0.0-...-d99e8d0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Package raster provides support for reading and creating various common geospatial raster data formats.

Index

Constants

View Source
const (
	DT_INT8 = iota
	DT_UINT8
	DT_INT16
	DT_UINT16
	DT_INT32
	DT_UINT32
	DT_INT64
	DT_UINT64
	DT_FLOAT32
	DT_FLOAT64
	DT_RGB24
	DT_RGB48
	DT_RGBA32
	DT_RGBA64
	DT_PALETTED
)

Data Type

Variables

View Source
var DataSetError = errors.New("An error occurred while setting the data.")
View Source
var FileDeletingError = errors.New("There were problems deleting the file.")
View Source
var FileDoesNotExistError = errors.New("The file does not exist.")
View Source
var FileIsNotProperlyFormated = errors.New("The file does not appear to be properly formated")
View Source
var FileOpeningError = errors.New("An error occurred while opening the data file.")
View Source
var FileReadingError = errors.New("An error occurred while reading the data file.")
View Source
var FileWritingError = errors.New("An error occurred while writing the data file.")
View Source
var MultipleRasterFormatError = errors.New("There are multiple possible raster formats for this file.")
View Source
var RasterInitializationError = errors.New("An error occurred while initializing the raster.")
View Source
var UnsupportedRasterFormatError = errors.New("Unsupported raster format.")

Functions

func GetMapOfFormatsAndExtensions

func GetMapOfFormatsAndExtensions() map[string][]string

func IsSupportedRasterFileExtension

func IsSupportedRasterFileExtension(fileName string) (ret bool)

func ListAllSupportedRasterFormats

func ListAllSupportedRasterFormats() []string

String returns the English name of the RasterType ("ArcGisBinaryRaster", "ArcGisAsciiRaster", ...).

Types

type Raster

type Raster struct {
	Rows, Columns            int
	NumberofCells            int
	North, South, East, West float64
	NoDataValue              float64
	FileName                 string
	FileExtension            string
	RasterFormat             RasterType
	ByteOrder                binary.ByteOrder
	// contains filtered or unexported fields
}

func CreateNewRaster

func CreateNewRaster(fileName string, rows int, columns int, north float64,
	south float64, east float64, west float64, config ...*RasterConfig) (*Raster, error)

func CreateRasterFromFile

func CreateRasterFromFile(fileName string, config ...RasterConfig) (*Raster, error)

func (*Raster) AddMetadataEntry

func (r *Raster) AddMetadataEntry(value string)

func (*Raster) Data

func (r *Raster) Data() ([]float64, error)

Returns the data as a slice of float64 values

func (*Raster) GetCellSizeX

func (r *Raster) GetCellSizeX() (cellSizeX float64)

func (*Raster) GetCellSizeY

func (r *Raster) GetCellSizeY() (cellSizeY float64)

func (*Raster) GetMaximumValue

func (r *Raster) GetMaximumValue() float64

func (*Raster) GetMetadataEntries

func (r *Raster) GetMetadataEntries() []string

func (*Raster) GetMinimumValue

func (r *Raster) GetMinimumValue() float64

func (*Raster) GetRasterConfig

func (r *Raster) GetRasterConfig() *RasterConfig

Gets the raster config

func (*Raster) IsInGeographicCoordinates

func (r *Raster) IsInGeographicCoordinates() bool

func (*Raster) Save

func (r *Raster) Save() (err error)

func (*Raster) SetData

func (r *Raster) SetData(values []float64)

Sets the data from a slice of float64 values

func (*Raster) SetDisplayMaximum

func (r *Raster) SetDisplayMaximum(value float64)

func (*Raster) SetDisplayMinimum

func (r *Raster) SetDisplayMinimum(value float64)

func (*Raster) SetRasterConfig

func (r *Raster) SetRasterConfig(value *RasterConfig)

Sets the raster config

func (*Raster) SetRowValues

func (r *Raster) SetRowValues(row int, values []float64)

Sets an a row of pixel value in the grid.

func (*Raster) SetValue

func (r *Raster) SetValue(row, column int, value float64)

Sets an individual pixel value in the grid.

func (*Raster) Value

func (r *Raster) Value(row, column int) float64

Retrives an individual pixel value in the grid.

type RasterConfig

type RasterConfig struct {
	NoDataValue               float64
	InitialValue              float64
	RasterFormat              RasterType
	ByteOrder                 binary.ByteOrder
	MetadataEntries           []string
	CoordinateRefSystemWKT    string
	NumberOfBands             int
	PhotometricInterpretation int
	DataType                  int
	PaletteNonlinearity       float64
	ZUnits                    string
	XYUnits                   string
	PreferredPalette          string
	DisplayMinimum            float64
	DisplayMaximum            float64
	ReflectAtBoundaries       bool
	PixelIsArea               bool
	EPSGCode                  int
}

func NewDefaultRasterConfig

func NewDefaultRasterConfig() *RasterConfig

func (RasterConfig) String

func (h RasterConfig) String() string

type RasterType

type RasterType int

RasterType is used to specify a data format of a raster file

const (
	RT_UnknownRaster      RasterType = 0
	RT_ArcGisBinaryRaster RasterType = iota
	RT_ArcGisAsciiRaster
	RT_GeoTiff
	RT_WhiteboxRaster
	RT_GrassAsciiRaster
	RT_SurferAsciiRaster
	RT_SagaRaster
	RT_IdrisiRaster
)

Integer constants used to specify each of the supported raster formats

func DetermineRasterFormat

func DetermineRasterFormat(fileName string) (rt RasterType, err error)

Attempts to determine the raster format from the filename.

func (RasterType) GetExtensions

func (rt RasterType) GetExtensions() []string

Returns a list of the file extensions associated with a particular raster format.

func (RasterType) String

func (rt RasterType) String() string

String returns the English name of the RasterType ("ArcGisBinaryRaster", "ArcGisAsciiRaster", ...).

Directories

Path Synopsis
lzw
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.

Jump to

Keyboard shortcuts

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