Package org.springframework.data.mongodb.core.geo

Examples of org.springframework.data.mongodb.core.geo.Box


    assertLocations(locations, "A", "C", "D");
  }

  @Test public void shouldFindWithinBox() {
    // when
    List<Location> locations = repo.findByPositionWithin(new Box(new Point(
        0.25, 0.25), new Point(1, 1)));

    // then
    assertLocations(locations, "B", "C");
  }
View Full Code Here


  public void shouldPerformRandomQueries() {
    long time_circle = 0;
    long time_box = 0;
    long singleRun = 0;
    Circle c;
    Box b;
    long n_circle = 0;
    long n_box = 0;
    List<Location> result;
   
    out( "Performing " + N_QUERIES + " queries ..." );
    for (int i = 0; i < N_QUERIES; i++) {
     
      double x = rnd(), y = rnd();
     
      // circle search
      c = new Circle( x, y, RADIUS);
      // box search
      b = new Box( new Point(x - HALF_BOX_WIDTH, y - HALF_BOX_WIDTH), new Point(x + HALF_BOX_WIDTH, y + HALF_BOX_WIDTH) );
     
      // perform circle query
      singleRun = System.currentTimeMillis();
      result = repo.findByPositionWithin(c);
      singleRun = System.currentTimeMillis() - singleRun;
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.core.geo.Box

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.