Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

core.raster.read (procNode)

Read a layer of a raster as a column over the field's cells, x fastest then z, each cell optionally taken from a neighbour a whole number of cells away; a read past the edge answers the edge cell.

Built from core.raster.cells and the gather kernel.

Inputs

  • raster (Raster). The raster read.
  • layer (String). Default "height". The layer read.
  • dx (Number). Default 0. Cells along x the read is offset by.
  • dz (Number). Default 0. Cells along z the read is offset by.
  • held (Bool). Default false. Read every cell the tiles hold, the cells past the field included, rather than the cells of the field.

Outputs

  • value: a Float column over the field's cells, or over the held cells.
  • count: the cells read.

Example

local raster = g.core.raster.new({ size = { x = 8, z = 8 }, resolution = 1, layers = { "height" } })
local heights = g.core.raster.read({ raster = raster, layer = "height", dx = 1 })

A Float column of the 64 cells, each read from its neighbour along x.