breaking: Do not project Arome.tryFind
Do that with tryFindWithProj, where you give the projection yourself, instead.
This commit is contained in:
13
src/Arome.fs
13
src/Arome.fs
@@ -106,17 +106,16 @@ let tryFindIndex squareSize (wide, tall) (minX, minY) (maxX, maxY) (p0, p1) =
|
||||
None
|
||||
|
||||
/// Tries to get the closest x and y in the arome dataset based on position p
|
||||
let tryFind (grid: SquareGrid) (p0: float, p1: float) : (int * int) option =
|
||||
let min = (grid.BBox.minX, grid.BBox.minY)
|
||||
let max = (grid.BBox.maxX, grid.BBox.maxY)
|
||||
let p = trans.project ((p0, p1))
|
||||
let tryFind (grid: SquareGrid) (p: float * float) : (int * int) option =
|
||||
let min = grid.BBox.minX, grid.BBox.minY
|
||||
let max = grid.BBox.maxX, grid.BBox.maxY
|
||||
|
||||
tryFindIndex grid.squareSize grid.dimensions min max p
|
||||
|
||||
let tryFindWithProj (grid: SquareGrid) proj (p0: float, p1: float) : (int * int) option =
|
||||
let trans = Transform.makeTransform proj grid.projection
|
||||
let min = (grid.BBox.minX, grid.BBox.minY)
|
||||
let max = (grid.BBox.maxX, grid.BBox.maxY)
|
||||
let trans = makeTransform proj grid.projection
|
||||
let min = grid.BBox.minX, grid.BBox.minY
|
||||
let max = grid.BBox.maxX, grid.BBox.maxY
|
||||
let p = trans.project ((p0, p1))
|
||||
|
||||
tryFindIndex grid.squareSize grid.dimensions min max p
|
||||
Reference in New Issue
Block a user