Package repast.simphony.space.gis
Class RasterLayer
java.lang.Object
repast.simphony.space.gis.RasterLayer
RasterLayer provides Repast ValueLayer like functionality using geographic
coordinates and can be displayed when part of a Geography instance. Contains
an instance of a WritableGridCoverage2D that allows read and write capabilities
on an underlying GridGoverage2D.
Current write capability is limited to a single band. The WritableGridCoverage2D
needs to be updated to allow multi-band writes.
TODO GIS provide multiple band write capability.
- Author:
- Eric Tatara
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRasterLayer
(String name, int width, int height, org.geotools.geometry.jts.ReferencedEnvelope envelope) RasterLayer
(String name, File rasterfile) RasterLayer
(String name, File rasterfile, boolean forceLonLatAxisOrder) Create the RasterLayer using a raster file.RasterLayer
(String name, org.geotools.coverage.grid.GridCoverage2D gridCoverage) Create the RasterLayer from the provided GridCoverage2D.RasterLayer
(org.geotools.coverage.grid.GridCoverage2D gridCoverage) -
Method Summary
Modifier and TypeMethodDescriptionorg.opengis.referencing.crs.CoordinateReferenceSystem
getCRS()
int
getDoubleGridValue
(int x, int y) double
getDoubleWorldValue
(double x, double y) int
getFloatGridValue
(int x, int y) float
getFloatWorldValue
(double x, double y) org.geotools.coverage.grid.GridCoverage2D
int
getIntegerGridValue
(int x, int y) int
getIntegerWorldValue
(double x, double y) getName()
int
getValue
(double x, double y) void
setCRS
(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Setting the layer CRS will project the coverage to the new CRS.void
setGridValue
(int x, int y, double value) void
setGridValue
(int x, int y, float value) void
setGridValue
(int x, int y, int value) void
setWorldValue
(double x, double y, double value) void
setWorldValue
(double x, double y, float value) void
setWorldValue
(double x, double y, int value)
-
Field Details
-
name
-
gridCoverage
-
-
Constructor Details
-
RasterLayer
Create the RasterLayer from the provided GridCoverage2D. This is useful when creating GridCoverage2D from other readers or data types.- Parameters:
name
-gridCoverage
-
-
RasterLayer
public RasterLayer(org.geotools.coverage.grid.GridCoverage2D gridCoverage) -
RasterLayer
-
RasterLayer
Create the RasterLayer using a raster file. The coverage returned by the file reader will be wrapped with a WritableGridCoverage instance so that this layer can be written to.- Parameters:
name
- the name of the GeoValueLayerrasterfile
- a georeferenced raster file such as GeoTifforceLonLatAxisOrder
- forces lon,lat coordinate order on read
-
RasterLayer
public RasterLayer(String name, int width, int height, org.geotools.geometry.jts.ReferencedEnvelope envelope)
-
-
Method Details
-
getCRS
public org.opengis.referencing.crs.CoordinateReferenceSystem getCRS() -
setCRS
public void setCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Setting the layer CRS will project the coverage to the new CRS.- Parameters:
crs
- target CoordinateReferenceSystem
-
getName
-
getGridCoverage
public org.geotools.coverage.grid.GridCoverage2D getGridCoverage() -
getNumBands
public int getNumBands() -
getValue
-
getIntegerGridValue
public int getIntegerGridValue(int x, int y) -
getFloatGridValue
public int getFloatGridValue(int x, int y) -
getDoubleGridValue
public int getDoubleGridValue(int x, int y) -
getIntegerWorldValue
public int getIntegerWorldValue(double x, double y) -
getFloatWorldValue
public float getFloatWorldValue(double x, double y) -
getDoubleWorldValue
public double getDoubleWorldValue(double x, double y) -
setWorldValue
public void setWorldValue(double x, double y, int value) -
setWorldValue
public void setWorldValue(double x, double y, float value) -
setWorldValue
public void setWorldValue(double x, double y, double value) -
setGridValue
public void setGridValue(int x, int y, int value) -
setGridValue
public void setGridValue(int x, int y, float value) -
setGridValue
public void setGridValue(int x, int y, double value)
-