// Path: src/org/openstreetmap/josm/plugins/tracer/connectways/LatLonSize.java
// public class LatLonSize {
//     private final double m_lat;
//     private final double m_lon;
// 
//     public LatLonSize(double lat, double lon) {
//         m_lat = lat;
//         m_lon = lon;
//     }
// 
//     public double latSize() {
//         return m_lat;
//     }
// 
//     public double lonSize() {
//         return m_lon;
//     }
// 
//     public boolean isZero() {
//         return m_lat == 0 && m_lon == 0;
//     }
// 
//     public static final LatLonSize Zero = new LatLonSize(0, 0);
// 
//     public static LatLonSize get(LatLon ll, double radius_in_meters) {
//         double meters_per_degree_lat = GeomUtils.getMetersPerDegreeOfLatitude(ll);
//         double meters_per_degree_lon = GeomUtils.getMetersPerDegreeOfLongitude(ll);
//         double radius_lat = radius_in_meters / meters_per_degree_lat;
//         double radius_lon = radius_in_meters / meters_per_degree_lon;
//         return new LatLonSize(radius_lat, radius_lon);
//     }
// 
//     public static LatLonSize get(BBox box, double radius_in_meters) {
//         double meters_per_degree_lat1 = GeomUtils.getMetersPerDegreeOfLatitude(box.getTopLeft());
//         double meters_per_degree_lon1 = GeomUtils.getMetersPerDegreeOfLongitude(box.getTopLeft());
//         double meters_per_degree_lat2 = GeomUtils.getMetersPerDegreeOfLatitude(box.getBottomRight());
//         double meters_per_degree_lon2 = GeomUtils.getMetersPerDegreeOfLongitude(box.getBottomRight());
//         double radius_lat = radius_in_meters / Math.min(meters_per_degree_lat1, meters_per_degree_lat2);
//         double radius_lon = radius_in_meters / Math.min(meters_per_degree_lon1, meters_per_degree_lon2);
//         return new LatLonSize(radius_lat, radius_lon);
//     }
// }


import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openstreetmap.josm.data.coor.LatLon;
import org.openstreetmap.josm.data.osm.BBox;
import org.openstreetmap.josm.plugins.tracer.connectways.LatLonSize;
import org.openstreetmap.josm.tools.Pair;
        private final int m_hashCode;

        public QuadIndex (long ilat, long ilon) {
            m_ilat = ilat;
            m_ilon = ilon;
            m_hashCode = Long.valueOf(m_ilat).hashCode() ^ Long.valueOf(m_ilon).hashCode();
        }

        public long iLat () {
            return m_ilat;
        }

        public long iLon () {
            return m_ilon;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final QuadIndex other = (QuadIndex) obj;
            return other.m_ilat == m_ilat && other.m_ilon == m_ilon;
        }

        @Override
        public int hashCode() {
// Path: src/org/openstreetmap/josm/plugins/tracer/connectways/LatLonSize.java
// public class LatLonSize {
//     private final double m_lat;
//     private final double m_lon;
// 
//     public LatLonSize(double lat, double lon) {
//         m_lat = lat;
//         m_lon = lon;
//     }
// 
//     public double latSize() {
//         return m_lat;
//     }
// 
//     public double lonSize() {
//         return m_lon;
//     }
// 
//     public boolean isZero() {
//         return m_lat == 0 && m_lon == 0;
//     }
// 
//     public static final LatLonSize Zero = new LatLonSize(0, 0);
// 
//     public static LatLonSize get(LatLon ll, double radius_in_meters) {
//         double meters_per_degree_lat = GeomUtils.getMetersPerDegreeOfLatitude(ll);
//         double meters_per_degree_lon = GeomUtils.getMetersPerDegreeOfLongitude(ll);
//         double radius_lat = radius_in_meters / meters_per_degree_lat;
//         double radius_lon = radius_in_meters / meters_per_degree_lon;
//         return new LatLonSize(radius_lat, radius_lon);
//     }
// 
//     public static LatLonSize get(BBox box, double radius_in_meters) {
//         double meters_per_degree_lat1 = GeomUtils.getMetersPerDegreeOfLatitude(box.getTopLeft());
//         double meters_per_degree_lon1 = GeomUtils.getMetersPerDegreeOfLongitude(box.getTopLeft());
//         double meters_per_degree_lat2 = GeomUtils.getMetersPerDegreeOfLatitude(box.getBottomRight());
//         double meters_per_degree_lon2 = GeomUtils.getMetersPerDegreeOfLongitude(box.getBottomRight());
//         double radius_lat = radius_in_meters / Math.min(meters_per_degree_lat1, meters_per_degree_lat2);
//         double radius_lon = radius_in_meters / Math.min(meters_per_degree_lon1, meters_per_degree_lon2);
//         return new LatLonSize(radius_lat, radius_lon);
//     }
// }


// Path: src/org/openstreetmap/josm/plugins/tracer/QuadCache.java
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openstreetmap.josm.data.coor.LatLon;
import org.openstreetmap.josm.data.osm.BBox;
import org.openstreetmap.josm.plugins.tracer.connectways.LatLonSize;
import org.openstreetmap.josm.tools.Pair;

        private final int m_hashCode;

        public QuadIndex (long ilat, long ilon) {
            m_ilat = ilat;
            m_ilon = ilon;
            m_hashCode = Long.valueOf(m_ilat).hashCode() ^ Long.valueOf(m_ilon).hashCode();
        }

        public long iLat () {
            return m_ilat;
        }

        public long iLon () {
            return m_ilon;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final QuadIndex other = (QuadIndex) obj;
            return other.m_ilat == m_ilat && other.m_ilon == m_ilon;
        }

        @Override
        public int hashCode() {
            return m_hashCode;