Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark committed Dec 10, 2023
1 parent 7810171 commit 2c5c2cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions martin-tile-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ pub fn bbox_to_xyz(
zoom: u8,
schema: YSchema,
) -> (u32, u32, u32, u32) {
let (min_x, min_y) = tile_index(left, top, zoom, schema);
let (max_x, max_y) = tile_index(right, bottom, zoom, schema);
let (min_x, min_y) = tile_index(left, bottom, zoom, schema);
let (max_x, max_y) = tile_index(right, top, zoom, schema);
(min_x, min_y, max_x, max_y)
}

Expand Down Expand Up @@ -340,7 +340,7 @@ mod tests {
assert_relative_eq!(bbox[2], 180.0, epsilon = f64::EPSILON * 2.0);
assert_relative_eq!(bbox[3], 85.0511287798066, epsilon = f64::EPSILON * 2.0);

let xyz = bbox_to_xyz(bbox[0], bbox[1], bbox[2], bbox[3], 0, YSchema::Xyz);
let xyz = bbox_to_xyz(bbox[0], bbox[1], bbox[2], bbox[3], 0, YSchema::Tms);
assert_eq!(xyz, (0, 0, 0, 0));

let bbox = xyz_to_bbox(1, 0, 0, 0, 0);
Expand Down Expand Up @@ -370,7 +370,7 @@ mod tests {
assert_relative_eq!(bbox[3], -74.01954331150226, epsilon = f64::EPSILON * 2.0);

// Fixme: These are totally wrong
let xyz = bbox_to_xyz(bbox[0], bbox[1], bbox[2], bbox[3], 5, YSchema::Xyz);
let xyz = bbox_to_xyz(bbox[0], bbox[1], bbox[2], bbox[3], 5, YSchema::Tms);
assert_eq!(xyz, (1, 3, 2, 5));
}

Expand Down

0 comments on commit 2c5c2cd

Please sign in to comment.