Skip to content

Commit

Permalink
Update spatial docs to reference ProjNet not ProjNet4GeoAPI (#3028)
Browse files Browse the repository at this point in the history
Fixes #3019
  • Loading branch information
ajcvickers authored Feb 9, 2021
1 parent 3395d72 commit 2c0e594
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions entity-framework/core/modeling/spatial.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ The spatial NuGet packages also enable [reverse engineering](xref:core/managing-

## SRID Ignored during client operations

NTS ignores SRID values during operations. It assumes a planar coordinate system. This means that if you specify coordinates in terms of longitude and latitude, some client-evaluated values like distance, length, and area will be in degrees, not meters. For more meaningful values, you first need to project the coordinates to another coordinate system using a library like [ProjNet4GeoAPI](https://github.com/NetTopologySuite/ProjNet4GeoAPI) before calculating these values.
NTS ignores SRID values during operations. It assumes a planar coordinate system. This means that if you specify coordinates in terms of longitude and latitude, some client-evaluated values like distance, length, and area will be in degrees, not meters. For more meaningful values, you first need to project the coordinates to another coordinate system using a library like [ProjNet (for GeoAPI)](https://github.com/NetTopologySuite/ProjNet4GeoAPI).

> [!NOTE]
> Use the newer [ProjNet NuGet package](https://www.nuget.org/packages/ProjNet/), **not** the older package called ProjNet4GeoAPI.
If an operation is server-evaluated by EF Core via SQL, the result's unit will be determined by the database.

Here is an example of using ProjNet4GeoAPI to calculate the distance between two cities.
Here is an example of using ProjNet to calculate the distance between two cities.

[!code-csharp[](../../../samples/core/Spatial/Projections/GeometryExtensions.cs?name=snippet_GeometryExtensions)]

Expand Down

0 comments on commit 2c0e594

Please sign in to comment.