Documentation ¶
Overview ¶
Package pixweight associates a pixelation raster value with a normalized weight (between 0 and 1) for a pixel.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pixel ¶
type Pixel map[int]weight
Pixel is a set of normalized weights (a value between 0 and 1) for the values given to a pixel.
Each pixel is assumed to be independent of all other pixels.
func New ¶
func New() Pixel
New creates a new Pixel object to store normalized weight from pixel types.
By default, the ID 0 is defined with weight 0.
func ReadTSV ¶
ReadTSV reads a TSV file used to define the normalized weight values for a given set of pixels values in a pixelation.
The pixel weight file is a tab-delimited file with the following columns:
-key the value used as identifier -weight the normalized weight for a pixel with that value
Any other columns, will be ignored. Here is an example of a pixel weight file:
key weight comment 0 0.000000 deep ocean 1 0.010000 oceanic plateaus 2 0.050000 continental shelf 3 0.950000 lowlands 4 1.000000 highlands 5 0.001000 ice sheets