Class PolygonOnGrid
java.lang.Object
io.nosqlbench.datamappers.functions.geometry.PolygonOnGrid
- All Implemented Interfaces:
LongFunction<com.datastax.dse.driver.api.core.data.geometry.Polygon>
public class PolygonOnGrid
extends Object
implements LongFunction<com.datastax.dse.driver.api.core.data.geometry.Polygon>
This function will return a polygon in the form of a rectangle from the specified
grid system. The coordinates define the top left and bottom right coordinates in
(x1,y1),(x2,y2) order, while the number of rows and columns divides these ranges
into the unit-length for each square.
x1 must be greater than x2. y1 must be less than y2.
This grid system can be used to construct a set of overlapping grids such that the
likelyhood of overlap is somewhat easy to reason about. For example, if you create
one grid system as a refernce grid, then attempt to map another grid system which
half overlaps the original grid, you can easily determine that half the time, a
random rectangle selected from the second grid will overlap a rectangle from the
first, for simple even-numbered grids and the expected uniform sampling on the
internal coordinate selector functions.
-
Constructor Summary
ConstructorsConstructorDescriptionPolygonOnGrid(double x_topleft, double y_topleft, double x_bottomright, double y_bottomright, int rows, int columns) -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.dse.driver.api.core.data.geometry.Polygonapply(long value)
-
Constructor Details
-
PolygonOnGrid
public PolygonOnGrid(double x_topleft, double y_topleft, double x_bottomright, double y_bottomright, int rows, int columns)
-
-
Method Details
-
apply
public com.datastax.dse.driver.api.core.data.geometry.Polygon apply(long value) - Specified by:
applyin interfaceLongFunction<com.datastax.dse.driver.api.core.data.geometry.Polygon>
-