Microsoft.Spatial
                             
                            
                                8.4.2
                            
                        
                            
                                
                                
                                    Prefix Reserved
                                
                            
                    See the version list below for details.
dotnet add package Microsoft.Spatial --version 8.4.2
NuGet\Install-Package Microsoft.Spatial -Version 8.4.2
<PackageReference Include="Microsoft.Spatial" Version="8.4.2" />
<PackageVersion Include="Microsoft.Spatial" Version="8.4.2" />
<PackageReference Include="Microsoft.Spatial" />
paket add Microsoft.Spatial --version 8.4.2
#r "nuget: Microsoft.Spatial, 8.4.2"
#:package Microsoft.Spatial@8.4.2
#addin nuget:?package=Microsoft.Spatial&version=8.4.2
#tool nuget:?package=Microsoft.Spatial&version=8.4.2
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) secure@microsoft.com. 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
- Issues: Report issues on Github issues.
 - Questions: Ask questions on Stack Overflow.
 - Feedback: Please send mails to odatafeedback@microsoft.com.
 - Team blog: Please visit https://devblogs.microsoft.com/odata/ and http://www.odata.org/blog/.
 
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 opencode@microsoft.com with any additional questions or comments.
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. | 
This package has no dependencies.
NuGet packages (127)
Showing the top 5 NuGet packages that depend on Microsoft.Spatial:
| Package | Downloads | 
|---|---|
| 
                                                        
                                                            Microsoft.OData.Core
                                                        
                                                            
                                                         Classes to serialize, deserialize and validate OData JSON payloads. Supports OData v4 and v4.01. Enables construction of OData services and clients. Targets .NET 8 or above. OData .NET library is open source at http://github.com/OData/odata.net. Documentation for the library can be found at https://docs.microsoft.com/en-us/odata/.  | 
                                                    |
| 
                                                        
                                                            Microsoft.AspNetCore.OData
                                                        
                                                            
                                                         This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 8.x to support OData query syntax for your Web APIs.  | 
                                                    |
| 
                                                        
                                                            Microsoft.OData.ModelBuilder
                                                        
                                                            
                                                         This package contains APIs to create OData Edm (Entity Data Model) using C# types, attributes and conventions.  | 
                                                    |
| 
                                                        
                                                            Microsoft.Azure.Search.Data
                                                        
                                                            
                                                         Use this package if you're developing a .NET application using Azure Cognitive Search, and you only need to query or update documents in your indexes. If you also need to create or update indexes, synonym maps, or other service-level resources, use the Microsoft.Azure.Search package instead.  | 
                                                    |
| 
                                                        
                                                            Microsoft.Azure.Search.Service
                                                        
                                                            
                                                         Use this package if you're developing automation in .NET to manage Azure Cognitive Search indexes, synonym maps, indexers, data sources, or other service-level resources. If you only need to query or update documents in your indexes, use the Microsoft.Azure.Search.Data package instead. If you need all the functionality of Azure Cognitive Search, use the Microsoft.Azure.Search package instead.  | 
                                                    
GitHub repositories (29)
Showing the top 20 popular GitHub repositories that depend on Microsoft.Spatial:
| Repository | Stars | 
|---|---|
| 
                                                        
                                                            microsoft/ailab
                                                        
                                                         
                                                            Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            Azure/azure-sdk-for-net
                                                        
                                                         
                                                            This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net. 
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            xamarin/xamarin-forms-samples
                                                        
                                                         
                                                            Sample apps built using the Xamarin.Forms framework
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            smartstore/SmartStoreNET
                                                        
                                                         
                                                            Open Source ASP.NET MVC Enterprise eCommerce Shopping Cart Solution
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            pnp/PnP
                                                        
                                                         
                                                            SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            OfficeDev/TrainingContent
                                                        
                                                         
                                                            Training Content used for developer.microsoft.com/office
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            OData/WebApi
                                                        
                                                         
                                                            OData Web API: A server library built upon ODataLib and WebApi
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            OData/odata.net
                                                        
                                                         
                                                            ODataLib: Open Data Protocol - .NET Libraries and Frameworks
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            OData/AspNetCoreOData
                                                        
                                                         
                                                            ASP.NET Core OData: A server library built upon ODataLib and ASP.NET Core
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            telerik/xaml-sdk
                                                        
                                                         
                                                            The XAML SDK is an easy-to-use infrastructure with 1000+ developer focused examples for most of the Telerik UI for WPF controls. 
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            microsoft/BotFramework-BlogSamples
                                                        
                                                         
                                                            Welcome to the Bot Framework samples repository. Here you will find sample bots that take advantage of Bot Framework capabilities. 
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            rstropek/Samples
                                                        
                                                         | 
                                                    |
