Mapshaper.Net
0.1.0
See the version list below for details.
dotnet add package Mapshaper.Net --version 0.1.0
NuGet\Install-Package Mapshaper.Net -Version 0.1.0
<PackageReference Include="Mapshaper.Net" Version="0.1.0" />
<PackageVersion Include="Mapshaper.Net" Version="0.1.0" />
<PackageReference Include="Mapshaper.Net" />
paket add Mapshaper.Net --version 0.1.0
#r "nuget: Mapshaper.Net, 0.1.0"
#:package Mapshaper.Net@0.1.0
#addin nuget:?package=Mapshaper.Net&version=0.1.0
#tool nuget:?package=Mapshaper.Net&version=0.1.0
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 | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.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.