public class GrassBinaryRasterWriteHandler extends Object implements Closeable
Reading and writing is supported.
GrassBinaryImageReader,
GrassBinaryImageReadParam,
GrassBinaryImageMetadata| Constructor and Description |
|---|
GrassBinaryRasterWriteHandler(File destMapset,
String newMapName,
ProgressListener monitor)
A constructor to build a
GrassBinaryRasterWriteHandler usable for writing grass
rasters. |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
sets the abortrequired flag to true.
|
void |
close()
Closes the I/O streams.
|
CoordinateReferenceSystem |
getCrs()
Reads the crs definition for the map.
|
double |
getNoData()
Getter for the noData value.
|
JGrassRegion |
getWriteRegion()
Calculates the region that is going to be written.
|
boolean |
isAborting()
Getter for the abortrequired flag.
|
void |
setNoData(double noData)
Setter for the noData value.
|
void |
setWriteRegion(JGrassRegion writeRegion) |
void |
writeRaster(RenderedImage renderedImage,
int columns,
int rows,
double west,
double south,
double xRes,
double yRes,
double noDataValue)
Writes the raster, given an raster iterator and region metadata.
|
public GrassBinaryRasterWriteHandler(File destMapset, String newMapName, ProgressListener monitor)
GrassBinaryRasterWriteHandler usable for writing grass
rasters.destMapset - the mapset file into which the map has to be written.newMapName - the name for the written map.public void writeRaster(RenderedImage renderedImage, int columns, int rows, double west, double south, double xRes, double yRes, double noDataValue) throws IOException
renderedImage - the RenderedImage to write.columns - the columns of the raster to write.rows - the rows of the raster to write.west - the western bound of the raster to write.south - the southern bound of the raster to write.xRes - the east-west resolution of the raster to write.yRes - the north-south resolution of the raster to write.noDataValue - the value representing noData.IOExceptionpublic JGrassRegion getWriteRegion() throws IOException
IOExceptionpublic void setWriteRegion(JGrassRegion writeRegion)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void setNoData(double noData)
noData - the nodata value to set.public double getNoData()
public CoordinateReferenceSystem getCrs() throws IOException
The definition for grass maps is held in the location. Grass projection definitions are usually in a non parsable internal format. In JGrass we ask the user to choose the CRS. If the user doesn't do so, the CRS will result to be undefined.
CoordinateReferenceSystem for the map. Null if it is not defined.IOException - if there were problems in parsing the CRS file.public void abort()
As soon as possible that should abort the reader.
public boolean isAborting()
Copyright © 1996–2021 Geotools. All rights reserved.