* Refactor LatitudeLongitude class and add conversion method
Updated `LatitudeLongitude.cs` to include new using directives for `GeoUK.Ellipsoids` and `GeoUK.Projections`. The class structure has been improved for clarity, and a new static method `FromEastingNorthing` has been added to convert easting and northing coordinates to latitude and longitude using Cartesian transformations and projections.
* Update GeoUK/Coordinates/LatitudeLongitude.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix comment typo in LatitudeLongitude.cs
Removed incorrect comment about ETRS89 and WGS84.
No changes to functionality; transformation logic remains intact.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add Polygon class with geospatial methods and tests
Implemented a new static `Polygon` class in the `GeoUK` namespace for generating polygons around geographic points. The class includes input validation and methods for degree-radian conversion.
Also added a suite of unit tests in `PolygonTests.cs` using Xunit to cover various scenarios, ensuring the correctness and performance of the `GeneratePolygonAroundPoint` method.
* Fix longitude normalization in Polygon.cs
Updated longitude normalization to the range of [-180, 180]
instead of [-180, 180). Adjusted logic to correctly handle
values exceeding the bounds by adding or subtracting 360.0
as necessary, ensuring proper wrapping of longitude values.
* Add GeoUK.OSTN.XUnit project and update README.md
- Included a new project `GeoUK.OSTN.XUnit` in the solution.
- Added `pr.yml` to the Solution Items section.
- Enhanced `README.md` with a new section on generating polygons around points, including code examples and a link to GeoJson.io for testing.
* Update project files for packaging enhancements
Added icon file for packaging and updated project metadata.
Replaced `<PackageIconUrl>` with `<PackageIcon>` for local reference.
Modified `<Description>` and restored `<Copyright>` in `GeoUK.csproj`.
* Update NuGet package paths in release.yml
Added "IeuanWalker." prefix to GeoUK and GeoUK.OSTN
packages in upload and publish paths. This ensures
correct referencing of new package names during the
release process.
* Add CI/CD workflows for release and testing
- Introduced `release.yml` for building, testing, and publishing `GeoUK` and `GeoUK.OSTN` projects to NuGet.org on release events.
- Updated `pr.yml` to include .NET setup, dependency restoration, building, and testing steps.
- Modified `GeoUK.OSTN.sln` to include the new `GeoUK.OSTN.XUnit` project and ensure proper workflow file references.
* Update release.yml to pack NuGet packages for projects
Replaced dotnet build commands with dotnet pack for the
GeoUK and GeoUK.OSTN projects in the release workflow.
This change prepares the projects for distribution by
creating NuGet packages instead of just building them.
* Create dotnet.yml
* Replace dotnet.yml with pr.yml for GitHub Actions
Updated the workflow to build and test a .NET project on pull requests to the master branch. Removed the old `dotnet.yml` file and added a new `pr.yml` file with necessary steps for setup, restore, build, and test.
Updated the Visual Studio version in `GeoUK.OSTN.sln` from 16 to 17 and added a "Solution Items" section to include the new `pr.yml` file in the project structure.
* Update workflow name in pr.yml
Changed the workflow name from `.NET` to `PullRequest` for better clarity and to indicate its purpose in handling pull requests.
* Update build command to use Release configuration
Modified the `dotnet build` command to include the `--configuration Release` option. This change ensures that the build process targets the Release mode instead of the default Debug mode, enhancing the overall build process.
* Update build and test commands in pr.yml
Added `--configuration Release` to `dotnet build` and
`dotnet test` commands to ensure optimized performance
for production environments. The `--no-restore` and
`--no-build` options remain unchanged.
* Update testing packages in project file
Upgraded `Microsoft.NET.Test.Sdk` to version `17.14.1`,
`xunit` to version `2.9.3`, and `xunit.runner.visualstudio`
to version `3.1.1` in `GeoUK.OSTN.XUnit.csproj` for improved
compatibility, performance, and access to new features.
* Update project to target netstandard2.0
The project file `DemoProject.csproj` has been modified to use the `netstandard2.0` target framework instead of `netcoreapp2.2`. XML formatting has been improved with added indentation for better readability, while project references remain unchanged but are now consistently indented.
* Update Osgb36.cs
Replace fixed imprecise grid reference with variable precision one
* Compatible default OS Digits
Alter default OS Digits to be compatible with existing code
* Refactor OsDigits initialization and GetBngSquare logic
- Initialize OsDigits property to OsDigitsType.OsDigits6 by default.
- Remove redundant assignment of OsDigits in the constructor.
- Reformat switch statement for clarity.
- Improve readability of conditional check in GetBngSquare method.
* Update terminology from "metre" to "meter"
Changed comments for OS Grid Reference digit types to use "meter" instead of "metre" for 6, 8, 10, and 12 digit references, aligning with American English conventions.
* Update project to target .NET 9.0 and improve formatting
The project file `GeoUK.OSTN.XUnit.csproj` has been updated to target .NET 9.0 instead of .NET Core 2.2. The structure of the `<PropertyGroup>` and `<ItemGroup>` elements has been adjusted for better formatting, while the content remains unchanged. Additionally, the `<None>` and `<Content>` items have been reformatted for consistency, and the `<PackageReference>` and `<ProjectReference>` elements have been improved for readability.
---------
Co-authored-by: Ieuan Walker <walker.ieuan@gmail.com>