odc.geo.geobox.GeoBox

class odc.geo.geobox.GeoBox(shape, affine, crs)[source]

Defines the location and resolution of a rectangular grid of data, including it’s CRS.

Parameters:
__init__(shape, affine, crs)[source]

Methods

__init__(shape, affine, crs)

boundary([pts_per_side])

Boundary of a GeoBox.

buffered(xbuff[, ybuff])

Produce a tile buffered by xbuff, ybuff (in CRS units).

compute_crop(roi)

compute_zoom_out(factor)

compute_zoom_to([shape, resolution])

Change GeoBox shape.

crop(shape)

Crop or expand to a given shape.

enclosing(region)

Construct compatible geobox covering given region.

expand(shape)

Crop or expand to a given shape.

explore([map, grid_lines, tiles, attr, map_kwds])

Plot a visual representation of the GeoBox's extent on an interactive folium leaflet map.

flipx()

Flip along X axis.

flipy()

Flip along Y axis.

footprint(crs[, buffer, npoints])

Compute footprint in foreign CRS.

from_bbox(bbox[, crs, tight, shape, ...])

Construct GeoBox from a bounding box.

from_geopolygon(geopolygon[, resolution, ...])

Construct GeoBox from a polygon.

from_rio(rdr)

Construct GeoBox from rasterio.

grid_lines([step, mode])

Construct pixel edge aligned grid lines.

is_empty()

Check if geobox is "empty".

map_bounds()

Query bounds in folium/ipyleaflet style.

outline([mode, notch])

overlap_roi(other[, tol])

Compute overlap as ROI.

pad(padx[, pady])

Pad geobox.

pad_wh([alignx, aligny])

Possibly expand GeoBox by a few pixels.

pix2wld(x, y)

project(g)

Map Geometry between world and pixel coords.

qr2sample(n[, padding, with_edges, offset])

Generate quasi-random sample of image locations.

rotate(deg)

Rotate GeoBox around the center.

snap_to(other)

Snap pixel grid to other.

svg([scale_factor, mode, notch, grid_stroke])

Produce SVG paths.

to_crs(crs, *[, resolution, shape, tight, ...])

Compute GeoBox covering the same region in a different projection.

translate_pix(tx, ty)

Shift GeoBox in pixel plane.

wld2pix(x, y)

zoom_out(factor)

Compute GeoBox with changed resolution.

zoom_to([shape, resolution])

Change GeoBox shape.

Attributes

affine

Linear mapping from pixel space to CRS.

alignment

Alignment of pixel boundaries in CRS units.

anchor

Anchor point in pixel coordinates.

aspect

Aspect ratio (X/Y in pixel space).

axis_aligned

Check if Geobox is axis-aligned (not rotated).

bottom

Same size geobox directly below this one.

boundingbox

GeoBox bounding box in the native CRS.

center_pixel

GeoBox of a center pixel.

compat

Convert to datacube.utils.geometry.GeoBox

coordinates

Query coordinates.

coords

Query coordinates.

crs

Coordinate Reference System of the GeoBox.

dimensions

List of dimension names of the GeoBox.

dims

List of dimension names of the GeoBox.

extent

GeoBox footprint in native CRS.

geographic_extent

GeoBox extent in EPSG:4326.

height

Height in pixels (ny).

left

Same size geobox to the left of this one.

linear

resolution

Resolution, pixel size in CRS units.

right

Same size geobox to the right of this one.

shape

Shape in pixels (height, width).

top

Same size geobox directly above this one.

transform

Linear mapping from pixel space to CRS.

width

Width in pixels (nx).