Skip to content

altemiq/geometry

Repository files navigation

Altemiq.Geometry

Build Status License NuGet

A comprehensive .NET library for working with geospatial data, providing:

  • Core geometry types: Point, Polygon, Polyline, and multi-variants with Z (elevation) and M (measure) support
  • Data format parsers: DBF, GeoPackage, SpatiaLite, SQLite
  • I/O formats: ESRI Shapefile, MapInfo TAB/MIF, GeoJSON, WKT, WKB
  • Protobuf serialization: Efficient binary serialization for geometry data
  • gRPC support: Protocol Buffers and gRPC integration

Installation

Install the core library:

dotnet add package Altemiq.Geometry

Install format-specific packages:

# Shapefile I/O
dotnet add package Altemiq.IO.Geometry.Shapefile

# MapInfo TAB I/O
dotnet add package Altemiq.IO.Geometry.MapInfo

# GeoPackage support
dotnet add package Altemiq.Data.GeoPackage

# SpatiaLite support
dotnet add package Altemiq.Data.Spatialite

# GeoJSON support
dotnet add package Altemiq.Text.GeoJson

# STAC support
dotnet add package Altemiq.Text.GeoJson.Stac

# Protobuf serialization
dotnet add package Altemiq.Geometry.Protobuf

Quick Start

using Altemiq.Geometry;
using Altemiq.IO.Geometry;
using Altemiq.Text.GeoJson;

// Create a geometry
var point = new Point(10, 20);

// Parse WKT
var geometry = GeometryConverter.Parse("POINT(10 20)");

// Parse GeoJSON
var geojson = """
{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [10, 20]
  }
}
""";
var feature = GeoJsonConverter.Parse<Feature>(geojson);

// Read Shapefile
using var reader = new ShapefileReader("data.shp");
while (reader.Read())
{
    var geom = reader.GetGeometry();
    var attrs = reader.GetAttributes();
}

Architecture

Core Library

Data Packages

I/O Packages

Serialization Packages

Build Tools

Target Frameworks

Most libraries support:

  • .NET 7.0+
  • .NET Standard 2.0+
  • .NET Framework 4.61+ (where applicable)

Building

dotnet build
dotnet test

Documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

About

C# libraries for Geometry related tasks and IO

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages