Efcore: Trigonometry support in dbfunctions

Created on 26 Nov 2018  路  1Comment  路  Source: dotnet/efcore

I was hoping to possibly deprecate a stored procedure that is finding facilities within a provided radius of a latitude and longitude coordinate. The sproc has acos, sin and cos values right in the where clause like:

WHERE (acos(sin(@vLAT_RAD) * sin(FAC.LATITUDE_RADIANS) + cos(@vLAT_RAD) * cos(FAC.LATITUDE_RADIANS) * cos(FAC.LONGITUDE_RADIANS - @vLONG_RAD)) * @vEARTH_R) <= @pRADIUS

We will likely keep using the sproc rather than loading our entire data set into memory and filtering in memory as our data set is actually quite large.

closed-question customer-reported

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings