Skip to content

read_jpeg builtin

read_jpeg(path, *, length_unit=None)

Reads a georeferenced JPEG as a 2D BlockModel.

Parameters:

Name Type Description Default
path str or Path

A .jpg or .jpeg with a world file of the same stem (.jgw, else .wld) and optionally a <path>.aux.xml sidecar holding the CRS.

required

Returns:

Type Description
BlockModel

A regular grid with nz = 1: one float64 column band_1 for grayscale, band_1 to band_3 (red, green, blue) otherwise, values 0 to 255 and never null. The world file gives the pixel size, the rotation (as azimuth) and the center of the top-left pixel; the sidecar's SRS is the CRS.

Raises:

Type Description
InvalidInput

Without a world file, or for skewed or mirrored world files.

Used in