Loading repository data…
Loading repository data…
MaxRev-Dev / repository
GDAL 3.x C#/F# bindings for .NET apps
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A simple (as is) build engine of GDAL library for .NET.
Provides a minimal setup without requirements to install heavy GDAL binaries into your system.
MaxRev.Gdal.Universal
MaxRev.Gdal.Core
MaxRev.Gdal.WindowsRuntime.Minimal
MaxRev.Gdal.LinuxRuntime.Minimal
MaxRev.Gdal.MacosRuntime.Minimal
CLI Tools - GDAL command-line utilities (gdalinfo, ogr2ogr, gdal_translate, etc.)
MaxRev.Gdal.CLI.win-x64
MaxRev.Gdal.CLI.linux-x64
MaxRev.Gdal.CLI.linux-arm64
MaxRev.Gdal.CLI.osx-x64
MaxRev.Gdal.CLI.osx-arm64
Table of contents generated with markdown-toc
proj.db database you may require proj-data grid shifts.dotnet add package MaxRev.Gdal.Universal
dotnet add package MaxRev.Gdal.Core
# windows supported only for x64
dotnet add package MaxRev.Gdal.WindowsRuntime.Minimal
# install linux bundle which references both arm64 and x64 binaries
dotnet add package MaxRev.Gdal.LinuxRuntime.Minimal
# or install a specific runtime
dotnet add package MaxRev.Gdal.LinuxRuntime.Minimal.arm64
dotnet add package MaxRev.Gdal.LinuxRuntime.Minimal.x64
# install macos bundle which references both arm64 and x64 binaries
dotnet add package MaxRev.Gdal.MacosRuntime.Minimal
# or install a specific runtime
dotnet add package MaxRev.Gdal.MacosRuntime.Minimal.arm64
dotnet add package MaxRev.Gdal.MacosRuntime.Minimal.x64
using MaxRev.Gdal.Core;
// call it once, before using GDAL
// this will initialize all GDAL drivers and set PROJ6 shared library paths
GdalBase.ConfigureAll();
The CLI packages provide GDAL command-line utilities (gdalinfo, ogr2ogr, gdal_translate, etc.) that can be invoked from your .NET application. Each CLI package automatically references the corresponding runtime package. You don't have to install the runtime package separately if you are using the CLI package - it includes a package reference to the runtime nugets.
# Windows
dotnet add package MaxRev.Gdal.CLI.win-x64
# Linux
dotnet add package MaxRev.Gdal.CLI.linux-x64
dotnet add package MaxRev.Gdal.CLI.linux-arm64
# macOS
dotnet add package MaxRev.Gdal.CLI.osx-x64
dotnet add package MaxRev.Gdal.CLI.osx-arm64
GdalCli helper class (automatically included via the package):using MaxRev.Gdal.CLI;
// GdalCli.Run calls EnsureEnvironment() automatically on module load.
// OPTIONAL - You can also call it explicitly if needed:
// GdalCli.EnsureEnvironment();
// Run a GDAL tool and capture output
var exitCode = GdalCli.Run("gdalinfo", new[] { "--version" },
stdout: Console.Write,
stderr: Console.Error.Write);
// Run with file arguments
var result = GdalCli.Run("ogr2ogr",
new[] { "-f", "GeoJSON", "output.geojson", "input.shp" });
// Get the path to a GDAL tool
var toolPath = GdalCli.GetToolPath("gdalinfo");
See tests/MaxRev.Gdal.Core.Tests.CLI for more examples.
The CLI package includes two source files (GdalCli helper and PathInitializer) that are compiled directly into your project via buildTransitive targets. There is no extra assembly dependency - these become part of your application.
On startup, a [ModuleInitializer] automatically configures the process environment so the native GDAL tools can locate their shared libraries:
PATHLD_LIBRARY_PATHDYLD_LIBRARY_PATHGDAL_DATA and PROJ_LIB to the bundled data directoriesWhen you call GdalCli.Run(...), it spawns the tool as a child process which inherits these environment variables. The initialization is idempotent - GdalCli.EnsureEnvironment() can be called explicitly but will only run once.
You can disable the automatic s