Пример #1
0
            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
                });
            }
Пример #2
0
            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));
            }
Пример #3
0
 public bool Within(IGeographicMbr other)
 {
     return(LongitudeRange.Within(other.LongitudeRange) &&
            LatitudeRange.Within(other.LatitudeRange));
 }
Пример #4
0
 public bool Contains(EpsgArea other)
 {
     return(LongitudeRange.Contains(other.LongitudeRange) &&
            LatitudeRange.Contains(other.LatitudeRange));
 }
Пример #5
0
 public bool Contains(IGeographicMbr other)
 {
     return(LongitudeRange.Contains(other.LongitudeRange) &&
            LatitudeRange.Contains(other.LatitudeRange));
 }
Пример #6
0
 public bool Intersects(EpsgArea other)
 {
     return(LongitudeRange.Intersects(other.LongitudeRange) &&
            LatitudeRange.Intersects(other.LatitudeRange));
 }
Пример #7
0
 public bool Intersects(IGeographicMbr other)
 {
     return(LongitudeRange.Intersects(other.LongitudeRange) &&
            LatitudeRange.Intersects(other.LatitudeRange));
 }
Пример #8
0
 public bool Within(EpsgArea other)
 {
     return(LongitudeRange.Within(other.LongitudeRange) &&
            LatitudeRange.Within(other.LatitudeRange));
 }
Пример #9
0
 public double CompareTo(LongitudeRange b)
 {
     return(Diff(Center, b.Center));
 }