mercredi 4 mai 2016

SQLite function for R*-tree in C#

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?

Aucun commentaire:

Enregistrer un commentaire