Skip to content

3.1.1.1

Latest
Compare
Choose a tag to compare
@Tronald Tronald released this 17 Nov 22:03
93a277c

-Removed deprecated items: This is a breaking change for any projects still referencing obsolete classes or methods.
-Added .NET 9 support: The application now includes full compatibility with .NET 9.
-Extended MoonIllum properties: Added a new moonAge property to the MoonIllum class.
-Enhanced GeoFence point handling: Added the ability to reorder GeoFence points with right-hand or left-hand orientation.
-Added GeoJson support: New functionality to build GeoJson objects directly from GeoFences.

// Create the outer boundary and order (right-handed)
List<GeoFence.Point> outerPoints = new List<GeoFence.Point>
{
    new Coordinate(47.6062, -122.3321),  // Seattle
    new Coordinate(48.7519, -122.4787),  // Bellingham
    new Coordinate(47.2529, -122.4443),  // Tacoma
    new Coordinate(48.0419, -122.9025),  // Port Townsend
    new Coordinate(47.6588, -117.4260),  // Spokane
    new Coordinate(46.6021, -120.5059),  // Yakima
    new Coordinate(46.7324, -117.0002),  // Pullman
    new Coordinate(48.3102, -122.6290),  // Anacortes
    new Coordinate(47.8225, -122.3123),  // Edmonds
    new Coordinate(46.9787, -123.8313),  // Aberdeen
    new Coordinate(47.0379, -122.9007),  // Olympia
    new Coordinate(47.6091, -122.2015),  // Bellevue
    new Coordinate(47.6787, -120.7141),  // Leavenworth
    new Coordinate(48.0812, -123.2643),  // Port Angeles
    new Coordinate(46.7152, -122.9522)   // Centralia
};

GeoFence outerFence = new GeoFence(outerPoints);
outerFence.OrderPoints_RightHanded();
outerFence.ClosePolygon();

// Create an inner boundary and order (left-handed)
List<Coordinate> innerPoints = new List<Coordinate>()
{
    new Coordinate(46.8523, -121.7603),  // Mount Rainier (center point)
    new Coordinate(46.8625, -121.7401),  // Slightly north-east
    new Coordinate(46.8421, -121.7805),  // Slightly south-west
    new Coordinate(46.8650, -121.7850),  // North-west
    new Coordinate(46.8400, -121.7500)   // South-east
};
GeoFence innerFence = new GeoFence(innerPoints);
innerFence.OrderPoints_LeftHanded();
innerFence.ClosePolygon();

// Build the GeoJSON polygon with the outer and inner boundaries
string geoJson = GeoFence.GeoJsonPolygonBuilder(outerFence, new List<GeoFence> { innerFence });