ayende/ravendb — pull request #268 by sibartlett (2013-02-25 14:39:58+00:00)
Title: Spatial Awesomeness

___This pull request is not ready - I am still working on it.___

I thought it would be a good idea to make my work visible, and show what direction I am taking RavenDB's spatial support!

So far I have:

* Added support for indexing and querying shapes using a 2D cartesian plane
* Added support for indexing geometries stored in GeoJSON format
* Added support for indexing points stored as key-value objects
* Added ```SpatialIndexes``` property to IndexDefinition
* Updated AbstractIndexCreationTask, so that spatial indexes are defined like so:

```
public class MySpatialIndex : AbstractIndexCreationTask
{
public MySpatialIndex()
{
Map = docs =>	from doc in docs
select new {
doc.Name,
doc.WKT,
CartesianWKT = doc.WKT
};

Spatial(x => x.WKT, x => x.Geography(maxTreeLevel:12, strategy: SpatialSearchStrategy.GeohashPrefixTree));

Spatial("CartesianWKT", x => x.Cartesian(minX:0, maxX:2000, minY:0, maxY:2000, maxTreeLevel:12));
}
}
```

I also plan to port the WKT reader from my Geo library, as it supports a wider range of WKT syntax than the one shipped with NTS.