Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the experience of working with spatial types using OData and EF Core #27861

Open
JeremyLikness opened this issue Apr 22, 2022 · 1 comment

Comments

@JeremyLikness
Copy link
Member

Related to Issue #22951

Currently, EF Core recognizes spatial types based on the NetTopologySuite (NTS) while OData recognizes the types in Microsoft.Spatial. This means there is no "easy path" to using spatial with both EF Core and OData, but a complicated set of customizations like the ones described in Customizing $filter for spatial data in ASP.NET Core OData 8. .NET developers deserve a streamlined experience here.

There are two solutions @bricelam suggested:

  1. The EF Core team provides a set of packages that enable use of Microsoft.Spatial types, so OData will "just work", or
  2. The OData team provides an extension that recognizes NTS types, and EF Core will "just work"
@bricelam
Copy link
Contributor

One caveat to using Microsoft.Spatial types in your EF Core model is that your queries are limited to the spatial operations available on those types. Today, that's only three operations: Distance, Intersects, and Length. Also, there is no client-side implementation of these operations--they just throw NotImplementedException. (Easy to see why we went with NTS, isn't it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants