Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
revert GCJ-02 to WGS84
  • Loading branch information
ringsaturn committed Apr 12, 2024
1 parent c853299 commit 6fdfcdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ mod tests {
assert_eq!(finder.get_tz_name(-73.7729, 38.3530), "Etc/GMT+5");
assert_eq!(finder.get_tz_name(114.1594, 22.3173), "Asia/Hong_Kong");

// Shenzhen actually, but we used a simplified polygon data.
assert_eq!(finder.get_tz_name(114.0668, 22.5153), "Asia/Hong_Kong");
// Original GCJ-02 coordinates: [114.0668, 22.5153], which is in Shenzhen, China,
// and very close to the border with Hong Kong.
// Revert it to WGS-84 coordinates to get the correct timezone.
assert_eq!(finder.get_tz_name(114.0617, 22.5180), "Asia/Shanghai");

assert_eq!(
finder.get_tz_name(12.452_899_553_691_935, 41.903_699_636_969_634),
Expand Down

0 comments on commit 6fdfcdb

Please sign in to comment.