Class GridLocation

java.lang.Object
com.here.platform.location.referencing.GridLocation
All Implemented Interfaces:
ReferencingLocation, Serializable, scala.Equals, scala.Product, scala.Serializable

public class GridLocation extends Object implements ReferencingLocation, scala.Product, scala.Serializable
A grid of rectangles.

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 Details

    • GridLocation

      public GridLocation(double northLatitude, double southLatitude, double eastLongitude, double westLongitude, int rows, int columns)
    • GridLocation

      public GridLocation(BoundingBoxHolder box, int rows, int columns)
  • 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

      public RectangleLocation 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

      public RectangleLocation getBaseRectangle()
    • getRectangles

      public List<List<RectangleLocation>> getRectangles(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.