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

GeoDistance Filter #20

Closed
tsutomi opened this issue Oct 16, 2023 · 0 comments · Fixed by #21
Closed

GeoDistance Filter #20

tsutomi opened this issue Oct 16, 2023 · 0 comments · Fixed by #21
Assignees
Labels
enhancement New feature or request

Comments

@tsutomi
Copy link
Member

tsutomi commented Oct 16, 2023

A common filtering function provided by data storage systems (databases and search engines) uses the distance of geographic points to filter and sort results.

The repository model should provide a new IQueryFilter that provides the possibility to select the origin field, the point and a minimum/maximum distance, in a fashion that can be ported across multiple implementations of the repository.

  • MongoFramework provides an extension function to translate into a native Mongo function - we might use this function or rather use the native FilterBuilder
  • EntityFramework offers provider-specific functions for the case, but seems to depend from the NetTopologySuite in all cases, to have a GIS object model (1)
    • The SQL Server translator uses EF.Functions.Distance static method in a lambda expression
    • The Postgres translator uses the .Distance method of the parameter of a lambda expression to write the native SQL function(3)

(1) https://learn.microsoft.com/en-us/ef/core/modeling/spatial
(3) https://www.npgsql.org/efcore/mapping/nts.html?tabs=with-datasource

@tsutomi tsutomi added the enhancement New feature or request label Oct 17, 2023
@tsutomi tsutomi self-assigned this Oct 17, 2023
@tsutomi tsutomi linked a pull request Oct 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant