Package org.apache.lucene.spatial.query

Examples of org.apache.lucene.spatial.query.SpatialOperation


   */
  public DisjointSpatialFilter(SpatialStrategy strategy, SpatialArgs args, String field) {
    this.field = field;

    // TODO consider making SpatialArgs cloneable
    SpatialOperation origOp = args.getOperation();//copy so we can restore
    args.setOperation(SpatialOperation.Intersects);//temporarily set to intersects
    intersectsFilter = strategy.makeFilter(args);
    args.setOperation(origOp);//restore so it looks like it was
  }
View Full Code Here


    return getClass().getSimpleName()+"(prefixGridScanLevel:"+prefixGridScanLevel+",SPG:("+ grid +"))";
  }

  @Override
  public Filter makeFilter(SpatialArgs args) {
    final SpatialOperation op = args.getOperation();
    if (op == SpatialOperation.IsDisjointTo)
      return new DisjointSpatialFilter(this, args, getFieldName());

    Shape shape = args.getShape();
    int detailLevel = grid.getLevelForDistance(args.resolveDistErr(ctx, distErrPct));
View Full Code Here

        false);//do not simplify indexed cells
  }

  @Override
  public Filter makeFilter(SpatialArgs args) {
    final SpatialOperation op = args.getOperation();
    if (op != SpatialOperation.Intersects)
      throw new UnsupportedSpatialOperation(op);

    Shape shape = args.getShape();
    int detailLevel = grid.getLevelForDistance(args.resolveDistErr(ctx, distErrPct));
View Full Code Here

    }

    ValueSource valueSource = null;

    Query spatial = null;
    SpatialOperation op = args.getOperation();

    if( SpatialOperation.is( op,
        SpatialOperation.BBoxWithin,
        SpatialOperation.BBoxIntersects ) ) {
        spatial = makeWithin(bbox);
View Full Code Here

  private void checkHitsBBox(Point pt, double distKM, int assertNumFound, int... assertIds) {
    _checkHits(true, pt, distKM, assertNumFound, assertIds);
  }

  private void _checkHits(boolean bbox, Point pt, double distKM, int assertNumFound, int... assertIds) {
    SpatialOperation op = SpatialOperation.Intersects;
    double distDEG = DistanceUtils.dist2Degrees(distKM, DistanceUtils.EARTH_MEAN_RADIUS_KM);
    Shape shape = ctx.makeCircle(pt, distDEG);
    if (bbox)
      shape = shape.getBoundingBox();
View Full Code Here

TOP

Related Classes of org.apache.lucene.spatial.query.SpatialOperation

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.