From 85e8782ae7fb58e61f51d0e607ed4a850050beb5 Mon Sep 17 00:00:00 2001
From: josidd <joseph.siddons@noc.ac.uk>
Date: Thu, 10 Oct 2024 10:06:52 +0100
Subject: [PATCH] fix: edge_dist should check north/south not east/west for
 crossing equator

---
 GeoSpatialTools/octtree.py  | 2 +-
 GeoSpatialTools/quadtree.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/GeoSpatialTools/octtree.py b/GeoSpatialTools/octtree.py
index 4aafebe..0029986 100644
--- a/GeoSpatialTools/octtree.py
+++ b/GeoSpatialTools/octtree.py
@@ -178,7 +178,7 @@ class SpaceTimeRectangle:
             haversine(self.lon, self.lat, self.east, self.north),
             haversine(self.lon, self.lat, self.east, self.south),
         )
-        if self.east * self.west < 0:
+        if self.north * self.south < 0:
             corner_dist = max(
                 corner_dist,
                 haversine(self.lon, self.lat, self.east, 0),
diff --git a/GeoSpatialTools/quadtree.py b/GeoSpatialTools/quadtree.py
index ef50d30..1bf7e7d 100644
--- a/GeoSpatialTools/quadtree.py
+++ b/GeoSpatialTools/quadtree.py
@@ -151,7 +151,7 @@ class Rectangle:
             haversine(self.lon, self.lat, self.east, self.north),
             haversine(self.lon, self.lat, self.east, self.south),
         )
-        if self.east * self.west < 0:
+        if self.north * self.south < 0:
             corner_dist = max(
                 corner_dist,
                 haversine(self.lon, self.lat, self.east, 0),
-- 
GitLab