public static class BitSetQuadTreeFilter.FindIntersectingBitsOp extends BitSetQuadTreeFilter
BitSetQuadTreeFilter.FindIntersectingBitsOp
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Integer> |
intersectingBits |
bits, levelSizes, maxLevel, numLevels, path, powersOf4, stopped
Constructor and Description |
---|
FindIntersectingBitsOp(BitSetQuadTreeFilter filter)
Constructs a filter instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doOperation(int level,
int position,
double[] cellRegion,
double[] testSector)
Assembles the output bit-list during traversal.
|
java.util.List<java.lang.Integer> |
getOnBits(java.util.List<double[]> topRegions,
double[] testRegion,
java.util.List<java.lang.Integer> outIds)
Returns the bit positions of significant cells that intersect a specified sector.
|
java.util.List<java.lang.Integer> |
getOnBits(java.util.List<double[]> topRegions,
Sector testSector,
java.util.List<java.lang.Integer> outIds)
Returns the bit positions of significant cells that intersect a specified sector.
|
computeBitPosition, computeLevelSizes, getNumLevels, intersects, isStopped, start, stop, testAndDo
public FindIntersectingBitsOp(BitSetQuadTreeFilter filter)
filter
- a filter identifying significant cells in a quadtree, typically produced by applying a filter
that identifies quadtree cells associated with items.java.lang.NullPointerException
- if filter
is null.java.lang.IllegalArgumentException
- if filter
is invalid.protected boolean doOperation(int level, int position, double[] cellRegion, double[] testSector)
BitSetQuadTreeFilter.doOperation(int, int, double[], double[])
. See the description of that method for
further detail.doOperation
in class BitSetQuadTreeFilter
level
- the quadtree level currently being traversed.position
- the position of the cell in its parent cell, either 0, 1, 2, or 3. Cell positions starts
with 0 at the southwest corner of the parent cell and increment counter-clockwise: cell 1
is SE, cell 2 is NE and cell 3 is NW.cellRegion
- an array specifying the coordinates of the cell's region. The first two entries are the
minimum and maximum values on the Y axis (typically latitude). The last two entries are the
minimum and maximum values on the X axis, (typically longitude).testSector
- an array specifying the region or location of the intersecting item. If the array's length
is 2 then it represents a location in [latitude, longitude]. If its length is 4 it
represents a region, with the same layout as the nodeRegion
argument.public java.util.List<java.lang.Integer> getOnBits(java.util.List<double[]> topRegions, double[] testRegion, java.util.List<java.lang.Integer> outIds)
topRegions
- the zeroth-level regions of a quadtree.testRegion
- the sector of interest, specified as a four-element array containing minimum latitude,
maximum latitude, minimum longitude and maximum longitude, in that order. Significant cells
that intersect this sector are returned.outIds
- a list in which to place the bit positions of intersecting significant cells. May be null,
in which case a new list is created. In either case the list is the return value of the
method.outIds
argument, or a new list if that argument is null.java.lang.IllegalArgumentException
- if either topRegions
or testSector
is null.public java.util.List<java.lang.Integer> getOnBits(java.util.List<double[]> topRegions, Sector testSector, java.util.List<java.lang.Integer> outIds)
topRegions
- the zeroth-level regions of a quadtree.testSector
- the sector of interest. Significant cells that intersect this sector are returned.outIds
- a list in which to place the bit positions of intersecting significant cells. May be null,
in which case a new list is created. In either case the list is the return value of the
method.outIds
argument, or a new list if that argument is null.java.lang.IllegalArgumentException
- if either topRegions
or testSector
is null.