A comprehensive .NET GIS library for spatial data modeling, processing, and visualization
Maptor is an open-source .NET library suite for spatial operations, geospatial data processing, and map visualization. Core packages target .NET Standard 2.1 (usable from .NET Core 3.0+/.NET 5+ on any platform); the WPF map viewer targets .NET 8 (Windows).
- Spatial reference systems β predefined ellipsoids, datum transformations, UTM/Mercator/Web Mercator/Lambert projections, geodetic distance calculations (ellipsoidal and spherical)
- Geometry and algorithms β OGC geometry model (points, lines, polygons and multi-variants), Delaunay triangulation, Voronoi diagrams, convex hull, simplification, KdTree/RTree spatial indexes, graph algorithms, machine learning for spatial data
- Data I/O β Shapefile, GeoJSON, Esri JSON, KML/KMZ, GPX, WKT/WKB, TopoJSON, DXF, SVG, EPS, PDF export, GeoParquet, PMTiles, Mapbox vector tiles, MBTiles, GeoPackage, Cesium terrain (read), GeoTIFF metadata, world files, and OGC services (WMS, WFS, GML, SLD)
- Database integration β SQL Server Spatial, PostgreSQL/PostGIS, SQLite, ESRI Personal Geodatabase, EF Core spatial mapping without NetTopologySuite
- WPF visualization β interactive
MapViewercontrol with layers, symbology, tile basemaps, markers, and a localization system covering 15 cultures with right-to-left support
IRI.Maptor.sln
βββ src/
β βββ IRI.Maptor.Sta/ # 12 core spatial libraries (netstandard2.1, UI-free)
β βββ IRI.Maptor.Ket/ # 9 infrastructure & persistence adapters (net8.0 / net8.0-windows)
β βββ IRI.Maptor.Jab/ # WPF UI tier: MapViewer control, MVVM, symbology, localization
βββ tests/ # xUnit test suite
βββ samples/ # sample WPF and console applications
βββ research/ # algorithm research prototypes
βββ docs/ # tutorials and the README style guide
Three library tiers where dependencies flow downward (Jab UI β Ket infrastructure β Sta core):
| Area | Target | Contents |
|---|---|---|
src/IRI.Maptor.Sta |
netstandard2.1 | Twelve UI-free core libraries: primitives, spatial engine and format I/O, reference systems, Shapefile, OGC standards, graphs, ML, PDF export, security, persistence abstractions |
src/IRI.Maptor.Ket |
net8.0 / net8.0-windows | Nine infrastructure and persistence adapters: SQL Server, PostgreSQL/PostGIS, SQLite (MBTiles/GeoPackage), EF Core, Personal GDB, web APIs, GDI+ raster |
src/IRI.Maptor.Jab |
net8.0 / net8.0-windows | UI and presentation: the WPF MapViewer control, MVVM infrastructure, layers and symbology, tile services, localization |
tests/ |
net8.0 | xUnit test suite |
samples/ |
β | Sample WPF and console applications |
# Core spatial functionality
dotnet add package IRI.Maptor.Sta.SpatialFrequently used packages:
| Package | Description | Version |
|---|---|---|
| IRI.Maptor.Sta.Spatial | Core spatial engine: geometry, analysis, format I/O | |
| IRI.Maptor.Sta.ShapefileFormat | Shapefile read/write (SHP, SHX, DBF, PRJ) | |
| IRI.Maptor.Sta.SpatialReferenceSystem | Coordinate systems and map projections | |
| IRI.Maptor.Sta.Ogc | OGC standards (WFS, WMS, GML, KML, SLD) | |
| IRI.Maptor.Sta.Graph | Graph algorithms (BFS, DFS, Dijkstra, MST) | |
| IRI.Maptor.Jab.Common | WPF map viewer and UI controls |
Every library project in the Sta, Ket, and Jab tiers is published to NuGet β see the per-tier package tables in the Sta, Ket, and Jab guides, or browse all packages on NuGet.org.
using IRI.Maptor.Extensions;
using IRI.Maptor.Sta.Common.Primitives;
using IRI.Maptor.Sta.Spatial.Analysis;
using IRI.Maptor.Sta.Spatial.Primitives;
using IRI.Maptor.Sta.SpatialReferenceSystem;
// Create and work with points
var point1 = new Point(51.33, 35.70);
var point2 = new Point(51.42, 35.75);
// Create a line from a list of points
var line = Geometry<Point>.CreatePointOrLineString(
new List<Point> { point1, point2 },
SridHelper.GeodeticWGS84);
// Distance on the ellipsoid
double meters = SpatialUtility.GetEllipsoidalLength(point1, point2);
Console.WriteLine($"ellipsoidal distance: {meters:N0} m");
// Convert to GeoJSON
var geoJsonLine = line.AsGeoJson().Serialize(indented: true);
Console.WriteLine($"line: {geoJsonLine}");Reading a shapefile and converting to GeoJSON:
using IRI.Maptor.Extensions;
using IRI.Maptor.Sta.ShapefileFormat;
var shapes = await Shapefile.ReadShapesAsync("countries.shp");
var geoJson = shapes.Select(s => s.AsGeometry().AsGeoJson()).ToList();Clone and build the whole solution:
git clone https://github.com/hosseinnarimanirad/Maptor.git
cd Maptor
dotnet buildRun the samples:
# WPF sample application
dotnet run --project samples/IRI.Maptor.Tag.SampleWpfApp
# Console samples
dotnet run --project samples/IRI.Maptor.Tag.SampleCodes- README style guide β conventions for documentation in this repo
- Tutorial PDFs β step-by-step guides
- Tier guides: Sta core libraries Β· Ket adapters Β· Jab UI libraries
- Format deep-dives: each format folder under
src/IRI.Maptor.Sta/IRI.Maptor.Sta.Spatial/IO/has its own README - Sample applications β real-world examples
Contributions are welcome β bug reports, feature requests, code, documentation, and tests. Please see the Contributing Guide and Code of Conduct.
Maptor is released under the MIT License.
β Star this repository if you find it useful!