Bin grid and map grid coordinates¶
P6Parameters holds a grid as P6/11 states
it, and converts in both directions with PROJ’s implementation of the two EPSG
methods (PROJ 9.9 or later). It accepts single points or arrays, the same
shapes that transform() accepts. EPSG’s own
9666 example:
from geodetic_engine.bingrid import Handedness, P6Parameters, corners_from_p6
grid = P6Parameters(
origin_i=1, origin_j=1,
origin_easting=456781.0, origin_northing=5836723.0,
bin_width_i=25.0, bin_width_j=12.5,
bearing_j=20.0, # map grid bearing of the J (crossline) axis
handedness=Handedness.RIGHT, # EPSG method 9666
scale_factor=0.99984,
)
grid.to_map(300, 247)
array([[ 464855.62213482, 5837055.90096488]])
grid.to_bin(464855.62, 5837055.90)
array([[299.99993295, 246.99986903]])
corners = corners_from_p6(grid, inline_range=(1, 301), crossline_range=(1, 401))
corners.coordinates # corners A, B, C, D
array([[ 456781. , 5836723. ],
[ 458490.82710051, 5841420.71134983],
[ 463827.56702475, 5834158.25934923],
[ 465537.39412526, 5838855.97069906]])