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 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; }
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); }
public bool Within(IGeographicMbr other) { return(LongitudeRange.Within(other.LongitudeRange) && LatitudeRange.Within(other.LatitudeRange)); }
public bool Contains(IGeographicMbr other) { return(LongitudeRange.Contains(other.LongitudeRange) && LatitudeRange.Contains(other.LatitudeRange)); }
public bool Intersects(IGeographicMbr other) { return(LongitudeRange.Intersects(other.LongitudeRange) && LatitudeRange.Intersects(other.LatitudeRange)); }