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

    Constructors
    Constructor
    Description
    PolygonOnGrid(double x_topleft, double y_topleft, double x_bottomright, double y_bottomright, int rows, int columns)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.datastax.dse.driver.api.core.data.geometry.Polygon
    apply(long value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      apply in interface LongFunction<com.datastax.dse.driver.api.core.data.geometry.Polygon>