public IGeographicMbr Intersection(IGeographicMbr other) { if (!LatitudeRange.Intersects(other.LatitudeRange)) { return(null); } if (LongitudeRange == null) { return(null); } var longitude = LongitudeRange.Intersection(other.LongitudeRange); if (longitude == null) { return(null); } var latitude = new Range( Math.Max(LatitudeRange.Low, other.LatitudeRange.Low), Math.Min(LatitudeRange.High, other.LatitudeRange.High)); return(new IntersectionResult { LatitudeRange = latitude, LongitudeRange = longitude }); }
public LongitudeRange ExpandTo(LongitudeRange other) { LongitudeRange a, b;// a.ctr <= b.ctr if (this.CompareTo(other) <= 0) { a = this; b = other; } else { a = other; b = this; } LongitudeRange newMin = b.Contains(a.m_min) ? b : a; //usually 'a' LongitudeRange newMax = a.Contains(b.m_max) ? a : b; //usually 'b' if (newMin == newMax) { return(newMin); } if (newMin == b && newMax == a) { return(WORLD_180E180W); } return(new LongitudeRange(newMin.m_min, newMax.m_max)); }
public bool Within(IGeographicMbr other) { return(LongitudeRange.Within(other.LongitudeRange) && LatitudeRange.Within(other.LatitudeRange)); }
public bool Contains(EpsgArea other) { return(LongitudeRange.Contains(other.LongitudeRange) && LatitudeRange.Contains(other.LatitudeRange)); }
public bool Contains(IGeographicMbr other) { return(LongitudeRange.Contains(other.LongitudeRange) && LatitudeRange.Contains(other.LatitudeRange)); }
public bool Intersects(EpsgArea other) { return(LongitudeRange.Intersects(other.LongitudeRange) && LatitudeRange.Intersects(other.LatitudeRange)); }
public bool Intersects(IGeographicMbr other) { return(LongitudeRange.Intersects(other.LongitudeRange) && LatitudeRange.Intersects(other.LatitudeRange)); }
public bool Within(EpsgArea other) { return(LongitudeRange.Within(other.LongitudeRange) && LatitudeRange.Within(other.LatitudeRange)); }
public double CompareTo(LongitudeRange b) { return(Diff(Center, b.Center)); }