GeoZone.cs 908 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Ips.Library.Entity
  5. {
  6. public class GeoZone
  7. {
  8. public double LonMin { get; set; }
  9. public double LonMax { get; set; }
  10. public double LatMin { get; set; }
  11. public double LatMax { get; set; }
  12. public GeoZone() { }
  13. public GeoZone(double lonMin, double lonMax, double latMin, double latMax)
  14. {
  15. LonMin = lonMin;
  16. LonMax = lonMax;
  17. LatMin = latMin;
  18. LatMax = latMax;
  19. }
  20. public static readonly GeoZone Default = new GeoZone(-180, 180, -90, 90);
  21. public override string ToString()
  22. {
  23. return $"[{LonMin:F3},{LonMax:F3},{LatMin:F3},{LatMax:F3}]";
  24. }
  25. public double[] ToArray()
  26. {
  27. return new double[] { LonMin, LonMax, LatMin, LatMax };
  28. }
  29. }
  30. }