Exemplo n.º 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
                });
            }
Exemplo n.º 2
0
 public static List<GeographicCoordinate> CreateTestPoints(IGeographicMbr mbr, int lonValueCount = 10, int latValueCount = 10)
 {
     var resultPoints = new List<GeographicCoordinate>(lonValueCount * latValueCount);
     var lonValues = GetValues(mbr.LongitudeRange, lonValueCount);
     var latValues = GetValues(mbr.LatitudeRange, latValueCount);
     for (int r = 0; r < latValues.Length; r++)
         for (int c = 0; c < lonValues.Length; c++)
             resultPoints.Add(new GeographicCoordinate(latValues[r], lonValues[c]));
     return resultPoints;
 }
Exemplo n.º 3
0
        public static List <GeographicCoordinate> CreateTestPoints(IGeographicMbr mbr, int lonValueCount = 10, int latValueCount = 10)
        {
            var resultPoints = new List <GeographicCoordinate>(lonValueCount * latValueCount);
            var lonValues    = GetValues(mbr.LongitudeRange, lonValueCount);
            var latValues    = GetValues(mbr.LatitudeRange, latValueCount);

            for (int r = 0; r < latValues.Length; r++)
            {
                for (int c = 0; c < lonValues.Length; c++)
                {
                    resultPoints.Add(new GeographicCoordinate(latValues[r], lonValues[c]));
                }
            }
            return(resultPoints);
        }
Exemplo n.º 4
0
 public bool Within(IGeographicMbr other)
 {
     return(LongitudeRange.Within(other.LongitudeRange) &&
            LatitudeRange.Within(other.LatitudeRange));
 }
Exemplo n.º 5
0
 public bool Contains(IGeographicMbr other)
 {
     return(LongitudeRange.Contains(other.LongitudeRange) &&
            LatitudeRange.Contains(other.LatitudeRange));
 }
Exemplo n.º 6
0
 public bool Intersects(IGeographicMbr other)
 {
     return(LongitudeRange.Intersects(other.LongitudeRange) &&
            LatitudeRange.Intersects(other.LatitudeRange));
 }