Queries++ in RavenDBSpatial searches
Spatial queries are fun, when you look at them from the outside. Not so fun when you are working to implement them, but that is probably not your concern.
RavenDB had had support for spatial queries for many years now, but the RavenDB 4.0 release has touched on that as well and now you can query spatial data with much greater each. Here is a small sample of how this works:
This query is doing a polygon search for all the employees located inside that polygon. You can visualize the query on the map, we have 4 employees (in yellow) in the viewport and two of them are included within the specified polygon (in blue).
And here is what this looks like in the studio:
In this case, you can see how we support automatic indexing of spatial data. You can also define your own spatial indexes if you need greater control but it is as easy as pie to just go ahead and start running it.
From code, this is just as easy:
I’m not sure why, but when looking at the results, this just feels like magic.