Class GrassRasterReader
- java.lang.Object
-
- org.hortonmachine.gears.io.grasslegacy.io.MapReader
-
- org.hortonmachine.gears.io.grasslegacy.io.GrassRasterReader
-
public class GrassRasterReader extends MapReader
This reads any native Raster map format. It supports integer, float and double and the transformation of any of those into int, float and double matrixes, as well as in the ByteBuffers of the same tipes.
- Since:
- 1.1.0
- Author:
- Andrea Antonello - www.hydrologis.com
-
-
Field Summary
-
Fields inherited from class org.hortonmachine.gears.io.grasslegacy.io.MapReader
COLOR, colorTable, DATA, dataObject, dataWindow, FEATURECOLLECTION, fileWindow, POINT_READER, RASTER_READER, readerType, VECTOR_READER
-
-
Constructor Summary
Constructors Constructor Description GrassRasterReader()Creates a new instance of GrassRasterReader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close the resource, deallocation whatever needed to be deallocatedStringgetLegendString()Create a string that defines how the legend will look.StringgetMapPath()Returns the path to the map relative to the mapset.ObjectgetNextData()ColorMapBuffergetNextDataColor(int attColor)double[]getRange()retrieve the range values of the mapvoidhasChanged(boolean _haschanged)booleanhasMoreData(IHMProgressMonitor monitor)AttributeTableloadAttributeTable(String themapsetPath, String thefilename)booleanopen(String mapPath)Open the resourcebooleanopen(String fileName, String locationPath, String mapsetName)Open the resourcevoidsetOutputDataObject(Object _dataObject)Define the output data object.voidsetParameter(String key, Object obj)utility to set particular parameters-
Methods inherited from class org.hortonmachine.gears.io.grasslegacy.io.MapReader
getColorTable, getDataWindow, getMapWindow, getOutputDataObject, getParameter, getReaderType, setDataWindow, setReaderType
-
-
-
-
Method Detail
-
open
public boolean open(String mapPath)
Description copied from class:MapReaderOpen the resource
-
open
public boolean open(String fileName, String locationPath, String mapsetName)
Description copied from class:MapReaderOpen the resource
-
close
public void close()
Description copied from class:MapReaderclose the resource, deallocation whatever needed to be deallocated
-
loadAttributeTable
public AttributeTable loadAttributeTable(String themapsetPath, String thefilename)
-
hasMoreData
public boolean hasMoreData(IHMProgressMonitor monitor) throws Exception
- Specified by:
hasMoreDatain classMapReader- Parameters:
monitor- progressmonitor- Returns:
- true, if the resource has more data to read
- Throws:
Exception
-
getNextData
public Object getNextData()
- Specified by:
getNextDatain classMapReader- Returns:
- get the data object
-
getNextDataColor
public ColorMapBuffer getNextDataColor(int attColor)
- Specified by:
getNextDataColorin classMapReader- Returns:
- the data color
-
getLegendString
public String getLegendString() throws IOException
Create a string that defines how the legend will look.- Specified by:
getLegendStringin classMapReader- Returns:
- the string representing the legend
- Throws:
IOException
-
hasChanged
public void hasChanged(boolean _haschanged)
-
setParameter
public void setParameter(String key, Object obj)
utility to set particular parameters- Overrides:
setParameterin classMapReader
-
setOutputDataObject
public void setOutputDataObject(Object _dataObject)
Description copied from class:MapReaderDefine the output data object. The output data object is the kind of result that the reader will give. This can be for example:- when you need to elaborate the data, a double matrix, so the odo would be new double[][]
- when you need to visualize the data, a floatbuffer, so the odo would be new
FloatBuffer
- Overrides:
setOutputDataObjectin classMapReader- Parameters:
_dataObject- the output data object
-
getMapPath
public String getMapPath()
Returns the path to the map relative to the mapset.
-
-