@Autowired
MongoTemplate template;
@Before public void setUp() {
// ensure geospatial index
template.indexOps(Location.class).ensureIndex( new GeospatialIndex("position") );
// prepare data
repo.save( new Location("A", 0.001, -0.002) );
repo.save( new Location("B", 1, 1) );
repo.save( new Location("C", 0.5, 0.5) );
repo.save( new Location("D", -0.5, -0.5) );