Package org.apache.lucene.spatial.prefix.tree

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


  @Test
  public void test30() throws ParseException {
    SpatialContext ctx = SpatialContext.GEO;
    int maxLevels = 11;
    SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels);
    RecursivePrefixTreeStrategy strategy = new RecursivePrefixTreeStrategy(grid, "a.id_gis");
    Circle circle = ctx.makeCircle(-80.0, 33.0, DistanceUtils.dist2Degrees(10, DistanceUtils.EARTH_MEAN_RADIUS_MI));
    SpatialArgs args = new SpatialArgs(SpatialOperation.Intersects, circle);

    Query q1 = sq(strategy.makeQuery(args));
View Full Code Here


  public void setupGeohashGrid(int maxLevels) {
    this.ctx = SpatialContext.GEO;
    //A fairly shallow grid, and default 2.5% distErrPct
    if (maxLevels == -1)
      maxLevels = randomIntBetween(1, 3);//max 16k cells (32^3)
    this.grid = new GeohashPrefixTree(ctx, maxLevels);
    this.strategy = new RecursivePrefixTreeStrategy(grid, getClass().getSimpleName());
  }
View Full Code Here

    this.solrServer = server;
    this.docDef = def;

    int maxLevels = 11;// results in sub-meter precision for geohash
    // This can also be constructed from SpatialPrefixTreeFactory
    grid = new GeohashPrefixTree(SpatialQuery.ctx, maxLevels);

    this.strategy = new RecursivePrefixTreeStrategy(grid, def.getGeoField());
  }
View Full Code Here

    this.directory = directory;
    this.docDef = def;

    int maxLevels = 11;// results in sub-meter precision for geohash
    // This can also be constructed from SpatialPrefixTreeFactory
    SpatialPrefixTree grid = new GeohashPrefixTree(SpatialQuery.ctx, maxLevels);

    this.strategy = new RecursivePrefixTreeStrategy(grid, def.getGeoField());

    //this.strategy = new PointVectorStrategy(ctx, def.getGeoField());
   
View Full Code Here

    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");
    ctorArgs.add(new Object[]{new Param(strategy)});

    strategy = new PointVectorStrategy(ctx, "pointvector");
    ctorArgs.add(new Object[]{new Param(strategy)});
View Full Code Here

    this.ctx = SpatialContext.GEO;

    int maxLevels = 11;//results in sub-meter precision for geohash
    //TODO demo lookup by detail distance
    //  This can also be constructed from SpatialPrefixTreeFactory
    SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels);

    this.strategy = new RecursivePrefixTreeStrategy(grid, "myGeoField");

    this.directory = new RAMDirectory();
  }
View Full Code Here

  public GeoProperty(Property prop) {
    this.prop = prop;
    this.spatialctx = SpatialContext.GEO;

    int maxlevels = 11; // FIXME: how to compute?
    GeohashPrefixTree grid = new GeohashPrefixTree(spatialctx, maxlevels);
    this.strategy = new RecursivePrefixTreeStrategy(grid, prop.getName());
  }
View Full Code Here

    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");
    ctorArgs.add(new Object[]{new Param(strategy)});

    strategy = new PointVectorStrategy(ctx, "pointvector");
    ctorArgs.add(new Object[]{new Param(strategy)});
View Full Code Here

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

    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");
    ctorArgs.add(new Object[]{new Param(strategy)});

    strategy = new PointVectorStrategy(ctx, "pointvector");
    ctorArgs.add(new Object[]{new Param(strategy)});
View Full Code Here

    this.ctx = SpatialContext.GEO;

    int maxLevels = 11;//results in sub-meter precision for geohash
    //TODO demo lookup by detail distance
    //  This can also be constructed from SpatialPrefixTreeFactory
    SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels);

    this.strategy = new RecursivePrefixTreeStrategy(grid, "myGeoField");

    this.directory = new RAMDirectory();
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree

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.