| 
                                                        
                                                            filipw/apress-recipes-webapi
                                                        
                                                         
                                                            Samples from ASP.NET Web API 2: Recipes book.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            microsoft/Dynamics-AX-Integration
                                                        
                                                         
                                                            Dynamics AX Integration samples and demos.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            OData/ODataSamples
                                                        
                                                         
                                                            Samples: For ODataLib, OData Web API, RESTier, etc.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            ShaneK2/inVtero.net
                                                        
                                                         
                                                            inVtero.net: A high speed (Gbps) Forensics, Memory integrity & assurance.  Includes offensive & defensive memory capabilities.  Find/Extract processes, hypervisors (including nested) in memory dumps using microarchitechture independent Virtual Machiene Introspection techniques
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            zLulus/NotePractice
                                                        
                                                         
                                                            My_Note 笔记练习demo
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            Azure/azure-stream-analytics
                                                        
                                                         
                                                            Azure Stream Analytics
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            martin-nikolov/Telerik-Academy
                                                        
                                                         
                                                            Course exercises | Telerik Academy 2013/2014 | Martin Nikolov
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            hougaard/Youtube-Video-Sources
                                                        
                                                         
                                                            All the source code from my Youtube videos
                                                         
                                                     | 
                                                    
| Version | Downloads | Last Updated | 
|---|---|---|
| 9.0.0-preview.2 | 1,966 | 8/21/2025 | 
| 9.0.0-preview.1 | 703 | 7/10/2025 | 
| 8.4.2 | 10,157 | 10/23/2025 | 
| 8.4.0 | 118,638 | 9/10/2025 | 
| 8.3.0 | 397,663 | 7/10/2025 | 
| 8.2.4 | 136,581 | 6/24/2025 | 
| 8.2.3 | 3,972,231 | 12/11/2024 | 
| 8.2.2 | 1,266,704 | 11/19/2024 | 
| 8.2.1 | 37,675 | 11/13/2024 | 
| 8.2.0 | 304,981 | 11/8/2024 | 
| 8.1.0 | 604,927 | 10/17/2024 | 
| 8.0.2 | 138,454 | 9/30/2024 | 
| 8.0.1 | 3,176,207 | 8/19/2024 | 
| 8.0.0 | 2,605,707 | 8/12/2024 | 
| 8.0.0-rc.1 | 4,459 | 7/11/2024 | 
| 8.0.0-preview.3 | 2,856 | 5/31/2024 | 
| 8.0.0-preview.2 | 1,604 | 5/3/2024 | 
| 8.0.0-preview.1 | 488 | 4/26/2024 | 
| 7.22.0 | 96,456 | 7/10/2025 | 
| 7.21.7 | 20,893 | 6/23/2025 | 
| 7.21.6 | 1,508,008 | 11/8/2024 | 
| 7.21.5 | 216,811 | 10/22/2024 | 
| 7.21.4 | 149,665 | 9/30/2024 | 
| 7.21.3 | 1,647,326 | 6/3/2024 | 
| 7.21.2 | 173,425 | 5/23/2024 | 
| 7.21.1 | 389,541 | 5/2/2024 | 
| 7.21.0 | 294,669 | 4/17/2024 | 
| 7.20.0 | 10,220,701 | 12/8/2023 | 
| 7.19.0 | 72,341 | 11/30/2023 | 
| 7.18.0 | 1,361,654 | 9/6/2023 | 
| 7.17.0 | 2,036,981 | 6/23/2023 | 
| 7.16.0 | 6,898,836 | 5/16/2023 | 
| 7.15.0 | 2,625,776 | 3/1/2023 | 
| 7.14.1 | 143,312 | 2/15/2023 | 
| 7.14.0 | 568,085 | 1/11/2023 | 
| 7.13.0 | 1,654,907 | 12/9/2022 | 
| 7.12.5 | 4,749,871 | 10/25/2022 | 
| 7.12.4 | 121,302 | 10/18/2022 | 
| 7.12.3 | 1,001,288 | 9/19/2022 | 
| 7.12.2 | 3,580,368 | 8/12/2022 | 
| 7.12.1 | 422,909 | 7/20/2022 | 
| 7.12.0 | 405,832 | 6/21/2022 | 
| 7.11.1 | 97,856 | 6/16/2022 | 
| 7.10.0 | 2,622,939 | 1/31/2022 | 
| 7.9.4 | 8,922,333 | 11/5/2021 | 
| 7.9.3 | 279,371 | 10/8/2021 | 
| 7.9.2 | 629,184 | 9/14/2021 | 
| 7.9.1 | 152,902 | 8/26/2021 | 
| 7.9.0 | 9,192,296 | 5/12/2021 | 
| 7.8.3 | 1,398,295 | 3/3/2021 | 
| 7.8.2 | 3,679,919 | 2/15/2021 | 
| 7.8.1 | 1,059,070 | 12/18/2020 | 
| 7.7.3 | 1,283,513 | 11/12/2020 | 
| 7.7.2 | 1,046,109 | 9/23/2020 | 
| 7.7.1 | 2,993,974 | 9/1/2020 | 
| 7.7.0 | 995,465 | 6/26/2020 | 
| 7.7.0-beta | 7,382 | 5/29/2020 | 
| 7.6.4 | 26,953,637 | 3/25/2020 | 
| 7.6.3 | 1,359,869 | 1/30/2020 | 
| 7.6.2 | 513,522 | 11/21/2019 | 
| 7.6.1 | 6,792,745 | 9/30/2019 | 
| 7.6.1-beta | 4,205 | 9/18/2019 | 
| 7.6.0 | 1,606,653 | 6/5/2019 | 
| 7.6.0-beta | 26,979 | 4/1/2019 | 
| 7.5.4 | 973,858 | 2/15/2019 | 
| 7.5.3 | 15,238,505 | 12/18/2018 | 
| 7.5.2 | 236,183 | 11/20/2018 | 
| 7.5.1 | 788,711 | 9/17/2018 | 
| 7.5.0 | 33,065,578 | 6/27/2018 | 
| 7.4.4 | 665,579 | 4/4/2018 | 
| 7.4.3 | 97,534 | 3/21/2018 | 
| 7.4.1 | 280,715 | 2/16/2018 | 
| 7.4.0 | 1,956,150 | 1/22/2018 | 
| 7.4.0-beta3 | 8,899 | 1/12/2018 | 
| 7.4.0-beta2 | 5,614 | 12/18/2017 | 
| 7.4.0-beta | 7,715 | 11/2/2017 | 
| 7.3.1 | 827,562 | 8/14/2017 | 
| 7.3.0 | 79,420 | 7/24/2017 | 
| 7.3.0-beta | 4,611 | 7/17/2017 | 
| 7.2.0 | 5,675,134 | 5/3/2017 | 
| 7.1.1 | 187,017 | 4/11/2017 | 
| 7.0.0 | 1,303,831 | 8/22/2016 | 
| 7.0.0-beta | 4,893 | 8/4/2016 | 
| 6.19.0 | 729,468 | 11/14/2017 | 
| 6.18.0 | 132,363 | 9/7/2017 | 
| 6.18.0-beta | 11,834 | 7/27/2017 | 
| 6.17.0 | 554,313 | 6/12/2017 | 
| 6.16.0 | 218,424 | 4/3/2017 | 
| 6.16.0-beta | 4,785 | 1/13/2017 | 
| 6.15.0 | 5,457,538 | 3/18/2016 | 
| 6.15.0-beta | 19,758 | 1/25/2016 | 
| 6.14.0 | 613,788 | 12/15/2015 | 
| 6.14.0-rc2 | 4,899 | 12/2/2015 | 
| 6.14.0-rc | 8,838 | 10/30/2015 | 
| 6.14.0-beta | 4,569 | 10/16/2015 | 
| 6.13.0 | 1,874,216 | 7/22/2015 | 
| 6.13.0-rc | 4,917 | 7/14/2015 | 
| 6.13.0-beta | 4,610 | 6/19/2015 | 
| 6.12.0 | 368,467 | 5/22/2015 | 
| 6.12.0-beta | 4,768 | 5/15/2015 | 
| 6.11.0 | 835,527 | 3/30/2015 | 
| 6.10.0 | 348,622 | 2/6/2015 | 
| 6.9.0 | 630,632 | 12/10/2014 | 
| 6.8.1 | 374,667 | 10/20/2014 | 
| 6.8.0 | 30,489 | 9/23/2014 | 
| 6.7.0 | 37,719 | 8/29/2014 | 
| 6.6.0 | 25,077 | 7/31/2014 | 
| 6.5.0 | 121,023 | 6/30/2014 | 
| 6.4.0 | 194,953 | 5/30/2014 | 
| 6.3.0 | 14,432 | 4/28/2014 | 
| 6.2.0 | 9,639 | 4/1/2014 | 
| 6.1.0 | 8,043 | 3/4/2014 | 
| 6.0.0 | 96,666 | 1/27/2014 | 
| 6.0.0-beta1 | 7,587 | 12/9/2013 | 
| 6.0.0-alpha2 | 4,778 | 11/7/2013 | 
| 6.0.0-alpha1 | 4,507 | 10/4/2013 |