A C++/WinRT component that gives .NET applications access to crskit: the EPSG catalogue, Well-Known Text (WKT) definitions of coordinate reference systems (CRS) and coordinate transformations.
| Project | Content |
|---|---|
src/Digi21.CrsKit.Interop |
The component: CrsEngine (EPSG catalogue, WKT definitions, transformations), Transformation, CrsInfo, CrsDetails, CoordinateOperationInfo. |
src/Digi21.CrsKit.Interop.Projection |
The C# projection of the component, generated by C#/WinRT. Packing this project produces the Digi21.CrsKit.Interop NuGet package. |
The Digi21.WinUI.CrsPicker package uses this component to show a CRS picker dialog.
The package contains the projection assembly and, in runtimes/win-x64/native, the component
(Digi21.CrsKit.Interop.dll) with crskit.dll and sqlite3.dll. Only x64 is supported. The application must set
<RuntimeIdentifier>win-x64</RuntimeIdentifier> so that the build copies the three DLLs next to its executable:
without Digi21.CrsKit.Interop.dll there, activating CrsEngine throws a COMException.
The application initializes crskit once, with the path of the EPSG SQLite database and the directory where crskit looks for grid files. The directory must end with a path separator, because crskit appends file names to it. The package does not include the EPSG database.
using Digi21.CrsKit.Interop;
CrsEngine.Initialize(@"C:\MyApp\Data\epsg-fiel.sqlite", @"C:\Users\me\AppData\Local\MyApp\Grids\");
var transformation = CrsEngine.CreateTransformation(4258, 25830);
var eastNorth = transformation.Transform([40.4168, -3.7038]);Requirements: Visual Studio 2026 with the C++ desktop and .NET desktop workloads, and vcpkg, either with user-wide
MSBuild integration (vcpkg integrate install) or with VCPKG_ROOT set to its directory. vcpkg builds crskit from
its registry, declared in src/Digi21.CrsKit.Interop/vcpkg-configuration.json.
-
Restore the NuGet packages, including the
packages.configof the C++ component:msbuild Digi21.CrsKit.Interop.sln -t:restore -p:RestorePackagesConfig=true -p:Platform=x64 -
Build the solution:
msbuild Digi21.CrsKit.Interop.sln -p:Configuration=Release -p:Platform=x64 -
Create the NuGet package, after building in Release:
msbuild src/Digi21.CrsKit.Interop.Projection/Digi21.CrsKit.Interop.Projection.csproj -t:pack -p:Configuration=Release -p:Platform=x64 -p:NoBuild=true
Apache License 2.0. See LICENSE and THIRD-PARTY-NOTICES.md.