convert_bin_grid¶
- geodetic_engine.bingrid.convert_bin_grid(corners, crs, *, target_crs=None, operation=None, scale_factor=None, increment_i=1, increment_j=1, wgs84=True, wgs84_operation=None, coordinate_epoch=None)[source]¶
Check a four-corner bin grid, optionally convert it, and square it up.
- Parameters:
corners (
BinGridCorners|Iterable[BinGridCorner|tuple[int,int,float,float]]) – The four corners, in any order.crs (
Any) – CRS the corners’ coordinates are in; anythingfrom_user_input()accepts. Must be projected, optionally bound.target_crs (
Any, default:None) – CRS to convert the grid to. Omitted, or on the same map grid ascrs– the same datum, projection and linear unit, whatever the axis order and whether or not either is bound – the grid is squared up where it is; a boundtarget_crsthen names the operation to WGS 84, an unbound one leaves the grid’s own CRS in place.operation (
Any, default:None) – Coordinate operation for the conversion totarget_crs, asTransformationtakes it. Needed when the conversion changes datum and neither CRS is bound.scale_factor (
float|None, default:None) – Bin grid scale factor of the squared grid. Omitted, it is the point scale factor of the CRS the grid is squared in, at the grid centre (point_scale_factor), so that the bin widths are the ground spacing of the bins there. Required where that CRS’s projection is not conformal at the grid, or its geographic CRS states its axes in different units.increment_i (
int, default:1) – Inline node increment.increment_j (
int, default:1) – Crossline node increment.wgs84 (
bool, default:True) – Whether to also give the squared corners in WGS 84.wgs84_operation (
Any, default:None) – Coordinate operation to WGS 84, when the grid’s CRS does not state one.coordinate_epoch (
float|None, default:None) – Decimal year the coordinates were observed at, for a conversion whose operation reads it, astransform()takes it.
- Return type:
- Returns:
The squared grid with its provenance.
- Raises:
InvalidCornersError – If the corners are not those of a bin grid, or their spans are not multiples of the node increments.
DegenerateBinGridError – If their coordinates cannot be.
InvalidParameterError – If a parameter is out of range.
UnsupportedCRSError – If a CRS cannot carry a bin grid, or
scale_factoris omitted and cannot be derived: the projection is not conformal at the grid, or its geographic CRS states its axes in different units.ValueError – If
operationis given without a conversion to apply it to, orwgs84_operationwithwgs84=False.geodetic_engine.geodesy.GeodesyError – If a conversion cannot be resolved or applied, for example a datum change that names no operation.