0

I need to write SQLite function circle. A query like the following will be used to find all R*Tree entries that overlap with a circle centered a 45.3,22.9 with a radius of 5.0:

SELECT id FROM demo_index WHERE id MATCH circle(45.3, 22.9, 5.0)

I have started with this:

[SQLiteFunction(Arguments = 3, FuncType = FunctionType.Scalar, Name = "circle")]
    public class GetPointsInCircle : SQLiteFunction
    {
        public override object Invoke(object[] args)
        {
           double centerX = Convert.ToDouble(args[0]);
           double centerY = Convert.ToDouble(args[1]);
           double radius = Convert.ToDouble(args[2]);
        }
    }

As I searched about Invoke method, it has deal with args which are passed during method call. But how should I get access for current r*-tree to retrive necessary entries?

MyName
  • 357
  • 2
  • 4
  • 15

1 Answers1

0

SQLiteFunction registers a plain SQL function.

Registering an R-tree geometry callback is something different, and is not supported by the .net SQLite driver.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • Thanks a lot for your answer! I couldn't find about it nowhere and therefore I spent a lot of time trying to write function in C# – MyName May 05 '16 at 09:26