Class GridCell


  • public class GridCell
    extends Object
    A grid cell.
    Author:
    Julien Gaffuri
    • Constructor Detail

      • GridCell

        public GridCell​(String id)
      • GridCell

        public GridCell​(String epsgCode,
                        int resolution,
                        int lowerLeftCornerPositionX,
                        int lowerLeftCornerPositionY)
    • Method Detail

      • getId

        public String getId()
      • getEpsgCode

        public String getEpsgCode()
      • getResolution

        public int getResolution()
      • getLowerLeftCornerPositionX

        public int getLowerLeftCornerPositionX()
      • getLowerLeftCornerPositionY

        public int getLowerLeftCornerPositionY()
      • getEnvelope

        public org.locationtech.jts.geom.Envelope getEnvelope()
        Returns:
        The grid cell envelope.
      • getPolygonGeometry

        public org.locationtech.jts.geom.Polygon getPolygonGeometry​(org.locationtech.jts.geom.GeometryFactory gf)
        Build grid cell geometry as a polygon.
        Parameters:
        gf -
        Returns:
      • getPointGeometry

        public org.locationtech.jts.geom.Point getPointGeometry​(org.locationtech.jts.geom.GeometryFactory gf)
        Build grid cell geometry as a point (its center point).
        Parameters:
        gf -
        Returns:
      • getGridCellId

        public static String getGridCellId​(String epsgCode,
                                           int gridResolutionM,
                                           org.locationtech.jts.geom.Coordinate lowerLeftCornerPosition)
        Build a cell code (according to INSPIRE coding system, see here). This is valid only for a grids in a cartographic projection. Examples: - CRS3035RES200mN1453400E1452800 - CRS3035RES100000mN5400000E1200000
        Parameters:
        epsgCode -
        gridResolutionM -
        lowerLeftCornerPosition - NB: The coordinates are supposed to be integer
        Returns:
      • getUpperCell

        public GridCell getUpperCell​(int resolution)
        Get the cell of the upper grid, whose resolution is the specified one. This target resolution is expected to be a multiple of the grid cell resolution.
        Parameters:
        resolution -
        Returns: