Class JGrassRasterMapWriter
- java.lang.Object
-
- org.hortonmachine.gears.io.grasslegacy.map.JGrassRasterMapWriter
-
public class JGrassRasterMapWriter extends Object
Facility to write JGrass maps
- Since:
- 1.1.0
- Author:
- Andrea Antonello - www.hydrologis.com
-
-
Constructor Summary
Constructors Constructor Description JGrassRasterMapWriter(Window writeWindow, String mapPath, Object novalue, String mapType, IHMProgressMonitor monitor)Creates a jgrass raster map writer with some default valuesJGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, Object novalue, String mapType, IHMProgressMonitor monitor)Creates a jgrass raster map writer with some default valuesJGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, Object novalue, IHMProgressMonitor monitor)Creates a jgrass raster map writer with some default valuesJGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, String mapType, IHMProgressMonitor monitor)Creates a jgrass raster map writer with some default valuesJGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, IHMProgressMonitor monitor)Creates a jgrass raster map reader with some default values (data are read as double values, novalue is defaultGrassLegacyConstans.defaultNovalue).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloneCategoriesFromReader(JGrassRasterMapReader jgReader)voidcloneColorTableFromReader(JGrassRasterMapReader jgReader)voidclose()StringgetFullMapPath()booleanopen()Opens the raster map and does some first checkingbooleanwrite(RasterData rasterData)Write the rasterData to disk.
-
-
-
Constructor Detail
-
JGrassRasterMapWriter
public JGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, Object novalue, String mapType, IHMProgressMonitor monitor)
Creates a jgrass raster map writer with some default values
NOTE: This doesn't need a working udig environment to run. It just uses paths. Thought also for batch usage.
- Parameters:
writeWindow- the region to readmapName- the name of the mapmapsetName- the name of the mapsetlocationPath- the path to the location_novalue- the value to write as novaluemapType- the raster map type to read (ex.GrassLegacyConstans.GRASSBINARYRASTERMAP)monitor- a monitor object (if no monitro present,NullProgressMonitorcan be used)
-
JGrassRasterMapWriter
public JGrassRasterMapWriter(Window writeWindow, String mapPath, Object novalue, String mapType, IHMProgressMonitor monitor)
Creates a jgrass raster map writer with some default values
NOTE: This doesn't need a working udig environment to run. It just uses paths. Thought also for batch usage.
- Parameters:
writeWindow- the region to readmapName- the name of the mapmapsetName- the name of the mapsetlocationPath- the path to the location_novalue- the value to write as novaluemapType- the raster map type to read (ex.GrassLegacyConstans.GRASSBINARYRASTERMAP)monitor- a monitor object (if no monitro present,NullProgressMonitorcan be used)
-
JGrassRasterMapWriter
public JGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, Object novalue, IHMProgressMonitor monitor)
Creates a jgrass raster map writer with some default values
NOTE: This doesn't need a working udig environment to run. It just uses paths. Thought also for batch usage.
- Parameters:
writeWindow- the region to readmapName- the name of the mapmapsetName- the name of the mapsetlocationPath- the path to the location_novalue- the value to write as novaluemonitor- a monitor object (if no monitro present,NullProgressMonitorcan be used)
-
JGrassRasterMapWriter
public JGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, String mapType, IHMProgressMonitor monitor)
Creates a jgrass raster map writer with some default values
NOTE: This doesn't need a working udig environment to run. It just uses paths. Thought also for batch usage.
- Parameters:
writeWindow- the region to readmapName- the name of the mapmapsetName- the name of the mapsetlocationPath- the path to the locationmapType- the raster map type to read (ex.GrassLegacyConstans.GRASSBINARYRASTERMAP)monitor- a monitor object (if no monitro present,NullProgressMonitorcan be used)
-
JGrassRasterMapWriter
public JGrassRasterMapWriter(Window writeWindow, String mapName, String mapsetName, String locationPath, IHMProgressMonitor monitor)
Creates a jgrass raster map reader with some default values (data are read as double values, novalue is default
GrassLegacyConstans.defaultNovalue).NOTE: This doesn't need a working udig environment to run. It just uses paths. Thought also for batch usage.
- Parameters:
writeWindow- the region to readmapName- the name of the mapmapsetName- the name of the mapsetlocationPath- the path to the locationmonitor- a monitor object (if no monitro present,NullProgressMonitorcan be used)
-
-
Method Detail
-
open
public boolean open() throws RasterWritingFailureExceptionOpens the raster map and does some first checking
- Returns:
- true if everything went alright
- Throws:
RasterWritingFailureException
-
write
public boolean write(RasterData rasterData) throws RasterWritingFailureException
Write the rasterData to disk.
- Parameters:
rasterData-- Returns:
- true if everything went well
- Throws:
ExceptionRasterWritingFailureException
-
close
public void close()
-
getFullMapPath
public String getFullMapPath()
-
cloneColorTableFromReader
public void cloneColorTableFromReader(JGrassRasterMapReader jgReader) throws IOException
- Throws:
IOException
-
cloneCategoriesFromReader
public void cloneCategoriesFromReader(JGrassRasterMapReader jgReader) throws IOException
- Throws:
IOException
-
-