GeoCrsTransform 1.0.6
dotnet add package GeoCrsTransform --version 1.0.6
NuGet\Install-Package GeoCrsTransform -Version 1.0.6
<PackageReference Include="GeoCrsTransform" Version="1.0.6" />
<PackageVersion Include="GeoCrsTransform" Version="1.0.6" />
<PackageReference Include="GeoCrsTransform" />
paket add GeoCrsTransform --version 1.0.6
#r "nuget: GeoCrsTransform, 1.0.6"
#:package GeoCrsTransform@1.0.6
#addin nuget:?package=GeoCrsTransform&version=1.0.6
#tool nuget:?package=GeoCrsTransform&version=1.0.6
GeoCRS Transform
A dependency-free .NET library for converting coordinates between major Coordinate Reference Systems (CRSs):
- Geographic CRSs (latitude/longitude, optional height)
- Projected CRSs (eastings/northings in metres, e.g. Web Mercator, British National Grid, UTM)
The library uses WGS84 as a hub datum, Helmert 7-parameter transforms for datum shifts, and pure-managed projection code (no native/PROJ dependency).
GitHub - https://github.com/antonydoyle/GeoCrsTransform
Supported in v1
- Geographic ↔ Geographic (datum shift via Helmert)
- Geographic ↔ Projected (forward/inverse projection)
- Projected ↔ Projected (via geographic hub)
- CRSs: WGS84 (4326), ETRS89 (4258), OSGB36 (4277), Web Mercator (3857), British National Grid (27700), UTM zones 30N/31N/33N (32630, 32631, 32633), plus aliases (e.g.
WGS84,BNG,UTM30N)
See docs/scope.md for full scope and limitations.
Installation
dotnet add package GeoCrsTransform
Examples
WGS84 (4326) ↔ Web Mercator (3857)
using GeoCrsTransform;
var transformer = CoordinateTransform.CreateManaged();
var wgs84 = CrsId.Parse("EPSG:4326");
var webMercator = CrsId.Parse("EPSG:3857");
var geo = new GeoCoordinate(51.5074, -0.1278, 0);
var result = transformer.Transform(geo, wgs84, webMercator);
var projected = (ProjectedCoordinate)result.Output;
Console.WriteLine($"E: {projected.EastingMeters}, N: {projected.NorthingMeters}");
Console.WriteLine($"Path: {result.TransformPath}");
WGS84 ↔ British National Grid (27700)
var transformer = CoordinateTransform.CreateManaged();
var geo = new GeoCoordinate(51.5, -2.0, 0);
var result = transformer.Transform(geo, CrsId.Parse("EPSG:4326"), CrsId.Parse("EPSG:27700"));
var bng = (ProjectedCoordinate)result.Output;
foreach (var w in result.Warnings) Console.WriteLine($"Warning: {w}");
UTM
var transformer = CoordinateTransform.CreateManaged();
var utm30n = CrsId.Parse("EPSG:32630"); // or alias "UTM30N"
var result = transformer.Transform(geo, CrsId.Parse("EPSG:4326"), utm30n);
Projected → Geographic
var bngCoord = new ProjectedCoordinate(400000, 200000, 0);
var result = transformer.Transform(bngCoord, CrsId.Parse("EPSG:27700"), CrsId.Parse("EPSG:4326"));
var backGeo = (GeoCoordinate)result.Output;
Accuracy and warnings
- AccuracyClass on each result:
High,Medium,Low, orUnknown. - Warnings list when parameters are approximate or when grid-based shifts (e.g. OSTN for BNG) are not applied.
- Survey-grade transforms that require grid shifts (NTv2, etc.) are not guaranteed in v1; Helmert-only datum shifts are used. See docs/scope.md.
Extending CRS data
CRS definitions are in the embedded Data/major_crs.json. The format includes:
ellipsoids: id →a,invFgeographic:id,name,aliases,ellipsoid,toWgs84(Helmert:tx,ty,tz,rx,ry,rz,scalePpm),accuracy,warningsprojected:id,name,aliases,base(geographic CRS id),projection(WebMercatororTransverseMercator), pluscentralMeridian,latitudeOfOrigin,scaleFactor,falseEasting,falseNorthing
Parameter sources and notes are recorded in docs/parameter_sources.md.
Extensibility
- CreateManaged() returns the built-in transformer (this package).
- A future optional package may provide CreateProjBacked() for PROJ/grid-based accuracy; the
ICoordinateTransformerinterface is designed to stay stable.
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.