Mapshaper.Net
0.0.2
See the version list below for details.
dotnet add package Mapshaper.Net --version 0.0.2
NuGet\Install-Package Mapshaper.Net -Version 0.0.2
<PackageReference Include="Mapshaper.Net" Version="0.0.2" />
<PackageVersion Include="Mapshaper.Net" Version="0.0.2" />
<PackageReference Include="Mapshaper.Net" />
paket add Mapshaper.Net --version 0.0.2
#r "nuget: Mapshaper.Net, 0.0.2"
#:package Mapshaper.Net@0.0.2
#addin nuget:?package=Mapshaper.Net&version=0.0.2
#tool nuget:?package=Mapshaper.Net&version=0.0.2
Mapshaper.Net
A thin .NET wrapper around the external mapshaper CLI.
This package does not bundle mapshaper. Install mapshaper separately and ensure mapshaper is available on PATH, or pass the executable path through MapshaperOptions.
Thin wrapper philosophy
Mapshaper.Net does not parse geospatial files or reimplement mapshaper behavior. It invokes the external mapshaper CLI safely, passes arguments through in a predictable way, and captures the process output so .NET code can inspect success, errors, stdout, and stderr.
Install mapshaper
Mapshaper requires Node.js. After installing Node.js, install the mapshaper command line tools globally with npm:
npm install -g mapshaper
Confirm the executable is available:
mapshaper -v
If mapshaper is not on PATH, pass the full path to the installed executable or shim.
var client = new MapshaperClient(new MapshaperOptions
{
ExecutablePath = @"C:\Users\you\AppData\Roaming\npm\mapshaper.cmd"
});
Usage
using Mapshaper.Net;
var client = new MapshaperClient();
var result = await client.SimplifyAsync(
"input.geojson",
"output.geojson",
"10%");
result.EnsureSuccess();
Use RunAsync() for raw mapshaper arguments:
var result = await client.RunAsync("input.geojson", "-simplify", "10%", "-o", "output.geojson");
Pass modeled options for common import and output flags:
var result = await client.ConvertAsync(
"input.geojson",
"output.json",
new MapshaperCommandOptions
{
Quiet = true,
Import = new MapshaperImportOptions
{
Encoding = "utf8",
IdField = "SOURCE_ID"
},
Output = new MapshaperOutputOptions
{
Format = "geojson",
Precision = "0.000001",
Force = true
}
});
Configure the executable:
var client = new MapshaperClient(new MapshaperOptions
{
ExecutablePath = @"C:\tools\mapshaper.cmd"
});
| 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 was computed. 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 was computed. 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. |
-
net8.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.