Class GridLocation
- All Implemented Interfaces:
ReferencingLocation
,Serializable
,scala.Equals
,scala.Product
,scala.Serializable
A grid is defined in terms of a base rectangle and a number of rows and columns. The number of rows and columns describe how the base rectangle is replicated to define the grid. It is multiplied to the north by the the number of rows and to the east by the number of columns.
For example (X
denotes the base rectangle):
North (rows) ^ | +-----+-----+ | 3 | | | | +-----+-----+ | 2 | | | | +-----+-----+ | 1 |XXXXX| | | +-----+-----+ | 1 2 +-------------------> East (columns)
param: rows The number of rows in the grid. param: columns The number of columns in the grid.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGridLocation
(double northLatitude, double southLatitude, double eastLongitude, double westLongitude, int rows, int columns) GridLocation
(BoundingBoxHolder box, int rows, int columns) -
Method Summary
Modifier and TypeMethodDescriptionstatic <BB> GridLocation
apply
(BB box, int rows, int columns, BoundingBoxOperations<BB> evidence$4) int
columns()
static <BB> GridLocation
create
(BB box, int rows, int columns, BoundingBoxAdapter<BB> adapter) double
int
double
double
getRectangles
(GeoProjection projection) Returns all rectangles that are part of this grid.int
getRows()
double
double
double
scala.collection.IndexedSeq<scala.collection.IndexedSeq<RectangleLocation>>
rectangles
(GeoProjection projection) Returns all rectangles that are part of this grid.int
rows()
double
double
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface scala.Equals
canEqual, equals
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
-
Constructor Details
-
GridLocation
public GridLocation(double northLatitude, double southLatitude, double eastLongitude, double westLongitude, int rows, int columns) -
GridLocation
-
-
Method Details
-
create
public static <BB> GridLocation create(BB box, int rows, int columns, BoundingBoxAdapter<BB> adapter) -
apply
public static <BB> GridLocation apply(BB box, int rows, int columns, BoundingBoxOperations<BB> evidence$4) -
northLatitude
public double northLatitude() -
southLatitude
public double southLatitude() -
eastLongitude
public double eastLongitude() -
westLongitude
public double westLongitude() -
rows
public int rows() -
columns
public int columns() -
baseRectangle
-
rectangles
public scala.collection.IndexedSeq<scala.collection.IndexedSeq<RectangleLocation>> rectangles(GeoProjection projection) Returns all rectangles that are part of this grid.The coordinates of the remaining rectangles are calculated using the base rectangles as the reference. The north-south and east-west distances of the base are calculated using the given
projection
. These distances and the projection are then used to extrapolate the base rectangles.Following the example in the class description, a list like
[ [(1,1), (1,2)], [(2,1), (2,2)], [(3,1), (3,2)] ]
would be returned.- Returns:
- A sequence containing one sequence for each row in this grid. The first sequence is the southernmost one. Each row sequence contains one rectangles per column, where the first is the westernmost.
-
getRows
public int getRows() -
getColumns
public int getColumns() -
getNorthLatitude
public double getNorthLatitude() -
getSouthLatitude
public double getSouthLatitude() -
getEastLongitude
public double getEastLongitude() -
getWestLongitude
public double getWestLongitude() -
getBaseRectangle
-
getRectangles
Returns all rectangles that are part of this grid.The coordinates of the remaining rectangles are calculated using the base rectangles as the reference. The north-south and east-west distances of the base are calculated using the given
projection
. These distances and the projection are then used to extrapolate the base rectangles.Following the example in the class description, a list like
[ [(1,1), (1,2)], [(2,1), (2,2)], [(3,1), (3,2)] ]
would be returned.- Returns:
- A sequence containing one sequence for each row in this grid. The first sequence is the southernmost one. Each row sequence contains one rectangles per column, where the first is the westernmost.
-