public class JGrassMapEnvironment extends Object
Given a map file path, all the related files to that map in the GRASS Location/Mapset are defined.
JGrassConstants}
,
JGrassRegion}
Modifier and Type | Field and Description |
---|---|
static double |
defaultMapMax
A maximum value to be used when no range is available for a map.
|
static double |
defaultMapMin
A minimum value to be used when no range is available for a map.
|
Constructor and Description |
---|
JGrassMapEnvironment(File cellFile)
Constructs an instance of JGrassMapEnvironment.
|
JGrassMapEnvironment(File mapsetFile,
String mapName)
Constructs an instance of JGrassMapEnvironment.
|
Modifier and Type | Method and Description |
---|---|
JGrassRegion |
getActiveRegion()
Read the
JGrassRegion from the active region file. |
List<String> |
getCategories()
Reads the categories for the map wrapped by this
JGrassMapEnvironment . |
String |
getCategoriesString()
Getter for the categories string.
|
File |
getCATS()
Getter for CATS file.
|
File |
getCatsFolder()
Getter for CATS folder.
|
File |
getCELL()
Getter for CELL file, i.e. the main map file.
|
File |
getCellFolder()
Getter for CELL folder.
|
File |
getCELLHD()
Getter for CELLHD file.
|
File |
getCELLMISC_FORMAT()
Getter for CELLMISC_FORMAT file.
|
File |
getCELLMISC_NULL()
Getter for CELLMISC_NULL file.
|
File |
getCELLMISC_QUANT()
Getter for CELLMISC_QUANT file.
|
File |
getCELLMISC_RANGE()
Getter for CELLMISC_RANGE file.
|
List<String> |
getColorRules(double[] range)
Read the colorrules for the map wrapped by this
JGrassMapEnvironment . |
File |
getCOLR()
Getter for COLR file.
|
File |
getColrFolder()
Getter for COLR folder.
|
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Read the
crs from the location. |
File |
getDEFAULT_WIND()
Getter for DEFAULT_WIND file.
|
File |
getFCELL()
Getter for FCELL file.
|
File |
getFcellFolder()
Getter for FCELL folder.
|
JGrassRegion |
getFileRegion()
Read the file region of the map.
|
File |
getHIST()
Getter for the history file.
|
String |
getLegendString()
Getter for the legend string.
|
File |
getLOCATION()
Getter for LOCATION folder.
|
File |
getMapFile()
Getter for the main map file.
|
String |
getMapName()
Getter for mapName.
|
File |
getMAPSET()
Getter for MAPSET folder.
|
File |
getPERMANENT_MAPSET()
Getter for PERMANENT MAPSET folder.
|
File |
getPROJ_INFO()
Getter for PROJ_INFO file.
|
File |
getPROJ_UNITS()
Getter for PROJ_UNITS file.
|
File |
getPROJ_WKT()
Getter for PROJ_WKT file.
|
double[] |
getRangeFromColorTable()
Reads the data range from a color table file, if existing.
|
double[] |
getRangeFromMapScan()
Reads the data range by reading the map.
|
double[] |
getRangeFromRangeFile()
Reads the data range from the GRASS range file.
|
JGrassMapEnvironment |
getRECLASSEDENVIRONMENT()
Getter for RECLASSEDENVIRONMENT.
|
File |
getWIND()
Getter for WIND file.
|
void |
setReclassed(String reclassedMapset,
String reclassedMap)
Reclasses the environment.
|
public static double defaultMapMin
public static double defaultMapMax
public JGrassMapEnvironment(File cellFile)
cellFile
- the absolute path to a grass raster map, through which the environment is
defined.public JGrassMapEnvironment(File mapsetFile, String mapName)
This constructor is a facility method in the case the mapset file and the name of the GRASS raster map are passed.
mapsetFile
- file of the mapset pathmapName
- name of the GRASS raster mappublic void setReclassed(String reclassedMapset, String reclassedMap)
In the case a reclassed map was found, this method has to be called, in order to set the current environment to the new reclassed one.
reclassedMapset
- the name of the mapset holding the reclassed mapreclassedMap
- the name of the reclassed mappublic String getMapName()
public File getPERMANENT_MAPSET()
public File getMAPSET()
public File getLOCATION()
public File getDEFAULT_WIND()
public File getPROJ_INFO()
public File getPROJ_WKT()
public File getPROJ_UNITS()
public File getWIND()
public File getFCELL()
public File getFcellFolder()
public File getCELL()
public File getMapFile()
public File getCellFolder()
public File getCATS()
public File getCatsFolder()
public File getHIST()
public File getCELLHD()
public File getCOLR()
public File getColrFolder()
public File getCELLMISC_FORMAT()
public File getCELLMISC_QUANT()
public File getCELLMISC_RANGE()
public File getCELLMISC_NULL()
public JGrassMapEnvironment getRECLASSEDENVIRONMENT()
public List<String> getColorRules(double[] range) throws IOException
JGrassMapEnvironment
.range
- the range to use for the default colortable, in the case of missing color file.
Can be null.List
of color rules in string format.IOException
public List<String> getCategories() throws IOException
JGrassMapEnvironment
.
The categories are returned in a List
of strings that may be of two types:
IOException
public JGrassRegion getActiveRegion() throws IOException
JGrassRegion
from the active region file.IOException
public double[] getRangeFromColorTable() throws IOException
IOException
public double[] getRangeFromRangeFile() throws IOException
IOException
public double[] getRangeFromMapScan() throws IOException
IOException
public String getLegendString() throws IOException
IOException
public String getCategoriesString() throws IOException
IOException
public CoordinateReferenceSystem getCoordinateReferenceSystem() throws Exception
crs
from the location.Exception
public JGrassRegion getFileRegion() throws IOException
JGrassRegion
of the file.IOException
Copyright © 1996–2019 Geotools. All rights reserved.