Class GridCell
- java.lang.Object
-
- eu.europa.ec.eurostat.jgiscotools.grid.GridCell
-
public class GridCell extends Object
A grid cell.- Author:
- Julien Gaffuri
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GridCell.GridCellGeometryType
The type of grid cell geometry: The surface representation (a square) or its center point.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.Envelope
getEnvelope()
String
getEpsgCode()
org.locationtech.jts.geom.Geometry
getGeometry(GridCell.GridCellGeometryType gt)
static String
getGridCellId(String epsgCode, int gridResolutionM, org.locationtech.jts.geom.Coordinate lowerLeftCornerPosition)
Build a cell code (according to INSPIRE coding system, see here).String
getId()
int
getLowerLeftCornerPositionX()
int
getLowerLeftCornerPositionY()
org.locationtech.jts.geom.Point
getPointGeometry(org.locationtech.jts.geom.GeometryFactory gf)
Build grid cell geometry as a point (its center point).org.locationtech.jts.geom.Polygon
getPolygonGeometry(org.locationtech.jts.geom.GeometryFactory gf)
Build grid cell geometry as a polygon.int
getResolution()
GridCell
getUpperCell(int resolution)
Get the cell of the upper grid, whose resolution is the specified one.Feature
toFeature(GridCell.GridCellGeometryType gt)
Convert the grid cell into a feature.
-
-
-
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.
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry(GridCell.GridCellGeometryType gt)
-
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:
-
toFeature
public Feature toFeature(GridCell.GridCellGeometryType gt)
Convert the grid cell into a feature.- Parameters:
gt
-- 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:
-
-