public class GeoavailabilityGrid
extends java.lang.Object
Constructor and Description |
---|
GeoavailabilityGrid(java.lang.String baseGeohash,
int precision) |
Modifier and Type | Method and Description |
---|---|
boolean |
addPoint(Coordinates coords)
Adds a new point to this GeoavailabilityGrid.
|
Point<java.lang.Integer> |
coordinatesToXY(Coordinates coords)
Converts a coordinate pair (defined with latitude, longitude in decimal
degrees) to an x, y location in the grid.
|
boolean |
equals(java.lang.Object obj) |
SpatialRange |
getBaseRange()
Retrieves the base SpatialRange that this GeoavailabilityGrid is
responsible for; the base range defines the geographic scope of this
GeoavailabilityGrid instance.
|
protected Bitmap |
getBitmap()
Retrieves the underlying Bitmap instance backing this
GeoavailabilityGrid.
|
int |
getHeight()
Retrieves the height of this GeoavailabilityGrid, in grid cells.
|
int |
getWidth()
Retrieves the width of this GeoavailabilityGrid, in grid cells.
|
int |
hashCode() |
SpatialRange |
indexToSpatialRange(int index)
Converts a bitmap index location to a corresponding SpatialRange that
the indexed grid point spans.
|
Point<java.lang.Integer> |
indexToXY(int index)
Converts a bitmap index to X, Y coordinates in the grid.
|
boolean |
intersects(GeoavailabilityQuery query)
Reports whether or not the supplied
GeoavailabilityQuery
instance intersects with the bits set in this geoavailability grid. |
int[] |
query(GeoavailabilityQuery query)
Queries the geoavailability grid, which involves performing a logical AND
operation and reporting the resulting Bitmap.
|
int |
XYtoIndex(int x,
int y)
Converts X, Y coordinates to a particular index within the underlying
bitmap implementation.
|
SpatialRange |
XYtoSpatialRange(int x,
int y)
Converts an X, Y grid point to the corresponding SpatialRange that the
grid point spans.
|
public Bitmap bmp
public GeoavailabilityGrid(java.lang.String baseGeohash, int precision)
public boolean addPoint(Coordinates coords)
coords
- The location (coordinates in lat, lon) to add.public Point<java.lang.Integer> coordinatesToXY(Coordinates coords)
coords
- the Coordinates to convert.public int XYtoIndex(int x, int y)
x
- The x coordinate to converty
- The y coorddinate to convertpublic Point<java.lang.Integer> indexToXY(int index)
public SpatialRange XYtoSpatialRange(int x, int y)
public SpatialRange indexToSpatialRange(int index)
public boolean intersects(GeoavailabilityQuery query) throws BitmapException
GeoavailabilityQuery
instance intersects with the bits set in this geoavailability grid. This
operation can be much faster than performing a full inspection of what
bits are actually set.query
- The query geometry to test for intersection.GeoavailabilityQuery
intersects with
the data in the geoavailability grid.BitmapException
public int[] query(GeoavailabilityQuery query) throws BitmapException
query
- The query geometry to evaluate against the geoavailability
grid.BitmapException
protected Bitmap getBitmap()
public int getWidth()
public int getHeight()
public SpatialRange getBaseRange()
SpatialRange
representing this GeoavailabilityGrid's
scope.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object