I have documents similar to this in RavenDB:
public class MyClass
{
...
public double Latitude { get; set; }
public double Longitude { get; set; }
...
}
Now I want to find all documents with positions within the bounds of a rectangle specified by its N and S latitude and W and E longitude.
A simple approach would be a query like this:
.Where(o => o.Latitude <= boundaryNorth &&
o.Latitude >= boundarySouth &&
o.Longitude >= boundaryWest &&
o.Longitude <= boundaryEast)
But that doesn’t work if the bounding rectangle lies across the antimeridian, complicating the query (check if this is the case, split up the bounding rectangle into two, create two of the previous expressions combined by ||).
I know that you can create a spatial index and then query it for all documents with positions within a specified radius from a given origin, but I haven’t found any other methods of querying that index.
Is there any other way to query spatial indexes?
Currently we only allow to search for items within a specific distance of a point.
We do have other capabilities, but they aren’t expose at the present time.
I suggest taking this to the mailing list and seeing if we can provide you with the API you want.