Figured it out:
This particular value error is referencing the length of the array used to build the KD Tree.
The %d
value represents the length of the array used to build the KD tree, and the %s
value represents the length of the array like object you are using to query.
In my example the %d
value was 6 because I had built a 6 dimensional array.
The %s
value was 2 because I had only fed it two coordinates: (X,Y)
to query.
My error was that I had accidentally included 4 extra fields when building the KD tree. Now that both values are 2, all works as expected.