Getting started
Maptor is published as a set of NuGet packages named IRI.Maptor.*. Pick the tier you need:
the UI-free core for geometry and formats, the infrastructure adapters for databases, or the WPF
map control.
1. Install a package
# core spatial engine: geometry model, analysis, format I/O
dotnet add package IRI.Maptor.Core.Spatial
# Shapefile read/write
dotnet add package IRI.Maptor.Core.ShapefileFormat
# WPF map viewer and UI controls (net8.0-windows)
dotnet add package IRI.Maptor.Presentation.Wpf
The full list, with the README of each library, is on the Packages page.
2. Read a shapefile and measure something
using IRI.Maptor.Core.ShapefileFormat;
using IRI.Maptor.Core.Spatial.Analysis;
var features = Shapefile.ReadAsFeature("roads.shp");
foreach (var feature in features)
{
var length = SpatialUtility.GetSphericalLength(feature.TheGeometry);
Console.WriteLine($"{feature.Id}: {length:N0} m");
}
3. Put a map in a WPF window
The smallest complete application is the Hello map sample — an
App.xaml that merges the Maptor resource dictionaries, a MapViewer in a window, and four
lines of initialization:
var presenter = new HelloMapViewModel(); // MapViewModelBase subclass
presenter.InitializeSettings(ProxySettings.Default, BaseMapSettings.Default,
new MapSettings { InitialExtent = BoundingBoxes.WebMercator_Europe }, GeneralSettings.Default);
await MapInitializationHelper.InitializeMapAsync(map, this, presenter);
DataContext = presenter;
presenter.SelectedMapProvider = TileMapProviderFactory.GoogleRoadMap;
From there, the WPF gallery adds one feature per page: legend, go-to dialog, identify, drawing, markers, measurement, localization.
4. Build from source
git clone https://github.com/hosseinnarimanirad/Maptor.git
cd Maptor
dotnet build
Requires the .NET 8 SDK; the WPF projects need Windows.