Skip to main content

Contains classes and methods that facilitate geography and geometry spatial operations.

Total Downloads
280.5M
280,464,326
Published
Jul 28, 2026
3mo ago

Get Started

dotnet add package Microsoft.Spatial --version 9.0.0

No framework information available.

README

Microsoft.Spatial

The Microsoft.Spatial library provides classes and methods for geographic and geometric operations. It is a core component of the OData .NET libraries, enabling you to work with geospatial data types such as points in 2D/3D space, lat/long, lines, and polygons.

Installation

You can install the Microsoft.Spatial package via NuGet:

dotnet add package Microsoft.Spatial

Or via the NuGet Package Manager Console:

Install-Package Microsoft.Spatial

Getting Started

Creating and Using Spatial Data

Here's a simple example of how to create and use spatial data types with Microsoft.Spatial:

using Microsoft.Spatial;

// Create a GeographyPoint
var point = GeographyPoint.Create(47.6097, -122.3331);

// Output the point's coordinates
Console.WriteLine($"Latitude: {point.Latitude}, Longitude: {point.Longitude}");

// Create a GeographyLineString
var lineString = GeographyFactory.LineString()
    .LineTo(47.6097, -122.3331)
    .LineTo(47.6205, -122.3493)
    .Build();

// Output the line string's points
foreach (var position in lineString.Points)
{
    Console.WriteLine($"Point: Latitude {position.Latitude}, Longitude {position.Longitude}");
}

Documentation

For more detailed information, please refer to the official documentation.

Community

Contribution

There are many ways for you to contribute to OData .NET. The easiest way is to participate in discussion of features and issues. You can also contribute by sending pull requests of features or bug fixes to us. Contribution to the documentations is also highly welcomed. Please refer to the CONTRIBUTING.md for more details.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

5.3 Support

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.