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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRasterLayer(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.CoordinateReferenceSystemgetCRS()intgetDoubleGridValue(int x, int y) doublegetDoubleWorldValue(double x, double y) intgetFloatGridValue(int x, int y) floatgetFloatWorldValue(double x, double y) org.geotools.coverage.grid.GridCoverage2DintgetIntegerGridValue(int x, int y) intgetIntegerWorldValue(double x, double y) getName()intgetValue(double x, double y) voidsetCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Setting the layer CRS will project the coverage to the new CRS.voidsetGridValue(int x, int y, double value) voidsetGridValue(int x, int y, float value) voidsetGridValue(int x, int y, int value) voidsetWorldValue(double x, double y, double value) voidsetWorldValue(double x, double y, float value) voidsetWorldValue(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)
-