Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,356 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Maptor

License: MIT Build .NET Standard NuGet

A comprehensive .NET GIS library for spatial data modeling, processing, and visualization

What is Maptor

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 MapViewer control with layers, symbology, tile basemaps, markers, and a localization system covering 15 cultures with right-to-left support

Repository layout

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

Installation

# Core spatial functionality
dotnet add package IRI.Maptor.Sta.Spatial

Frequently used packages:

Package Description Version
IRI.Maptor.Sta.Spatial Core spatial engine: geometry, analysis, format I/O NuGet
IRI.Maptor.Sta.ShapefileFormat Shapefile read/write (SHP, SHX, DBF, PRJ) NuGet
IRI.Maptor.Sta.SpatialReferenceSystem Coordinate systems and map projections NuGet
IRI.Maptor.Sta.Ogc OGC standards (WFS, WMS, GML, KML, SLD) NuGet
IRI.Maptor.Sta.Graph Graph algorithms (BFS, DFS, Dijkstra, MST) NuGet
IRI.Maptor.Jab.Common WPF map viewer and UI controls NuGet

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.

Quick start

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 build

Run the samples:

# WPF sample application
dotnet run --project samples/IRI.Maptor.Tag.SampleWpfApp

# Console samples
dotnet run --project samples/IRI.Maptor.Tag.SampleCodes

Documentation

Contributing

Contributions are welcome β€” bug reports, feature requests, code, documentation, and tests. Please see the Contributing Guide and Code of Conduct.

License

Maptor is released under the MIT License.


⭐ Star this repository if you find it useful!

Report a bug Β· Request a feature Β· Join the discussion

About

Maptor (MakanNegar): Open-source .NET GIS library for spatial data processing, analysis, and visualization

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

22 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages