Examples of QuadPrefixTree


Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

    SpatialContext ctx = SpatialContext.GEO;
    SpatialPrefixTree grid;
    SpatialStrategy strategy;

    grid = new QuadPrefixTree(ctx,25);
    strategy = new RecursivePrefixTreeStrategy(grid, "recursive_quad");
    ctorArgs.add(new Object[]{new Param(strategy)});

    grid = new GeohashPrefixTree(ctx,12);
    strategy = new TermQueryPrefixTreeStrategy(grid, "termquery_geohash");
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

public class TestTermQueryPrefixGridStrategy extends SpatialTestCase {

  @Test
  public void testNGramPrefixGridLosAngeles() throws IOException {
    SpatialContext ctx = SpatialContext.GEO;
    TermQueryPrefixTreeStrategy prefixGridStrategy = new TermQueryPrefixTreeStrategy(new QuadPrefixTree(ctx), "geo");

    Shape point = ctx.makePoint(-118.243680, 34.052230);

    Document losAngeles = new Document();
    losAngeles.add(new StringField("name", "Los Angeles", Field.Store.YES));
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

  private final SpatialContext ctx = SpatialContext.GEO;

  @Test
  public void testEqualsHashCode() {

    final SpatialPrefixTree grid = new QuadPrefixTree(ctx,10);
    final SpatialArgs args1 = makeArgs1();
    final SpatialArgs args2 = makeArgs2();

    Collection<ObjGenerator> generators = new ArrayList<ObjGenerator>();
    generators.add(new ObjGenerator() {
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

    // the prospect of edge conditions we want to test, plus makes for simpler numbers (no decimals).
    this.ctx = new SpatialContext(false, null, new RectangleImpl(0, 256, -128, 128, null));
    //A fairly shallow grid, and default 2.5% distErrPct
    if (maxLevels == -1)
      maxLevels = randomIntBetween(1, 8);
    this.grid = new QuadPrefixTree(ctx, maxLevels);
    this.strategy = new RecursivePrefixTreeStrategy(grid, getClass().getSimpleName());
    //((PrefixTreeStrategy) strategy).setDistErrPct(0);//fully precise to grid

    System.out.println("Strategy: " + strategy.toString());
  }
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

  @Test
  public void testBadPrefixTreePrune() throws Exception {
 
    Shape area = ctx.readShape("POLYGON((-122.83 48.57, -122.77 48.56, -122.79 48.53, -122.83 48.57))");
   
    SpatialPrefixTree trie = new QuadPrefixTree(ctx, 12);
    TermQueryPrefixTreeStrategy strategy = new TermQueryPrefixTreeStrategy(trie, "geo");
    Document doc = new Document();
    doc.add(new TextField("id", "1", Store.YES));

    Field[] fields = strategy.createIndexableFields(area, 0.025);
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

    grid = new GeohashPrefixTree(ctx,12);
    strategy = new RecursivePrefixTreeStrategy(grid, "recursive_geohash");
    ctorArgs.add(new Object[]{new Param(strategy)});

    grid = new QuadPrefixTree(ctx,25);
    strategy = new RecursivePrefixTreeStrategy(grid, "recursive_quad");
    ctorArgs.add(new Object[]{new Param(strategy)});

    grid = new GeohashPrefixTree(ctx,12);
    strategy = new TermQueryPrefixTreeStrategy(grid, "termquery_geohash");
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

    SpatialContext ctx = SpatialContext.GEO;
    SpatialPrefixTree grid;
    SpatialStrategy strategy;

    grid = new QuadPrefixTree(ctx,25);
    strategy = new RecursivePrefixTreeStrategy(grid, "recursive_quad");
    ctorArgs.add(new Object[]{new Param(strategy)});

    grid = new GeohashPrefixTree(ctx,12);
    strategy = new TermQueryPrefixTreeStrategy(grid, "termquery_geohash");
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

  private final SpatialContext ctx = SpatialContext.GEO;

  @Test
  public void testEqualsHashCode() {

    final SpatialPrefixTree gridQuad = new QuadPrefixTree(ctx,10);
    final SpatialPrefixTree gridGeohash = new GeohashPrefixTree(ctx,10);

    Collection<SpatialStrategy> strategies = new ArrayList<SpatialStrategy>();
    strategies.add(new RecursivePrefixTreeStrategy(gridGeohash, "recursive_geohash"));
    strategies.add(new TermQueryPrefixTreeStrategy(gridQuad, "termquery_quad"));
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

    factory.worldBounds = new RectangleImpl(0, 256, -128, 128, null);
    this.ctx = factory.newSpatialContext();
    //A fairly shallow grid, and default 2.5% distErrPct
    if (maxLevels == -1)
      maxLevels = randomIntBetween(1, 8);//max 64k cells (4^8), also 256*256
    this.grid = new QuadPrefixTree(ctx, maxLevels);
    this.strategy = new RecursivePrefixTreeStrategy(grid, getClass().getSimpleName());
  }
View Full Code Here

Examples of org.apache.lucene.spatial.prefix.tree.QuadPrefixTree

  @Test
  public void testBadPrefixTreePrune() throws Exception {
 
    Shape area = ctx.readShapeFromWkt("POLYGON((-122.83 48.57, -122.77 48.56, -122.79 48.53, -122.83 48.57))");
   
    SpatialPrefixTree trie = new QuadPrefixTree(ctx, 12);
    TermQueryPrefixTreeStrategy strategy = new TermQueryPrefixTreeStrategy(trie, "geo");
    Document doc = new Document();
    doc.add(new TextField("id", "1", Store.YES));

    Field[] fields = strategy.createIndexableFields(area, 0.025);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.