|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--GRASS.libgis
This class wraps functions of GIS library of GRASS. Programs must
use this class first to access the GRASS database. It provides
loading of the shared object that contains original GRASS routines
and initiats connection to specified GRASS database. This class
wraps original GRASS functions in the most simple and
straightforward manner and does not provide any object-oriented
abstraction in terms of GIS.
Side Effect: This class executes
System.runFinalizersOnExit(true) on initialization. You
can switch back after calling constructor of this class but it is
not safe.
libfun| Constructor Summary | |
libgis(java.lang.String appname)
Initializes GIS library for applications that run under GRASS. |
|
libgis(java.lang.String appname,
java.lang.String gisbase,
java.lang.String gisdbase,
java.lang.String location,
java.lang.String mapset)
Initializes GIS library for stand-alone applications (i.e. ones not running from beyond GRASS). |
|
| Method Summary | |
void |
close()
Deletes rc file if one was created. |
double |
G_area_of_cell_at_row(int row)
This routine returns the area in square meters of a cell in the specified row. |
int |
G_begin_cell_area_calculations()
This routine must be called once before any call to G_area_of_cell_at_row. |
java.lang.String |
G_database_projection_name()
Returns a string which is a printable name for projection in active region. |
java.lang.String |
G_database_unit_name(boolean plural)
Returns a string describing the database grid units. |
double |
G_database_units_to_meters_factor()
Returns a factor which converts the grid unit to meters (by multiplication). |
java.lang.String |
G_find_cell(java.lang.String name,
java.lang.String mapset)
Looks for raster file name in the database. |
java.lang.String |
G_find_sites(java.lang.String name,
java.lang.String mapset)
Looks for stes list name in the database. |
java.lang.String |
G_find_vector(java.lang.String name,
java.lang.String mapset)
Looks for vector file name in the database. |
FILE |
G_fopen_sites_new(java.lang.String name)
Creates an empty site list file name in the current mapset and opens it for writing. |
FILE |
G_fopen_sites_old(java.lang.String name,
java.lang.String mapset)
Opens the site list file name in mapset for reading. |
Cellhead |
G_get_default_window()
Reads the default region for the location. |
Cellhead |
G_get_set_window()
Gets the values of currently active region into a new Cellhead object. |
Cellhead |
G_get_window()
Reads the database region as stored in the WIND file in the user's current mapset. |
java.lang.String |
G_gisbase()
Returns the full path name of the top level directory for GRASS programs. |
java.lang.String |
G_gisdbase()
Returns the full UNIX path name of the directory which holds the database locations. |
java.lang.String |
G_location_path()
Returns the full UNIX path name of the current database location. |
java.lang.String |
G_location()
Returns the name of the current database location. |
java.lang.String |
G_mapset()
Returns the name of the current mapset in current location. |
java.lang.String |
G_myname()
Returns a one line title for the database location. |
FD |
G_open_cell_new_random(java.lang.String name)
Opens a new raster file for random writes by G_put_mpa_row. |
FD |
G_open_cell_new(java.lang.String name)
Opens a new raster file. |
FD |
G_open_cell_old(java.lang.String name,
java.lang.String mapset)
Opens existing raster file. |
int |
G_projection()
This routine returns a code indicating the projection for the active region. |
void |
G_put_window(Cellhead ch)
Writes the database region file (WIND) in the user's current mapset from cellhead. |
Categories |
G_read_cats(java.lang.String name,
java.lang.String mapset)
The category file for raster file name in mapset is read into the this object. |
Categories |
G_read_vector_cats(java.lang.String name,
java.lang.String mapset)
The category file for vector file name in mapset is read into the new Categories object. |
void |
G_set_window(Cellhead ch)
Sets the active region using parameters in Cellhead. |
void |
G_sleep_on_error(boolean flag)
Sets/unsets pause on errors. |
void |
G_suppress_warnings(boolean flag)
Sets/unsets reporting warnings. |
int |
G_window_cols()
Returns the number of columns in the active program region. |
int |
G_window_rows()
Returns the number of rows in the active program region. |
int |
G_zone()
This routine returns the zone for the active region. |
java.lang.String |
getGISRC()
Returns the name of GISRC file created by this class. |
int |
getpid()
Returns the process ID of the process. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public libgis(java.lang.String appname,
java.lang.String gisbase,
java.lang.String gisdbase,
java.lang.String location,
java.lang.String mapset)
throws GRASSException
appname - Application name, one that can be obtained in C
from argv[0]gisbase - Location of GRASS executable files. Same as value
of GISBASE environmental variable while running GRASS.gisdbase - Full path to GRASS database. Same as value
of GISDBASE environmental variable while running GRASS.location - Location name in GRASS database. Same as value
of LOCATION_NAME environmental variable while running
GRASS.mapset - Mapset name in GRASS database under specified location.
Same as value of MAPSET environmental variable while
running GRASS.
public libgis(java.lang.String appname)
throws GRASSException
appname - Application name, one that can be obtained in C
from argv[0]| Method Detail |
public int getpid()
pid_t getpid(void);
public java.lang.String getGISRC()
public void G_sleep_on_error(boolean flag)
G_sleep_on_error (flag)
int flag;
See the GRASS 4.2 Programmer's Manual,
Section 12.3 Diagnostic messagesflag - Pause flag: false -- no pause on errors; true --
pause will occur.public void G_suppress_warnings(boolean flag)
G_suppress_warnings (flag)
int flag;
See the GRASS 4.2 Programmer's Manual,
Section 12.3 Diagnostic messagesflag - Warnings flag. false -- print warning messages, true --
suppress warnings.public java.lang.String G_location()
char * G_location ()See the GRASS 4.2 Programmer's Manual, Section 12.4 Environment and database information
public java.lang.String G_mapset()
char * G_mapset ()See the GRASS 4.2 Programmer's Manual, Section 12.4 Environment and database information
public java.lang.String G_myname()
char * G_myname ()See the GRASS 4.2 Programmer's Manual, Section 12.4 Environment and database information
public java.lang.String G_gisbase()
char * G_gisbase ()See the GRASS 4.2 Programmer's Manual, Section 12.4 Environment and database information
public java.lang.String G_gisdbase()
char * G_gisdbase ()See the GRASS 4.2 Programmer's Manual, Section 12.4 Environment and database information
public java.lang.String G_location_path()
char * G_location_path ()See the GRASS 4.2 Programmer's Manual, Section 12.4 Environment and database information
public Cellhead G_get_window()
G_get_window (region)
struct Cell_head *region;
See the GRASS 4.2 Programmer's Manual,
Section 12.7.1 The Database Regionpublic Cellhead G_get_default_window()
G_get_default_window (region)
struct Cell_head *region;
See the GRASS 4.2 Programmer's Manual,
Section 12.7.1 The Database Regionpublic int G_window_rows()
G_window_rows ()See the GRASS 4.2 Programmer's Manual, Section 12.7.2 The Active Program Region
public int G_window_cols()
G_window_cols ()See the GRASS 4.2 Programmer's Manual, Section 12.7.2 The Active Program Region
public void G_set_window(Cellhead ch)
throws GRASSException
G_set_window (region)
struct Cell_head *region;
See the GRASS 4.2 Programmer's Manual,
Section 12.7.2 The Active Program Regionch - Cellhead to use parameters to set region to.
public void G_put_window(Cellhead ch)
throws GRASSException
G_put_window (region)
struct Cell_head *region;
See the GRASS 4.2 Programmer's Manual,
Section 12.7.1 The Active DatabaseRegionch - Cellhead to use parameters to set region to.public Cellhead G_get_set_window()
G_get_set_window (region)
struct Cell_head *region;
See the GRASS 4.2 Programmer's Manual,
Section 12.7.2 The Active Program Regionpublic int G_begin_cell_area_calculations()
G_begin_cell_area_calculations ()See the GRASS 4.2 Programmer's Manual, Section 12.8 Raster Area Calculations
public double G_area_of_cell_at_row(int row)
double
G_area_of_cell_at_row (row)
int row ;
See the GRASS 4.2 Programmer's Manual,
Section 12.8 Raster Area Calculationsrow - row to return area at
public java.lang.String G_find_cell(java.lang.String name,
java.lang.String mapset)
throws GRASSException
char*
G_find_cell (name, mapset)
char *name;
char *mapset;
See the GRASS 4.2 Programmer's Manual,
Section 12.9.2 Finding Raster File in Databasename - Raster file name to search for.mapset - Name of mapset in which raster should reside. Can be empty
string which means search all the mapsets in the user's
current mapset search path.
public FD G_open_cell_old(java.lang.String name,
java.lang.String mapset)
throws GRASSException
G_open_cell_old (name, mapset)
char *name;
char *mapset;
See the GRASS 4.2 Programmer's Manual,
Section 12.9.3 Opening an Existing Raster Filename - Raster file name to open.mapset - Name of mapset in which raster should reside. It can be
obtained by calling G_find_cell.
public FD G_open_cell_new(java.lang.String name)
throws GRASSException
G_open_cell_new (name, mapset)
char *name;
char *mapset;
See the GRASS 4.2 Programmer's Manual,
Section 12.9.4 Creating and Opening Opening Raster Filesname - Raster file name to open.
public FD G_open_cell_new_random(java.lang.String name)
throws GRASSException
G_open_cell_new_random (name, mapset)
char *name;
char *mapset;
See the GRASS 4.2 Programmer's Manual,
Section 12.9.4 Creating and Opening Opening Raster Filesname - Raster file name to open.
public Categories G_read_cats(java.lang.String name,
java.lang.String mapset)
throws GRASSException
G_read_cats (name, mapset, cats)
char *name;
char *mapset;
struct Categories *cats;
See the GRASS 4.2 Programmer's Manual,
Section 12.10.2.1. Reading and Writing the Raster Category Filename - raster layer namemapset - mapset name
public Categories G_read_vector_cats(java.lang.String name,
java.lang.String mapset)
throws GRASSException
G_read_vector_cats (name, mapset, cats)
char *name;
char *mapset;
struct Categories *cats;
See the GRASS 4.2 Programmer's Manual,
Section 12.11.6 Vector Category Filename - vector layer namemapset - mapset name
public java.lang.String G_find_sites(java.lang.String name,
java.lang.String mapset)
throws GRASSException
name - Site list name to search for.mapset - Name of mapset in which sitelist should reside.
Can be empty
string which means search all the mapsets in the user's
current mapset search path.
public FILE G_fopen_sites_new(java.lang.String name)
throws GRASSException
FILE*
G_fopen_sites_new (name)
char *name;
See the GRASS 4.2 Programmer's Manual,
Section 12.12.2 Opening Site List Filesname - GRASS site list file name
public FILE G_fopen_sites_old(java.lang.String name,
java.lang.String mapset)
throws GRASSException
FILE *
G_fopen_sites_old (name, mapset)
char *name;
char *mapset;
See the GRASS 4.2 Programmer's Manual,
Section 12.12.2 Opening Site List Filesname - GRASS site list file namemapset - Name of mapset where site list file should reside
public java.lang.String G_find_vector(java.lang.String name,
java.lang.String mapset)
throws GRASSException
char*
G_find_vector (name, mapset)
char *name;
char *mapset;
See the GRASS 4.2 Programmer's Manual,
Section 12.11.2 Finding Vector File in Databasename - Vector file name to search for.mapset - Name of mapset in which vector should reside. Can be empty
string which means search all the mapsets in the user's
current mapset search path.public int G_projection()
| Code | Projection |
|---|---|
| 0 | unreferenced x,y (imagery data) |
| 1 | UTM |
| 2 | State Plane |
| 3 | Latitude-Longitude |
G_projection ( )See the GRASS 4.2 Programmer's Manual, Section 12.7.3 Projection information
public java.lang.String G_database_projection_name()
char* G_database_projection_name ()See the GRASS 4.2 Programmer's Manual, Section 12.7.3 Projection information
public java.lang.String G_database_unit_name(boolean plural)
char *
G_database_unit_name (plural)
int plural
See the GRASS 4.2 Programmer's Manual,
Section 12.7.3 Projection informationplural - return a plural form (eg. feet) if true.public double G_database_units_to_meters_factor()
double
G_database_units_to_meters_factor ()
See the GRASS 4.2 Programmer's Manual,
Section 12.7.3 Projection informationpublic int G_zone()
G_zone ()See the GRASS 4.2 Programmer's Manual, Section 12.7.3 Projection information
public void close()
throws GRASSException
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||