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:
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".
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
Linear mapping from pixel space to CRS.
alignment
Alignment of pixel boundaries in CRS units.
Anchor point in pixel coordinates.
Aspect ratio (X/Y in pixel space).
axis_aligned
Check if Geobox is axis-aligned (not rotated).
Same size geobox directly below this one.
GeoBox bounding box in the native CRS.
center_pixel
GeoBox of a center pixel.
compat
Convert to
datacube.utils.geometry.GeoBox
Query coordinates.
coords
Query coordinates.
Coordinate Reference System of the GeoBox.
List of dimension names of the GeoBox.
List of dimension names of the GeoBox.
GeoBox footprint in native CRS.
GeoBox extent in EPSG:4326.
Height in pixels (ny).
Same size geobox to the left of this one.
linear
Resolution, pixel size in CRS units.
Same size geobox to the right of this one.
Shape in pixels
(height, width)
.Same size geobox directly above this one.
Linear mapping from pixel space to CRS.
Width in pixels (nx).