https://github.com/hosseinnarimanirad/maptor
Maptor (MakanNegar): Open-source .NET GIS library for spatial data processing, analysis, and visualization
https://github.com/hosseinnarimanirad/maptor
cartography geodesy geographic-information-systems geography geomatics geometry geospatial gis map spatial spatial-analysis spatial-data surveying
Last synced: about 2 months ago
JSON representation
Maptor (MakanNegar): Open-source .NET GIS library for spatial data processing, analysis, and visualization
- Host: GitHub
- URL: https://github.com/hosseinnarimanirad/maptor
- Owner: hosseinnarimanirad
- License: mit
- Created: 2017-10-12T08:50:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2026-04-10T11:13:46.000Z (about 2 months ago)
- Last Synced: 2026-04-10T13:16:17.622Z (about 2 months ago)
- Topics: cartography, geodesy, geographic-information-systems, geography, geomatics, geometry, geospatial, gis, map, spatial, spatial-analysis, spatial-data, surveying
- Language: C#
- Homepage: https://www.nuget.org/profiles/narimanirad
- Size: 117 MB
- Stars: 22
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# ๐ Maptor Spatial Library
[](https://github.com/hosseinnarimanirad/Maptor/blob/master/LICENSE)
[](https://github.com/hosseinnarimanirad/Maptor/actions)
[](CONTRIBUTING.md)
[](https://dotnet.microsoft.com/download/dotnet/8.0)
[](https://www.nuget.org/packages/IRI.Maptor.Sta.Spatial)

**A comprehensive .NET GIS library for spatial data modeling, processing, and visualization**
Maptor is a powerful, open-source .NET library designed to make spatial operations, geospatial data processing, and map visualization accessible and efficient. Built for **.NET 8+**, it provides a complete toolkit for geometry operations, coordinate transformations, data I/O, and advanced spatial algorithms.
---
## ๐ Quick Start
### Add a Console Project
Add a new C# console project
### Installation
```bash
# Core spatial functionality
dotnet add package IRI.Maptor.Sta.Spatial
```
### Basic Usage
```csharp
using IRI.Maptor.Extensions;
using IRI.Maptor.Sta.Common.Primitives;
using IRI.Maptor.Sta.Spatial.Primitives;
using IRI.Maptor.Sta.SpatialReferenceSystem;
// Create and work with points
var point1 = new Point(51.5074, -0.1278); // London
var point2 = new Point(40.7128, -74.0060); // New York
// Create geometries
var line = Geometry.CreatePointOrLineString(SridHelper.GeodeticWGS84, point1, point2);
var ellipsoidal_length = line.GetEllipsoidalLength();
var spherical_length = line.GetSphericalLength();
// Calculate length
Console.WriteLine($"ellipsoidal distance: {ellipsoidal_length:N1} km");
Console.WriteLine($" spherical distance: {spherical_length:N1} km");
// Convert to GeoJSON
var geoJsonLine = line.AsGeoJson().Serialize(indented: true);
Console.WriteLine($"line: {geoJsonLine}");
Console.Read();
```
---
## โจ Key Features
### ๐บ๏ธ **Spatial Reference Systems**
- **15+ predefined ellipsoids** (WGS84, GRS80, Clarke 1866, etc.)
- **Coordinate transformations** (UTM, Mercator, WebMercator, Lambert, etc.)
- **Custom SRID support** for specialized projections
- **Geodetic calculations** with high precision
### ๐ง **Geometry Operations**
- **Complete geometry types**: Points, Lines, Polygons, MultiPoints, MultiLines, MultiPolygons
- **Advanced algorithms**: Delaunay triangulation, Voronoi diagrams, convex hulls
- **Spatial indexing**: KdTree, RTree for efficient spatial queries
### ๐ **Data I/O & Formats**
- **Vector formats**:
- **Standard formats**: Shapefile, GeoJSON, KML, KMZ, GPX, WKB, WKT
- **Topology formats**: TopoJSON (with topology encoding and quantization support)
- **CAD/Graphics formats**: DXF, SVG, EPS (with styling support and round-trip coordinate preservation)
- **Document formats**: PDF (vector graphics export)
- **Columnar formats**: GeoParquet (efficient columnar geospatial data storage)
- **SQL Server Native Binary**: Native spatial data format
- **Raster support**: GeoTIFF (Worldfile), GRD file, custom raster formats
- **Terrain formats**:
- **Cesium Terrain**: quantized-mesh-1.0 (adaptive triangle meshes) and heightmap-1.0 (regular grids) for 3D terrain visualization
- **Tile formats**:
- **PMTiles**: Serverless tile archive format (vector and raster tiles)
- **MBTiles**: SQLite-based tile storage for offline mapping
- **GeoPackage tiles**: OGC standard tile storage
- **Database integration**: SQL Server Spatial, PostGIS, Personal GDB, SQLite/GeoPackage, MBTiles
- **OGC standards**: WFS, WMS, GML 2/3, SFA, SLD styling
- **Format features**:
- Round-trip conversion with exact coordinate preservation (SVG, EPS, DXF)
- Styling support (colors, stroke width, opacity) for CAD/graphics formats
- Topology preservation in TopoJSON
- Efficient compression and quantization options
### ๐งฎ **Advanced Algorithms**
- **Graph algorithms**: BFS, DFS, Dijkstra, Minimum Spanning Tree, MinCut
- **Machine learning**: Clustering, Apriori, Logistic Regression
- **Computational geometry**: Triangulation, simplification, generalization
- **Spatial analysis**: Interpolation, statistics, terrain modeling
### ๐ฅ๏ธ **WPF Visualization**
- **Interactive map viewer** with zoom, pan, and layer management
- **Rich UI controls** for spatial data display
- **Custom markers and annotations**
---
## ๐๏ธ Architecture
Maptor follows a modular architecture with clear separation of concerns:
```
Maptor/
โโโ ๐ฆ IRI.Maptor.Sta/ # Core spatial operations & algorithms
โ โโโ Spatial # Geometry types, spatial algorithms
โ โ โโโ IO/ # Format I/O (DXF, SVG, EPS, TopoJSON, PMTiles, CesiumTerrain, etc.)
โ โ โโโ Analysis/ # Spatial analysis algorithms
โ โโโ SpatialReferenceSystem # Coordinate systems & transformations
โ โโโ ShapefileFormat # ESRI Shapefile I/O
โ โโโ Ogc # OGC standards implementation
โ โโโ Graph # Graph algorithms
โ โโโ MachineLearning # ML algorithms for spatial data
โ โโโ GeoParquet # GeoParquet format support
โ โโโ Pdf # PDF vector format support
โ โโโ Security # Security/cryptography primitives
โ โโโ Persistence # Persistence abstractions
โโโ ๐ง IRI.Maptor.Ket/ # Infrastructure & persistence
โ โโโ SqlServerPersistence # SQL Server integration
โ โโโ PostgreSqlPersistence # PostGIS integration
โ โโโ SqlitePersistence # SQLite/GeoPackage/MBTiles support
โ โโโ PersonalGdbPersistence # Personal Geodatabase support
โ โโโ GdiPlus # Raster data handling
โ โโโ WebApiPersistence # Web API data sources
โโโ ๐ฅ๏ธ IRI.Maptor.Jab/ # WPF UI components
โ โโโ Controls # Map viewer, dialogs
โ โโโ Common # MVVM infrastructure
โโโ ๐งช Tests & Samples/ # Comprehensive test suite & examples
```
---
## ๐ฆ NuGet Packages
| Package | Description | Version |
|---------|-------------|---------|
| [IRI.Maptor.Sta.Spatial](https://www.nuget.org/packages/IRI.Maptor.Sta.Spatial) | Core spatial functionalities (GeoJSON, analysis, etc.) |  |
| [IRI.Maptor.Sta.ShapefileFormat](https://www.nuget.org/packages/IRI.Maptor.Sta.ShapefileFormat) | Read/Write shapefile (shp, shx, dbf, prj, etc.) |  |
| [IRI.Maptor.Sta.SpatialReferenceSystem](https://www.nuget.org/packages/IRI.Maptor.Sta.SpatialReferenceSystem) | Coordinate system transformations |  |
| [IRI.Maptor.Sta.Ogc](https://www.nuget.org/packages/IRI.Maptor.Sta.Ogc) | OGC standard implementations |  |
| [IRI.Maptor.Sta.Graph](https://www.nuget.org/packages/IRI.Maptor.Sta.Graph) | Graph Algorithms (BFS, DFS, Dijkstra, etc.) |  |
| [IRI.Maptor.Jab.Controls](https://www.nuget.org/packages/IRI.Maptor.Jab.Controls) | WPF Map user controls |  |
โถ Show more packages
| Package | Description | Version |
|---------|-------------|---------|
| [IRI.Maptor.Jab.Common](https://www.nuget.org/packages/IRI.Maptor.Jab.Common) | Basic UI models, rendering methods |  |
| [IRI.Maptor.Ket.SqlServerPersistence](https://www.nuget.org/packages/IRI.Maptor.Ket.SqlServerPersistence) | SQL Server spatial integration |  |
| [IRI.Maptor.Ket.PostgreSqlPersistence](https://www.nuget.org/packages/IRI.Maptor.Ket.PostgreSqlPersistence) | PostGIS integration |  |
| [IRI.Maptor.Ket.SqlitePersistence](https://www.nuget.org/packages/IRI.Maptor.Ket.SqlitePersistence) | SQLite/GeoPackage/MBTiles support |  |
| [IRI.Maptor.Sta.MachineLearning](https://www.nuget.org/packages/IRI.Maptor.Sta.MachineLearning) | Clustering, Apriori, Logistic Regression |  |
| [IRI.Maptor.Sta.Pdf](https://www.nuget.org/packages/IRI.Maptor.Sta.Pdf) | PDF vector format support |  |
| [IRI.Maptor.Sta.Common](https://www.nuget.org/packages/IRI.Maptor.Sta.Common) | Foundational utilities and abstractions |  |
๐ [Browse all packages on NuGet.org](https://www.nuget.org/packages?q=IRI.Maptor)
---
## ๐ป Code Examples
### Working with Shapefiles
```csharp
using IRI.Maptor.Extensions;
using IRI.Maptor.Sta.ShapefileFormat;
// Read shapefile
var shapes = await Shapefile.ReadShapesAsync("countries.shp");
foreach (var shape in shapes)
{
Console.WriteLine($"Country: {shape.AsSqlServerWkt()}");
}
// Convert to GeoJSON
var geoJson = shapes.Select(s => s.AsGeometry().AsGeoJson()).ToList();
```
### Coordinate Transformations
```csharp
using IRI.Maptor.Sta.Common.Primitives;
using IRI.Maptor.Sta.SpatialReferenceSystem;
// Transform WGS84 to UTM
var wgs84Point = new Point(51.5074, -0.1278); // London
var utmPoint = MapProjects.GeodeticToUTM(wgs84Point);
Console.WriteLine($"London (UTM): {utmPoint}");
```
---
## ๐ฏ Use Cases
- **๐บ๏ธ GIS Applications**: Desktop and web mapping applications
- **๐ Data Analysis**: Spatial data processing and analysis
- **๐๏ธ Engineering**: Surveying, and infrastructure projects
- **๐ Transportation**: Route optimization, logistics
- **๐ฌ Research**: Academic and scientific spatial research
---
## ๐ Getting Started
### 1. Clone & Build
```bash
git clone https://github.com/hosseinnarimanirad/Maptor.git
cd Maptor
dotnet build
```
### 2. Run Samples
```bash
# WPF Sample Application
cd samples/IRI.Maptor.Tag.SampleWpfApp
dotnet run
# Console Samples
cd samples/IRI.Maptor.Tag.SampleCodes
dotnet run
```
### 3. Explore Documentation
- ๐ [Full documentation and guides](https://github.com/hosseinnarimanirad/Maptor/wiki)
- ๐ [Tutorial PDFs](docs/) - Step-by-step guides
- ๐ก [Sample applications](samples/) - Real-world examples
---
## ๐งช Testing & Quality
- **1,300+ C# files** with comprehensive test coverage
- **Unit tests** for core functionality
- **Performance benchmarks** for some algorithms
- **Continuous integration** with GitHub Actions
---
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md).
### Ways to Contribute
- ๐ **Bug Reports** โ Found an issue? Report it with steps to reproduce
- ๐ก **Feature Requests** โ Got an idea? Open a discussion or issue
- ๐ง **Code Contributions** โ Implement fixes, new features, or refactor for better performance
- ๐ **Documentation** โ Improve README, tutorials, XML docs, or add usage examples
- ๐งช **Testing** โ Write unit/integration tests to ensure quality
---
## ๐ Performance
Maptor is designed for performance with:
- **Optimized algorithms** for large datasets
- **Spatial indexing** (KdTree, RTree) for fast queries
- **Memory-efficient** streaming APIs
- **Async/await** support for I/O operations
- **Parallel processing** where applicable
---
## ๐ Internationalization
- **Multi-language support** with localization framework
- **RTL language support** (Arabic, Persian, Hebrew)
- **Regional data providers** (Iran-specific datasets)
- **Cultural formatting** for numbers, dates, and coordinates
---
## ๐ License
Maptor is released under the [MIT License](LICENSE.txt) - see the LICENSE file for details.
---
## ๐ Acknowledgments
- Built with modern .NET technologies
- Inspired by OGC standards and best practices
- Community-driven development
- Academic research integration
---
**โญ Star this repository if you find it useful!**
[Report Bug](https://github.com/hosseinnarimanirad/Maptor/issues) ยท [Request Feature](https://github.com/hosseinnarimanirad/Maptor/issues) ยท [Join Discussion](https://github.com/hosseinnarimanirad/Maptor/discussions)