A collection of reusable .NET libraries used by tools and applications by Olof Lagerkvist, LTR Data. The repository contains independently versioned library projects covering general utilities, data and networking, geographical calculations, mathematical expressions, plotting, and platform integration.
Each library project below uses its project name as its NuGet package ID. Choose the packages needed by your application; dependencies between them are declared in the project files. Namespaces can differ from package names.
| Package / source | Purpose |
|---|---|
| LTRData.Extensions | General-purpose extensions for buffers and spans, streams, collections, formatting, reflection, numeric operations, and command-line parsing. |
| LTRData.Extensions.Native | Native memory helpers, memory comparison, and native library/symbol access; individual APIs have OS and runtime dependencies. |
| LTRData.Data | Collection and query helpers, caching, CSV reading/writing, reflection-based data mapping, and Entity Framework integration. |
| LTRData.Xml | XML serialization and extensions, configuration, and time-zone-aware date/time helpers. |
| LTRData.Net | HTTP and download helpers, IP address ranges, network extensions, and pipeline helpers. |
| LTRData.Web | RSS models/downloads and linked XML resources. Server-specific helpers live in WebServerUtils. |
| LTRData.WebServerUtils | HTTP server utilities for classic ASP.NET and ASP.NET Core, including response/file handling and HTTPS-related helpers. |
| LTRData.Geodesy | WGS84, RT90 and SWEREF99 coordinates and conversions, grid squares, solar events, and moon-phase calculations. |
| LTRData.PolyGeometry | Point, line, path, polygon and bounding-rectangle types, with WKT parsing. |
| LTRData.Placemarks | Simplified KML models, region lookup and geographical geometry helpers; modern targets use NetTopologySuite. |
| LTRData.Graphics | Color conversion/matching and 3D vector extensions. |
| LTRData.MathExpression | Math parsing, diagnostics, binding and interpreted evaluation, plus portable expression-tree diagram content/layout. Legacy parser APIs remain available. |
| LTRData.FunctionPlotting | Parser-independent function sampling, clipped plot geometry, and numerical differentiation/integration of samples. |
| LTRData.Graphics.SkiaSharp | SkiaSharp renderers for function plots and expression diagrams, plus PNG encoding. |
| LTRData.Compat.System.Management | A System.Management-style API over Microsoft.Management.Infrastructure (CIM), including asynchronous operations; not a complete System.Management replacement. |
| LTRData.PerformanceCounters | Thermal-zone temperature enumeration through Windows performance counters and, on applicable targets, Linux sysfs. |
For example, add the general extensions package to an application:
dotnet add package LTRData.ExtensionsSee LTRData packages on NuGet for published versions and their framework assets. Source on the default branch may be newer than a published package.
Most library projects inherit these build targets from Directory.Build.props:
- .NET Framework 3.5, 4.0, 4.6 and 4.8.
- .NET Standard 2.0 and 2.1.
- .NET 8, 9 and 10.
The exceptions are:
| Package | Targets |
|---|---|
| LTRData.Compat.System.Management | .NET Framework 4.6/4.8, .NET Standard 2.0/2.1, .NET 8/9/10 |
| LTRData.WebServerUtils | .NET Framework 4.0/4.6/4.8, .NET Standard 2.0/2.1, .NET 8/9/10 |
| LTRData.Graphics.SkiaSharp | .NET 8/9/10 |
These are compilation targets, not a guarantee that every API is available on every framework or operating system. Conditional compilation and dependencies vary by target; consult the linked project files and the API you intend to use.
- The modern expression and plotting code is independent of a graphics backend. Rendering through SkiaSharp requires compatible native assets and fonts. Linux applications need the matching Linux native package; FreeBSD native deployment remains deferred. See the rendering and deployment notes.
- WebServerUtils uses System.Web on .NET Framework and ASP.NET Core dependencies on modern targets, including the Microsoft.AspNetCore.App shared framework for .NET 8/9/10. LTRData.Web is kept separate from these server runtime references.
- Native helpers, CIM operations and temperature readings depend on the relevant operating-system libraries, services or hardware interfaces. A .NET Standard target alone does not establish platform availability.
The modern API separates parsing and binding in LTRData.MathExpression, numerical sampling and geometry in LTRData.FunctionPlotting, and native rendering in LTRData.Graphics.SkiaSharp. FunctionPlotting also accepts ordinary numerical delegates without requiring an expression parser.
Start with the expression language specification, rendering examples, and consumer migration and sample calculus notes. Fixed-count sampling does not guarantee detection of every discontinuity or finite asymptote; adaptive sampling and previous-value recurrence remain deferred.
The design documentation preserves the investigation and implementation history. Some sections describe earlier experimental checkpoints; the modern APIs are now part of this repository.
Use the .NET 10 SDK, as in the CI workflow. Building all targets also requires the corresponding reference assemblies; running tests requires the runtime for the selected target.
From the repository root:
dotnet restore Library.slnx
dotnet build Library.slnx -c Release --no-restore
dotnet test Library.slnx -c Release --no-build --no-restore -f net10.0CI is configured to build on Windows, Ubuntu and macOS. It runs the configured test targets on Windows and .NET 10 tests on Ubuntu/macOS. The main test project targets .NET Framework 4.8 and .NET 8/9/10; Rendering.Tests targets .NET 8/9/10 and exercises native SkiaSharp rendering.
Release builds generate NuGet packages. Set LocalNuGetPath to a local feed directory when building packages for other repositories, and build the required dependency packages as well. The local package workflow explains output configuration, consumer restore, and package-origin verification.
Consumers include the netexpr command-line tool and Windows GraphViewer. The separate LTRLib repository retains legacy libraries, including Windows drawing compatibility used by older consumers. The migration notes explain how netexpr and GraphViewer use the newer APIs here.
Geodesy includes work derived from Björn Sållarp's MightyLittleGeodesy, extended by Olof Lagerkvist. Existing source headers retain authorship and license notices.
LTRData Library is distributed under the MIT License. See THIRD-PARTY-NOTICES.md for embedded third-party source, attribution requirements, and additional context for dependency-license findings reported by automated scanners such as FOSSA.