GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
#include <grass/config.h>
#include <stdarg.h>
#include <stdio.h>
#include <setjmp.h>
#include <sys/types.h>
#include <sys/stat.h>
Go to the source code of this file.
Macros | |
#define | G_alloca(n) G_malloc(n) |
#define | G_freea(p) G_free(p) |
#define | RELDIR "?" |
#define | G_incr_void_ptr(ptr, size) ((void *)((const unsigned char *)(ptr) + (size))) |
#define | G_malloc(n) G__malloc(RELDIR "/" __FILE__, __LINE__, (n)) |
#define | G_calloc(m, n) G__calloc(RELDIR "/" __FILE__, __LINE__, (m), (n)) |
#define | G_realloc(p, n) G__realloc(RELDIR "/" __FILE__, __LINE__, (p), (n)) |
Functions | |
void | G_adjust_Cell_head (struct Cell_head *, int, int) |
Adjust cell header. More... | |
void | G_adjust_Cell_head3 (struct Cell_head *, int, int, int) |
Adjust cell header for 3D values. More... | |
int | G_adjust_window_ll (struct Cell_head *cellhd) |
Adjust window for lat/lon. More... | |
void * | G__malloc (const char *, int, size_t) |
Memory allocation. More... | |
void * | G__calloc (const char *, int, size_t, size_t) |
Memory allocation. More... | |
void * | G__realloc (const char *, int, void *, size_t) |
Memory reallocation. More... | |
void | G_free (void *) |
Free allocated memory. More... | |
int | G_begin_cell_area_calculations (void) |
Begin cell area calculations. More... | |
double | G_area_of_cell_at_row (int) |
Cell area in specified row. More... | |
int | G_begin_polygon_area_calculations (void) |
Begin polygon area calculations. More... | |
double | G_area_of_polygon (const double *, const double *, int) |
Area in square meters of polygon. More... | |
void | G_begin_zone_area_on_ellipsoid (double, double, double) |
Begin area calculations for ellipsoid. More... | |
double | G_darea0_on_ellipsoid (double) |
Calculate integral for area between two latitudes. More... | |
double | G_area_for_zone_on_ellipsoid (double, double) |
Calculates area between latitudes. More... | |
void | G_begin_ellipsoid_polygon_area (double, double) |
Begin area calculations. More... | |
double | G_ellipsoid_polygon_area (const double *, const double *, int) |
Area of lat-long polygon. More... | |
double | G_planimetric_polygon_area (const double *, const double *, int) |
Calculates planimetric polygon area. More... | |
void | G_begin_zone_area_on_sphere (double, double) |
Initialize calculations for sphere. More... | |
double | G_darea0_on_sphere (double) |
Calculates integral for area between two latitudes. More... | |
double | G_area_for_zone_on_sphere (double, double) |
Calculates area between latitudes. More... | |
void | G_ascii_check (char *) |
Removes non-ascii characters from buffer. More... | |
int | G_vasprintf (char **, const char *, va_list) |
Safe replacement for asprintf(). More... | |
int | G_asprintf (char **, const char *,...) __attribute__((format(printf |
int int | G_rasprintf (char **, size_t *, const char *,...) __attribute__((format(printf |
int int int | G_aprintf (const char *,...) |
Adjust the width of string specifiers to the display space instead of the number of bytes for wide characters and print them formatted using the adjusted display width. More... | |
int | G_faprintf (FILE *, const char *,...) |
fprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
int | G_saprintf (char *, const char *,...) |
sprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
int | G_snaprintf (char *, size_t, const char *,...) |
snprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
int | G_vaprintf (const char *, va_list) |
vprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
int | G_vfaprintf (FILE *, const char *, va_list) |
vfprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
int | G_vsaprintf (char *, const char *, va_list) |
vsprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
int | G_vsnaprintf (char *, size_t, const char *, va_list) |
vsnprintf() version of G_aprintf(). See G_aprintf() for more details. More... | |
char * | G_basename (char *, const char *) |
Truncates filename to the base part (before the last '.') if it matches the extension, otherwise leaves it unchanged. More... | |
size_t | G_get_num_decimals (const char *) |
Get number of decimals from a string. More... | |
char * | G_double_to_basename_format (double, size_t, size_t) |
Convert a double to a string substituting the dot with underscore 12.3456 => '12_3456'. More... | |
char * | G_get_basename_separator () |
Return the environmental basename variable or the default value. More... | |
char * | G_join_basename_strings (const char **, size_t) |
join an array of strings using the basename separator More... | |
char * | G_generate_basename (const char *, double, size_t, size_t) |
Generate the format string. More... | |
void | G_bresenham_line (int, int, int, int, int(*)(int, int)) |
Bresenham line algorithm. More... | |
void | G_clicker (void) |
char * | G_color_rules_options (void) |
Get list of color rules for Option->options. More... | |
char * | G_color_rules_descriptions (void) |
Get color rules description for Option->descriptions. More... | |
char * | G_color_rules_description_type (void) |
Get color rules description for Option->descriptions. More... | |
void | G_list_color_rules (FILE *) |
Print color rules. More... | |
void | G_list_color_rules_description_type (FILE *, char *) |
Print color rules with description and type. More... | |
int | G_find_color_rule (const char *) |
Check if color rule is defined. More... | |
int | G_num_standard_colors (void) |
Get number of named colors (RGB triplets) More... | |
int | G_insert_commas (char *) |
Inserts commas into a number string. More... | |
void | G_remove_commas (char *) |
Removes commas from number string. More... | |
int | G_compressor_number (char *) |
char * | G_compressor_name (int) |
int | G_default_compressor (void) |
int | G_check_compressor (int) |
int | G_write_compressed (int, unsigned char *, int, int) |
int | G_write_unompressed (int, unsigned char *, int) |
int | G_read_compressed (int, int, unsigned char *, int, int) |
int | G_compress_bound (int, int) |
int | G_compress (unsigned char *, int, unsigned char *, int, int) |
int | G_expand (unsigned char *, int, unsigned char *, int, int) |
int | G_no_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_no_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_rle_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_rle_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_zlib_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_zlib_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_lz4_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_lz4_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_bz2_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_bz2_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_zstd_compress (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_zstd_expand (unsigned char *src, int src_sz, unsigned char *dst, int dst_sz) |
int | G_recursive_copy (const char *, const char *) |
Copy recursively source directory to destination directory. More... | |
int | G_copy_file (const char *, const char *) |
Copies one file to another. More... | |
int | G_is_initialized (int *) |
void | G_initialize_done (int *) |
void | G_init_counter (struct Counter *, int) |
int | G_counter_next (struct Counter *) |
const char * | G_date (void) |
Current date and time. More... | |
int | G_get_datum_by_name (const char *) |
const char * | G_datum_name (int) |
const char * | G_datum_description (int) |
const char * | G_datum_ellipsoid (int) |
int | G_get_datumparams_from_projinfo (const struct Key_Value *, char *, char *) |
void | G_read_datum_table (void) |
void | G_init_debug (void) |
Initiate debugging. More... | |
int | G_debug (int, const char *,...) __attribute__((format(printf |
int int | G_begin_distance_calculations (void) |
Begin distance calculations. More... | |
double | G_distance (double, double, double, double) |
Returns distance in meters. More... | |
double | G_distance_between_line_segments (double, double, double, double, double, double, double, double) |
Returns distance between two line segments in meters. More... | |
double | G_distance_point_to_line_segment (double, double, double, double, double, double) |
Returns distance between a point and line segment in meters. More... | |
void | G_done_msg (const char *,...) __attribute__((format(printf |
void int | G_is_little_endian (void) |
Tests for little ENDIAN. More... | |
void | G_init_env (void) |
Initialize variables. More... | |
const char * | G_getenv (const char *) |
Get environment variable. More... | |
const char * | G_getenv2 (const char *, int) |
Get variable from specific place. More... | |
const char * | G_getenv_nofatal (const char *) |
Get environment variable. More... | |
const char * | G_getenv_nofatal2 (const char *, int) |
Get environment variable from specific place. More... | |
void | G_setenv (const char *, const char *) |
Set environment variable (updates .gisrc) More... | |
void | G_setenv2 (const char *, const char *, int) |
Set environment variable from specific place (updates .gisrc) More... | |
void | G_setenv_nogisrc (const char *, const char *) |
Set environment name to value (doesn't update .gisrc) More... | |
void | G_setenv_nogisrc2 (const char *, const char *, int) |
Set environment name to value from specific place (doesn't update .gisrc) More... | |
void | G_unsetenv (const char *) |
Remove name from environment. More... | |
void | G_unsetenv2 (const char *, int) |
Remove name from environment from specific place. More... | |
const char * | G_get_env_name (int) |
Get variable name for index n. More... | |
void | G_set_gisrc_mode (int) |
Set where to find/store variables. More... | |
int | G_get_gisrc_mode (void) |
Get info where variables are stored. More... | |
void | G_create_alt_env (void) |
Set up alternative environment variables. More... | |
void | G_switch_env (void) |
Switch environments. More... | |
void | G__read_mapset_env (void) |
Force to read the mapset environment file VAR. More... | |
void | G__read_gisrc_env (void) |
Force to read the GISRC environment file. More... | |
void | G__read_gisrc_path (void) |
Read or read again the GISRC (session) environment variable. More... | |
jmp_buf * | G_fatal_longjmp (int) |
int | G_info_format (void) |
Get current message format. More... | |
void | G_message (const char *,...) __attribute__((format(printf |
void void | G_verbose_message (const char *,...) __attribute__((format(printf |
void void void | G_important_message (const char *,...) __attribute__((format(printf |
void void void void | G_fatal_error (const char *,...) __attribute__((format(printf |
void void void void | __attribute__ ((noreturn)) |
void | G_warning (const char *,...) __attribute__((format(printf |
void int | G_suppress_warnings (int) |
Suppress printing a warning message to stderr. More... | |
int | G_sleep_on_error (int) |
Turn on/off no_sleep flag. More... | |
void | G_set_error_routine (int(*)(const char *, int)) |
Establishes error_routine as the routine that will handle the printing of subsequent error messages. More... | |
void | G_unset_error_routine (void) |
After this call subsequent error messages will be handled in the default method. More... | |
void | G_init_logging (void) |
char * | G_file_name (char *, const char *, const char *, const char *) |
Builds full path names to GIS data files. More... | |
char * | G_file_name_misc (char *, const char *, const char *, const char *, const char *) |
Builds full path names to GIS misc data files. More... | |
char * | G_file_name_tmp (char *, const char *, const char *, const char *) |
Builds full path names to GIS data files in temporary directory (for internal use only) More... | |
const char * | G_find_file (const char *, char *, const char *) |
Searches for a file from the mapset search list or in a specified mapset. More... | |
const char * | G_find_file2 (const char *, const char *, const char *) |
Searches for a file from the mapset search list or in a specified mapset. (look but don't touch) More... | |
const char * | G_find_file_misc (const char *, const char *, char *, const char *) |
Searches for a misc file from the mapset search list or in a specified mapset. More... | |
const char * | G_find_file2_misc (const char *, const char *, const char *, const char *) |
Searches for a misc file from the mapset search list or in a specified mapset. (look but don't touch) More... | |
char * | G_find_etc (const char *) |
searches for a file from the etc search list in GRASS_ADDON_ETC returns the full path to where the file was found. More... | |
const char * | G_find_raster (char *, const char *) |
Find a raster map. More... | |
const char * | G_find_raster2 (const char *, const char *) |
Find a raster map (look but don't touch) More... | |
const char * | G_find_raster3d (const char *, const char *) |
Search for a 3D raster map in current search path or in a specified mapset. More... | |
const char * | G_find_vector (char *, const char *) |
Finds a vector map. More... | |
const char * | G_find_vector2 (const char *, const char *) |
Find a vector map (look but don't touch) More... | |
int | G_begin_geodesic_equation (double, double, double, double) |
double | G_geodesic_lat_from_lon (double) |
void | G_begin_geodesic_distance (double, double) |
Begin geodesic distance. More... | |
void | G_set_geodesic_distance_lat1 (double) |
Sets geodesic distance lat1. More... | |
void | G_set_geodesic_distance_lat2 (double) |
Sets geodesic distance lat2. More... | |
double | G_geodesic_distance_lon_to_lon (double, double) |
Calculates geodesic distance. More... | |
double | G_geodesic_distance (double, double, double, double) |
Calculates geodesic distance. More... | |
int | G_get_ellipsoid_parameters (double *, double *) |
get ellipsoid parameters More... | |
int | G_get_spheroid_by_name (const char *, double *, double *, double *) |
Get spheroid parameters by name. More... | |
int | G_get_ellipsoid_by_name (const char *, double *, double *) |
Get ellipsoid parameters by name. More... | |
const char * | G_ellipsoid_name (int) |
Get ellipsoid name. More... | |
const char * | G_ellipsoid_description (int) |
Get description for nth ellipsoid. More... | |
int | G_read_ellipsoid_table (int) |
Read ellipsoid table. More... | |
struct Key_Value * | G_get_projunits (void) |
Gets units information for location. More... | |
struct Key_Value * | G_get_projinfo (void) |
Gets projection information for location. More... | |
struct Key_Value * | G_get_projepsg (void) |
Gets EPSG information for the current location. More... | |
char * | G_get_projwkt (void) |
Get WKT information for the current location. More... | |
char * | G_get_projsrid (void) |
Get srid (spatial reference id) for the current location. More... | |
void | G_get_window (struct Cell_head *) |
Get the current region. More... | |
void | G_get_default_window (struct Cell_head *) |
Get the default region. More... | |
void | G_get_element_window (struct Cell_head *, const char *, const char *, const char *) |
Get region for selected element (raster, vector, window, etc.) More... | |
int | G_getl (char *, int, FILE *) |
Gets a line of text from a file. More... | |
int | G_getl2 (char *, int, FILE *) |
Gets a line of text from a file of any pedigree. More... | |
const char * | G_gisbase (void) |
Get full path name of the top level module directory. More... | |
const char * | G_gisdbase (void) |
Get name of top level database directory. More... | |
void | G__gisinit (const char *, const char *) |
Initialize GIS Library and ensures a valid mapset is available. More... | |
void | G__no_gisinit (const char *) |
Initialize GIS Library. More... | |
void | G_init_all (void) |
Initialize environment. More... | |
void | G_add_error_handler (void(*)(void *), void *) |
Add new error handler. More... | |
void | G_remove_error_handler (void(*)(void *), void *) |
Remove existing error handler. More... | |
const char * | G_home (void) |
Get user's home directory. More... | |
const char * | G_config_path (void) |
Get user's config path directory. More... | |
void | G_init_ilist (struct ilist *) |
Init an integer list and free allocated memory. More... | |
void | G_free_ilist (struct ilist *) |
Free allocated memory of an integer list. More... | |
struct ilist * | G_new_ilist () |
Return a new integer list. More... | |
void | G_ilist_add (struct ilist *, int) |
Add item to ilist. More... | |
int | G_intersect_line_segments (double, double, double, double, double, double, double, double, double *, double *, double *, double *) |
int | G_is_gisbase (const char *) |
Test if specified directory is GISBASE. More... | |
int | G_is_location (const char *) |
Test if specified directory is location. More... | |
int | G_is_mapset (const char *) |
Test if specified directory is mapset. More... | |
struct Key_Value * | G_create_key_value (void) |
Allocate and initialize Key_Value structure. More... | |
void | G_set_key_value (const char *, const char *, struct Key_Value *) |
Set value for given key. More... | |
const char * | G_find_key_value (const char *, const struct Key_Value *) |
Find given key (case sensitive) More... | |
void | G_free_key_value (struct Key_Value *) |
Free allocated Key_Value structure. More... | |
int | G_fwrite_key_value (FILE *, const struct Key_Value *) |
Write key/value pairs to file. More... | |
struct Key_Value * | G_fread_key_value (FILE *) |
Read key/values pairs from file. More... | |
void | G_write_key_value_file (const char *, const struct Key_Value *) |
Write key/value pairs to file. More... | |
struct Key_Value * | G_read_key_value_file (const char *) |
Read key/values pairs from file. More... | |
void | G_update_key_value_file (const char *, const char *, const char *) |
Update file, set up value for given key. More... | |
int | G_lookup_key_value_from_file (const char *, const char *, char[], int) |
Look up for key in file. More... | |
int | G_legal_filename (const char *) |
Check for legal database file name. More... | |
int | G_check_input_output_name (const char *, const char *, int) |
Check input and output file names. More... | |
void | G_set_distance_to_line_tolerance (double) |
double | G_distance2_point_to_line (double, double, double, double, double, double) |
void | G_list_element (const char *, const char *, const char *, int(*)(const char *, const char *, const char *)) |
General purpose list function. More... | |
char ** | G_list (int, const char *, const char *, const char *) |
List specified type of elements. Application must release the allocated memory. More... | |
void | G_free_list (char **) |
Free list. More... | |
void | G_lat_format (double, char *) |
const char * | G_lat_format_string (void) |
void | G_lon_format (double, char *) |
const char * | G_lon_format_string (void) |
void | G_llres_format (double, char *) |
const char * | G_llres_format_string (void) |
void | G_lat_parts (double, int *, int *, double *, char *) |
void | G_lon_parts (double, int *, int *, double *, char *) |
int | G_lat_scan (const char *, double *) |
int | G_lon_scan (const char *, double *) |
int | G_llres_scan (const char *, double *) |
const char * | G_location (void) |
Get current location name. More... | |
char * | G_location_path (void) |
Get current location UNIX-like path. More... | |
void | G_srand48 (long) |
Seed the pseudo-random number generator. More... | |
long | G_srand48_auto (void) |
Seed the pseudo-random number generator from the time and PID. More... | |
long | G_lrand48 (void) |
Generate an integer in the range [0, 2^31) More... | |
long | G_mrand48 (void) |
Generate an integer in the range [-2^31, 2^31) More... | |
double | G_drand48 (void) |
Generate a floating-point value in the range [0,1) More... | |
void | G_set_ls_filter (int(*)(const char *, void *), void *) |
void | G_set_ls_exclude_filter (int(*)(const char *, void *), void *) |
char ** | G_ls2 (const char *, int *) |
Stores a sorted directory listing in an array. More... | |
void | G_ls (const char *, FILE *) |
Prints a directory listing to a stream, in prettified column format. More... | |
void | G_ls_format (char **, int, int, FILE *) |
Prints a listing of items to a stream, in prettified column format. More... | |
void * | G_ls_regex_filter (const char *, int, int, int) |
void * | G_ls_glob_filter (const char *, int, int) |
void | G_free_ls_filter (void *) |
int | G_make_location (const char *, struct Cell_head *, const struct Key_Value *, const struct Key_Value *) |
Create a new location. More... | |
int | G_make_location_epsg (const char *, struct Cell_head *, const struct Key_Value *, const struct Key_Value *, const struct Key_Value *) |
Create a new location. More... | |
int | G_make_location_crs (const char *, struct Cell_head *, const struct Key_Value *, const struct Key_Value *, const char *, const char *) |
Create a new location. More... | |
int | G_write_projsrid (const char *, const char *) |
Write srid (spatial reference id) to file. More... | |
int | G_write_projwkt (const char *, const char *) |
Write WKT definition to file. More... | |
int | G_compare_projections (const struct Key_Value *, const struct Key_Value *, const struct Key_Value *, const struct Key_Value *) |
Compare projections including units. More... | |
int | G_make_mapset (const char *, const char *, const char *) |
Create a new mapset. More... | |
char * | G_tolcase (char *) |
convert string to lower case More... | |
char * | G_toucase (char *) |
convert string to upper case More... | |
const char * | G_mapset (void) |
Get current mapset name. More... | |
char * | G_mapset_path (void) |
Get current mapset UNIX-like path. More... | |
int | G_make_mapset_element (const char *) |
Create element in the current mapset. More... | |
int | G_make_mapset_element_tmp (const char *) |
Create element in the temporary directory. More... | |
int | G_make_mapset_object_group (const char *) |
Create directory for group of elements of a given type. More... | |
int | G_make_mapset_dir_object (const char *, const char *) |
Create directory for an object of a given type. More... | |
int | G_make_mapset_object_group_tmp (const char *) |
Create directory for type of objects in the temporary directory. More... | |
int | G__make_mapset_element_misc (const char *, const char *) |
Create misc element in the current mapset. More... | |
int | G_mapset_permissions (const char *) |
Check for user mapset permission. More... | |
int | G_mapset_permissions2 (const char *, const char *, const char *) |
Check for user mapset permission. More... | |
const char * | G_get_mapset_name (int) |
Get name of the n'th mapset from the current mapset search path. More... | |
void | G_create_alt_search_path (void) |
Define alternative mapset search path. More... | |
void | G_switch_search_path (void) |
Switch mapset search path. More... | |
void | G_reset_mapsets (void) |
Reset number of mapsets. More... | |
char ** | G_get_available_mapsets (void) |
Get list of available mapsets for current location. More... | |
void | G_add_mapset_to_search_path (const char *) |
Add mapset to the list of mapsets in search path. More... | |
int | G_is_mapset_in_search_path (const char *) |
Check if given mapset is in search path. More... | |
char * | G_myname (void) |
Returns location title. More... | |
int | G_color_values (const char *, float *, float *, float *) |
const char * | G_color_name (int) |
void | G_newlines_to_spaces (char *) |
int | G_name_is_fully_qualified (const char *, char *, char *) |
Check if map name is fully qualified (map @ mapset) More... | |
char * | G_fully_qualified_name (const char *, const char *) |
Get fully qualified element name. More... | |
int | G_unqualified_name (const char *, const char *, char *, char *) |
Returns unqualified map name (without @ mapset) More... | |
int | G_open_new (const char *, const char *) |
Open a new database file. More... | |
int | G_open_old (const char *, const char *, const char *) |
Open a database file for reading. More... | |
int | G_open_update (const char *, const char *) |
Open a database file for update. More... | |
FILE * | G_fopen_new (const char *, const char *) |
Open a new database file. More... | |
FILE * | G_fopen_old (const char *, const char *, const char *) |
Open a database file for reading. More... | |
FILE * | G_fopen_append (const char *, const char *) |
Open a database file for update (append mode) More... | |
FILE * | G_fopen_modify (const char *, const char *) |
Open a database file for update (r+ mode) More... | |
int | G_open_new_misc (const char *, const char *, const char *) |
open a new database misc file More... | |
int | G_open_old_misc (const char *, const char *, const char *, const char *) |
open a database misc file for reading More... | |
int | G_open_update_misc (const char *, const char *, const char *) |
open a database misc file for update More... | |
FILE * | G_fopen_new_misc (const char *, const char *, const char *) |
open a new database misc file More... | |
FILE * | G_fopen_old_misc (const char *, const char *, const char *, const char *) |
open a database misc file for reading More... | |
FILE * | G_fopen_append_misc (const char *, const char *, const char *) |
FILE * | G_fopen_modify_misc (const char *, const char *, const char *) |
int | G_check_overwrite (int argc, char **argv) |
Check for overwrite mode. More... | |
FILE * | G_open_pager (struct Popen *) |
void | G_close_pager (struct Popen *) |
FILE * | G_open_mail (struct Popen *) |
void | G_close_mail (struct Popen *) |
void | G_disable_interactive (void) |
Disables the ability of the parser to operate interactively. More... | |
struct GModule * | G_define_module (void) |
Initializes a new module. More... | |
struct Flag * | G_define_flag (void) |
Initializes a Flag struct. More... | |
struct Option * | G_define_option (void) |
Initializes an Option struct. More... | |
struct Option * | G_define_standard_option (int) |
Create standardised Option structure. More... | |
struct Flag * | G_define_standard_flag (int) |
Create standardised Flag structure. More... | |
int | G_parser (int, char **) |
Parse command line. More... | |
void | G_usage (void) |
Command line help/usage message. More... | |
char * | G_recreate_command (void) |
Creates command to run non-interactive. More... | |
void | G_add_keyword (const char *) |
Add keyword to the list. More... | |
void | G_set_keywords (const char *) |
Set keywords from the string. More... | |
int | G_get_overwrite () |
Get overwrite value. More... | |
char * | G_option_to_separator (const struct Option *) |
Get separator string from the option. More... | |
FILE * | G_open_option_file (const struct Option *) |
Get an input/output file pointer from the option. If the file name is omitted or '-', it returns either stdin or stdout based on the gisprompt. More... | |
void | G_close_option_file (FILE *) |
Close an input/output file returned by G_open_option_file(). If the file pointer is stdin, stdout, or stderr, nothing happens. More... | |
void | G_option_rule (int, int, void **) |
Set generic option rule. More... | |
void | G_option_exclusive (void *,...) |
Sets the options to be mutually exclusive. More... | |
void | G_option_required (void *,...) |
Sets the options to be required. More... | |
void | G_option_requires (void *,...) |
Define a list of options from which at least one option is required if first option is present. More... | |
void | G_option_requires_all (void *,...) |
Define additionally required options for an option. More... | |
void | G_option_excludes (void *,...) |
Exclude selected options. More... | |
void | G_option_collective (void *,...) |
Sets the options to be collective. More... | |
int | G_mkdir (const char *) |
Creates a new directory. More... | |
int | G_is_dirsep (char) |
Checks if a specified character is a valid directory separator character on the host system. More... | |
int | G_is_absolute_path (const char *) |
Checks if a specified path looks like an absolute path on the host system. More... | |
char * | G_convert_dirseps_to_host (char *) |
Converts directory separator characters in a string to the native host separator character (/ on Unix, \ on Windows) More... | |
char * | G_convert_dirseps_from_host (char *) |
Converts directory separator characters in a string from the native host character to the GRASS separator character (/) More... | |
int | G_lstat (const char *, struct stat *) |
Get file status. More... | |
int | G_stat (const char *, struct stat *) |
Get file status. More... | |
int | G_owner (const char *) |
Get owner id of path. More... | |
void | G_percent (long, long, int) |
Print percent complete messages. More... | |
void | G_percent_reset (void) |
Reset G_percent() to 0%; do not add newline. More... | |
void | G_progress (long, int) |
Print progress info messages. More... | |
void | G_set_percent_routine (int(*)(int)) |
Establishes percent_routine as the routine that will handle the printing of percentage progress messages. More... | |
void | G_unset_percent_routine (void) |
After this call subsequent percentage progress messages will be handled in the default method. More... | |
void | G_popen_clear (struct Popen *) |
FILE * | G_popen_write (struct Popen *, const char *, const char **) |
FILE * | G_popen_read (struct Popen *, const char *, const char **) |
void | G_popen_close (struct Popen *) |
void | G_setup_plot (double, double, double, double, int(*)(int, int), int(*)(int, int)) |
Initialize plotting routines. More... | |
void | G_setup_fill (int) |
Set row_fill routine to row_solid_fill or row_dotted_fill. More... | |
void | G_plot_where_xy (double, double, int *, int *) |
Converts east,north to x,y. More... | |
void | G_plot_where_en (int, int, double *, double *) |
Converts x,y to east,north. More... | |
void | G_plot_point (double, double) |
Plot point. More... | |
void | G_plot_line (double, double, double, double) |
Plot line between latlon coordinates (fastline) More... | |
void | G_plot_line2 (double, double, double, double) |
Plot line between latlon coordinates (slowline) More... | |
int | G_plot_polygon (const double *, const double *, int) |
Plot filled polygon with n vertices. More... | |
int | G_plot_area (double *const *, double *const *, int *, int) |
Plot multiple polygons. More... | |
void | G_plot_fx (double(*)(double), double, double) |
Plot f(east1) to f(east2) More... | |
int | G_pole_in_polygon (const double *, const double *, int) |
Check if pole is in polygon. More... | |
const char * | G_program_name (void) |
Return module name. More... | |
const char * | G_original_program_name (void) |
Return original path of the executed program. More... | |
void | G_set_program_name (const char *) |
Set program name. More... | |
int | G_projection (void) |
Query cartographic projection. More... | |
int | G_projection_units (int) |
Get projection units code (for internal use only) More... | |
const char * | G_projection_name (int) |
Get projection name. More... | |
const char * | G_database_unit_name (int) |
Get units (localized) name for the current location. More... | |
int | G_database_unit () |
Get units id for the current location. More... | |
const char * | G_database_projection_name (void) |
Query cartographic projection for the current location. More... | |
const char * | G_database_datum_name (void) |
Get datum name for the current location. More... | |
const char * | G_database_ellipse_name (void) |
Get ellipsoid name for the current location. More... | |
double | G_database_units_to_meters_factor (void) |
Conversion to meters. More... | |
const char * | G_database_epsg_code (void) |
Get EPGS code for the current location. More... | |
int | G_put_window (const struct Cell_head *) |
Writes the region (window) More... | |
int | G_put_element_window (const struct Cell_head *, const char *, const char *) |
Write the region. More... | |
void | G_putenv (const char *, const char *) |
Sets the UNIX environment variable name to value. More... | |
double | G_meridional_radius_of_curvature (double, double, double) |
Meridional radius of curvature. More... | |
double | G_transverse_radius_of_curvature (double, double, double) |
Transverse radius of curvature. More... | |
double | G_radius_of_conformal_tangent_sphere (double, double, double) |
Radius of conformal tangent sphere. More... | |
void | G__read_Cell_head (FILE *, struct Cell_head *, int) |
Read cell header (for internal use only) More... | |
void | G__read_Cell_head_array (char **, struct Cell_head *, int) |
Read window from NULL terminated array of strings (for internal use only) More... | |
int | G_remove (const char *, const char *) |
Remove a database file. More... | |
int | G_remove_misc (const char *, const char *, const char *) |
Remove a database misc file. More... | |
int | G_recursive_remove (const char *) |
Recursively remove all files in given directory. More... | |
int | G_rename_file (const char *, const char *) |
Rename a file or a directory in the filesystem. More... | |
int | G_rename (const char *, const char *, const char *) |
Rename a database file. More... | |
int | G_begin_rhumbline_equation (double, double, double, double) |
Start rhumbline calculations. More... | |
double | G_rhumbline_lat_from_lon (double) |
Calculates rhumbline latitude. More... | |
void | G_rotate_around_point (double, double, double *, double *, double) |
Rotate point (double version) More... | |
void | G_rotate_around_point_int (int, int, int *, int *, double) |
Rotate point (int version) More... | |
off_t | G_ftell (FILE *) |
Get the current file position of the stream. More... | |
void | G_fseek (FILE *, off_t, int) |
Change the file position of the stream. More... | |
void | G_get_set_window (struct Cell_head *) |
Get the current working window (region) More... | |
void | G_set_window (struct Cell_head *) |
Establishes window as the current working window (region). More... | |
void | G_unset_window () |
Unset current region. More... | |
void | G_shortest_way (double *, double *) |
Shortest way between two eastings. More... | |
void | G_sleep (unsigned int) |
int | G_snprintf (char *, size_t, const char *,...) __attribute__((format(printf |
int int | G_strcasecmp (const char *, const char *) |
String compare ignoring case (upper or lower) More... | |
int | G_strncasecmp (const char *, const char *, int) |
String compare ignoring case (upper or lower) - limited number of characters. More... | |
char * | G_store (const char *) |
Copy string to allocated memory. More... | |
char * | G_store_upper (const char *) |
Copy string to allocated memory and convert copied string to upper case. More... | |
char * | G_store_lower (const char *) |
Copy string to allocated memory and convert copied string to lower case. More... | |
char * | G_strchg (char *, char, char) |
Replace all occurrences of character in string bug with new. More... | |
char * | G_str_replace (const char *, const char *, const char *) |
Replace all occurrences of old_str in buffer with new_str. More... | |
char * | G_str_concat (const char **, int, const char *, int) |
String concatenation. More... | |
void | G_strip (char *) |
Removes all leading and trailing white space from string. More... | |
char * | G_chop (char *) |
Chop leading and trailing white spaces. More... | |
void | G_str_to_upper (char *) |
Convert string to upper case. More... | |
void | G_str_to_lower (char *) |
Convert string to lower case. More... | |
int | G_str_to_sql (char *) |
Make string SQL compliant. More... | |
void | G_squeeze (char *) |
Remove superfluous white space. More... | |
char * | G_strcasestr (const char *, const char *) |
Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lower) More... | |
void | G_init_tempfile (void) |
Initialize environment for creating tempfiles. More... | |
char * | G_tempfile (void) |
Returns a temporary file name. More... | |
char * | G_tempfile_pid (int) |
Create tempfile from process id. More... | |
void | G_temp_element (char *) |
Populates element with a path string. More... | |
void | G__temp_element (char *, int) |
Populates element with a path string (internal use only!) More... | |
char * | G_mktemp (char *) |
Opens a temporary file. More... | |
int | G_mkstemp (char *, int, int) |
Returns a file descriptor. More... | |
FILE * | G_mkstemp_fp (char *, int, int) |
Returns a file descriptor. More... | |
void | G_init_timestamp (struct TimeStamp *) |
Initialize timestamp structure. More... | |
void | G_set_timestamp (struct TimeStamp *, const struct DateTime *) |
void | G_set_timestamp_range (struct TimeStamp *, const struct DateTime *, const struct DateTime *) |
int | G_write_timestamp (FILE *, const struct TimeStamp *) |
Output TimeStamp structure to a file as a formatted string. More... | |
void | G_get_timestamps (const struct TimeStamp *, struct DateTime *, struct DateTime *, int *) |
Copy TimeStamp into [two] Datetimes structs. More... | |
int | G_format_timestamp (const struct TimeStamp *, char *) |
Create text string from TimeStamp structure. More... | |
int | G_scan_timestamp (struct TimeStamp *, const char *) |
Fill a TimeStamp structure from a datetime string. More... | |
int | G_has_raster_timestamp (const char *, const char *) |
Check if timestamp for raster map exists. More... | |
int | G_read_raster_timestamp (const char *, const char *, struct TimeStamp *) |
Read timestamp from raster map. More... | |
int | G_write_raster_timestamp (const char *, const struct TimeStamp *) |
Write timestamp of raster map. More... | |
int | G_remove_raster_timestamp (const char *) |
Remove timestamp from raster map. More... | |
int | G_has_vector_timestamp (const char *, const char *, const char *) |
Check if timestamp for vector map exists. More... | |
int | G_read_vector_timestamp (const char *, const char *, const char *, struct TimeStamp *) |
Read timestamp from vector map. More... | |
int | G_write_vector_timestamp (const char *, const char *, const struct TimeStamp *) |
Write timestamp of vector map. More... | |
int | G_remove_vector_timestamp (const char *, const char *) |
Remove timestamp from vector map. More... | |
int | G_has_raster3d_timestamp (const char *, const char *) |
Check if timestamp for 3D raster map exists. More... | |
int | G_read_raster3d_timestamp (const char *, const char *, struct TimeStamp *) |
Read timestamp from 3D raster map. More... | |
int | G_remove_raster3d_timestamp (const char *) |
Remove timestamp from 3D raster map. More... | |
int | G_write_raster3d_timestamp (const char *, const struct TimeStamp *) |
Write timestamp of 3D raster map. More... | |
char ** | G_tokenize (const char *, const char *) |
Tokenize string. More... | |
char ** | G_tokenize2 (const char *, const char *, const char *) |
Tokenize string. More... | |
int | G_number_of_tokens (char **) |
Return number of tokens. More... | |
void | G_free_tokens (char **) |
Free memory allocated to tokens. More... | |
void | G_trim_decimal (char *) |
Removes trailing zeros from decimal number. More... | |
double | G_meters_to_units_factor (int) |
Units conversion from meters to units. More... | |
double | G_meters_to_units_factor_sq (int) |
Units conversion from square meters to square units. More... | |
const char * | G_get_units_name (int, int, int) |
Get localized units name. More... | |
int | G_units (const char *) |
Get units code by name. More... | |
int | G_is_units_type_spatial (int) |
Check if the unit is of spatial type. More... | |
int | G_is_units_type_temporal (int) |
Check if the unit is of temporal type. More... | |
char * | G_rc_path (const char *, const char *) |
Returns path to element and item. More... | |
int | G_verbose (void) |
Get current verbosity level. More... | |
int | G_verbose_min (void) |
Get min verbosity level. More... | |
int | G_verbose_std (void) |
Get standard verbosity level. More... | |
int | G_verbose_max (void) |
Get max verbosity level. More... | |
int | G_set_verbose (int) |
Set verbosity level. More... | |
void | G_3dview_warning (int) |
Turns 3D View warnings on and off. More... | |
int | G_get_3dview_defaults (struct G_3dview *, struct Cell_head *) |
Sets default for v based on w. More... | |
int | G_put_3dview (const char *, const char *, const struct G_3dview *, const struct Cell_head *) |
Saves info to a 3d.view file. More... | |
int | G_get_3dview (const char *, const char *, struct G_3dview *) |
Gets a 3D View. More... | |
const char * | G_whoami (void) |
Gets user's name. More... | |
void | G_adjust_window_to_box (const struct Cell_head *, struct Cell_head *, int, int) |
Adjusts window to a rectangular box. More... | |
void | G_format_northing (double, char *, int) |
Northing to ASCII. More... | |
void | G_format_easting (double, char *, int) |
Easting to ASCII. More... | |
void | G_format_resolution (double, char *, int) |
Resolution to ASCII. More... | |
int | G_point_in_region (double, double) |
Returns TRUE if coordinate is within the current region settings. More... | |
int | G_point_in_window (double, double, const struct Cell_head *) |
Returns TRUE if coordinate is within the given map region. More... | |
int | G_limit_east (double *, int) |
Function not yet implemented... More... | |
int | G_limit_west (double *, int) |
Function not yet implemented... More... | |
int | G_limit_north (double *, int) |
Limit north (y) coordinate. More... | |
int | G_limit_south (double *, int) |
Limit south (y) coordinate. More... | |
int | G_window_overlap (const struct Cell_head *, double, double, double, double) |
Determines if a box overlays a map window. More... | |
double | G_window_percentage_overlap (const struct Cell_head *, double, double, double, double) |
Determines percentage of box is contained in the window. More... | |
int | G_scan_northing (const char *, double *, int) |
ASCII northing to double. More... | |
int | G_scan_easting (const char *, double *, int) |
ASCII easting to double. More... | |
int | G_scan_resolution (const char *, double *, int) |
ASCII resolution to double. More... | |
double | G_adjust_east_longitude (double, double) |
Adjust east longitude. More... | |
double | G_adjust_easting (double, const struct Cell_head *) |
Returns east not smaller than west. More... | |
void | G__init_window (void) |
Initialize window (region). More... | |
void | G_begin_execute (void(*func)(void *), void *, void **, int) |
void | G_end_execute (void **) |
void | G_init_workers (void) |
void | G_finish_workers (void) |
void | G__write_Cell_head (FILE *, const struct Cell_head *, int) |
Write cell header or window. More... | |
void | G__write_Cell_head3 (FILE *, const struct Cell_head *, int) |
Write 3D cell header or window. More... | |
void | G_write_zeros (int, size_t) |
Writes n bytes of 9 to file descriptor fd More... | |
void | G_xdr_get_int (int *, const void *) |
void | G_xdr_put_int (void *, const int *) |
void | G_xdr_get_float (float *, const void *) |
void | G_xdr_put_float (void *, const float *) |
void | G_xdr_get_double (double *, const void *) |
void | G_xdr_put_double (void *, const double *) |
void | G_zero (void *, int) |
Zero out a buffer, buf, of length i. More... | |
int | G_zone (void) |
Query cartographic zone. More... | |
#define G_alloca | ( | n | ) | G_malloc(n) |
Definition at line 57 of file defs/gis.h.
Definition at line 113 of file defs/gis.h.
Referenced by alloc_statistics(), db_CatValArray_alloc(), db_d_append_error(), dig__alloc_space(), dig__falloc(), dig__frealloc(), G__read_Cell_head(), G_alloc_fmatrix(), G_alloc_fvector(), G_alloc_imatrix(), G_alloc_ivector(), G_alloc_matrix(), G_alloc_vector(), G_get_available_mapsets(), G_list(), G_math_alloc_spmatrix(), G_math_alloc_spvector(), G_matrix_init(), G_read_compressed(), G_vector_copy(), G_vector_init(), I_location_info(), I_new_signature(), I_NewSubSig(), I_sort_signatures_by_semantic_label(), I_SortSigSetBySemanticLabel(), N_alloc_27star(), N_alloc_5star(), N_alloc_7star(), N_alloc_9star(), N_alloc_geom_data(), N_alloc_gradient_2d(), N_alloc_gradient_3d(), N_alloc_gradient_field_2d(), N_alloc_gradient_field_3d(), N_alloc_gradient_neighbours_2d(), N_alloc_gradient_neighbours_3d(), N_alloc_gradient_neighbours_x(), N_alloc_gradient_neighbours_y(), N_alloc_gradient_neighbours_z(), N_alloc_les_callback_2d(), N_alloc_les_callback_3d(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), NetA_betweenness_closeness(), NetA_flow(), NetA_min_cut(), NetA_spanning_tree(), NetA_strongly_connected_components(), NetA_timetable_shortest_path(), NetA_weakly_connected_components(), Rast__allocate_null_bits(), Rast__check_format(), Rast_allocate_buf(), Rast_allocate_c_buf(), Rast_allocate_c_input_buf(), Rast_allocate_c_output_buf(), Rast_allocate_d_buf(), Rast_allocate_d_input_buf(), Rast_allocate_d_output_buf(), Rast_allocate_f_buf(), Rast_allocate_f_input_buf(), Rast_allocate_f_output_buf(), Rast_allocate_input_buf(), Rast_allocate_null_buf(), Rast_allocate_null_input_buf(), Rast_allocate_null_output_buf(), Rast_allocate_output_buf(), Rast_get_vrt(), Vect_new_varray(), and vector2perimeters().
#define G_freea | ( | p | ) | G_free(p) |
Definition at line 58 of file defs/gis.h.
#define G_incr_void_ptr | ( | ptr, | |
size | |||
) | ((void *)((const unsigned char *)(ptr) + (size))) |
Definition at line 100 of file defs/gis.h.
Referenced by G_free(), and Rast_row_update_fp_range().
Definition at line 112 of file defs/gis.h.
Referenced by alloc_slice_buff(), alloc_vol_buff(), create_si_struct(), db_d_init_error(), del2g(), dig_alloc_area(), dig_alloc_isle(), dig_alloc_line(), dig_alloc_node(), dig_cidx_init(), dig_find_area_box(), dig_find_isle_box(), dig_find_node(), dig_read_cidx(), dig_select_areas(), dig_select_isles(), dig_select_lines(), dig_select_nodes(), dig_spidx_add_area(), dig_spidx_add_isle(), dig_spidx_add_node(), dig_spidx_del_area(), dig_spidx_del_isle(), dig_spidx_del_node(), G__location_path(), G__mapset_path(), G_color_rules_descriptions(), G_create_key_value(), G_define_flag(), G_define_option(), G_double_to_basename_format(), G_generate_basename(), G_join_basename_strings(), G_list(), G_ls_regex_filter(), G_matrix_init(), G_matrix_LU_solve(), G_new_ilist(), G_vasprintf(), G_vector_copy(), G_vector_init(), gk_copy_key(), gk_make_linear_framesfromkeys(), gp_get_new_site(), gs_get_new_surface(), gs_init_normbuff(), gs_malloc_lookup(), GS_write_tif(), gsd_writeView(), gv_get_new_vect(), gvl_get_new_vol(), GVL_isosurf_add(), html_polygon(), I_add_file_to_group_ref(), I_init_signatures(), I_InitSigSet(), I_malloc(), I_NewClassSig(), I_NewSubSig(), I_sc_add_cat(), I_sort_signatures_by_semantic_label(), I_SortSigSetBySemanticLabel(), IL_write_temp_2d(), kdtree_create(), line_check_intersection(), M_get_option_desc(), M_get_options(), new_chain(), new_line(), new_symbol(), Nviz_new_render_window(), open_band_files(), pg_create_struct(), Rast3d_parse_vallist(), Rast_is_reclassed_to(), Rast_map_to_img_str(), Rast_set_d_cat(), Rowio_setup(), seg_setup(), set_proj_share(), tgis_new_map_list(), Vect__load_map_nodes_pg(), Vect_find_area(), Vect_get_dblink(), Vect_get_finfo_geometry_type(), Vect_get_full_name(), Vect_new_boxlist(), Vect_new_cat_list(), Vect_new_dblinks_struct(), Vect_new_list(), Vect_new_varray(), Vect_open_fidx(), Vect_set_error_handler_io(), Vect_spatial_index_add_item(), Vect_spatial_index_del_item(), and Vect_spatial_index_select().
#define G_realloc | ( | p, | |
n | |||
) | G__realloc(RELDIR "/" __FILE__, __LINE__, (p), (n)) |
Definition at line 114 of file defs/gis.h.
Referenced by add_coor(), add_point(), db_CatValArray_realloc(), dig_boxlist_add(), dig_node_add_updated(), dig_read_cidx_head(), f_median(), f_mode(), f_nmedian(), f_nmode(), G_add_keyword(), G_get_available_mapsets(), G_ilist_add(), G_ls2(), G_rasprintf(), G_vasprintf(), I_add_file_to_group_ref(), I_new_control_point(), I_new_signature(), I_NewClassSig(), I_NewSubSig(), I_realloc(), M__add_element(), parse_fontcap(), path_alloc(), pg_addedge1(), Rast_append_format_history(), Rast_append_history(), Rast_extend_histogram(), Rast_get_vrt(), Rast_is_reclassed_to(), Rast_set_d_cat(), tgis_map_list_add(), Vect__reallocate_cache(), Vect_array_to_cat_list(), Vect_boxlist_append(), Vect_cat_list_to_array(), Vect_find_area(), and Vect_list_append().
#define RELDIR "?" |
Definition at line 72 of file defs/gis.h.
void void void void __attribute__ | ( | (noreturn) | ) |
void G_3dview_warning | ( | int | b | ) |
void* G__calloc | ( | const char * | file, |
int | line, | ||
size_t | m, | ||
size_t | n | ||
) |
Memory allocation.
Allocates a properly aligned block of memory n*m bytes in length, initializes the allocated memory to zero, and returns a pointer to the allocated block of memory.
Dies with error message on memory allocation fail.
Note: Allocating memory for reading and writing raster maps is discussed in Allocating Raster I/O Buffers.
file | fine name |
line | line number |
m | element size |
n | number of elements |
Definition at line 72 of file gis/alloc.c.
void G__gisinit | ( | const char * | version, |
const char * | pgm | ||
) |
Initialize GIS Library and ensures a valid mapset is available.
version | |
pgm | program (module) name |
void G__init_window | ( | void | ) |
Initialize window (region).
Definition at line 76 of file gis/window_map.c.
References G_get_window(), G_initialize_done(), G_is_initialized(), G__::window, and G__::window_set.
Referenced by G_init_all(), and Rast__init_window().
int G__make_mapset_element_misc | ( | const char * | dir, |
const char * | name | ||
) |
Create misc element in the current mapset.
dir | directory path (e.g., cell_misc ) |
name | element to be created in mapset (e.g., elevation ) |
Definition at line 232 of file mapset_msc.c.
References G_make_mapset_dir_object().
Referenced by I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), Rast__close_null(), and Rast__quant_export().
void* G__malloc | ( | const char * | file, |
int | line, | ||
size_t | n | ||
) |
Memory allocation.
Allocates a block of memory at least n bytes which is aligned properly for all data types. A pointer to the aligned block is returned.
Dies with error message on memory allocation fail.
file | file name |
line | line number |
n | number of elements |
Definition at line 32 of file gis/alloc.c.
void G__no_gisinit | ( | const char * | version | ) |
void G__read_Cell_head | ( | FILE * | fd, |
struct Cell_head * | cellhd, | ||
int | is_cellhd | ||
) |
Read cell header (for internal use only)
fp | file descriptor | |
[out] | cellhd | pointer to Cell_head structure |
is_cellhd | ? (unused) |
Definition at line 57 of file rd_cellhd.c.
References count, G__read_Cell_head_array(), G_calloc, G_debug(), G_free(), G_fseek(), G_getl(), and G_store().
Referenced by Rast_get_cellhd().
void G__read_Cell_head_array | ( | char ** | array, |
struct Cell_head * | cellhd, | ||
int | is_cellhd | ||
) |
Read window from NULL terminated array of strings (for internal use only)
array | array of strings | |
[out] | cellhd | pointer to Cell_head structure |
is_cellhd | ? (unused) |
Definition at line 97 of file rd_cellhd.c.
Referenced by G__read_Cell_head().
void G__read_gisrc_env | ( | void | ) |
void G__read_gisrc_path | ( | void | ) |
Read or read again the GISRC (session) environment variable.
The GISRC environment variable will be read and its value stored, ignoring if it was read before.
Calls G_fatal_error when the GISRC variable is not set.
Definition at line 125 of file env.c.
References _, G_fatal_error(), and getenv().
void G__read_mapset_env | ( | void | ) |
Force to read the mapset environment file VAR.
The mapset specific VAR file of the mapset set with G_setenv() will be read into memory, ignoring if it was readed before. Existing values will be overwritten, new values appended.
void* G__realloc | ( | const char * | file, |
int | line, | ||
void * | buf, | ||
size_t | n | ||
) |
Memory reallocation.
Changes the size of a previously allocated block of memory at ptr and returns a pointer to the new block of memory. The size may be larger or smaller than the original size. If the original block cannot be extended "in place", then a new block is allocated and the original block copied to the new block.
Note: If buf is NULL, then this routine simply allocates a block of n bytes else buf must point to memory that has been dynamically allocated by G_malloc(), G_calloc(), G_realloc(), malloc(3), alloc(3), or realloc(3).. This routine works around broken realloc() routines, which do not handle a NULL buf.
file | file name | |
line | line number | |
[in,out] | buf | buffer holding original data |
[in] | n | array size |
Definition at line 118 of file gis/alloc.c.
void G__temp_element | ( | char * | element, |
int | tmp | ||
) |
Populates element with a path string (internal use only!)
[out] | element | element name |
tmp | TRUE to use G_make_mapset_element_tmp() instead of G_make_mapset_element() |
Definition at line 113 of file tempfile.c.
Referenced by G_temp_element(), and Vect__get_path().
void G__write_Cell_head | ( | FILE * | fd, |
const struct Cell_head * | cellhd, | ||
int | is_cellhd | ||
) |
Write cell header or window.
[in,out] | fd | header file |
[in] | cellhd | pointed to cell header structure |
[in] | is_cellhd | 1 cell header; 0 window |
Definition at line 30 of file wr_cellhd.c.
References Cell_head::cols, Cell_head::compressed, Cell_head::east, Cell_head::ew_res, Cell_head::format, G_format_easting(), G_format_northing(), G_format_resolution(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, Cell_head::rows, Cell_head::south, Cell_head::west, and Cell_head::zone.
Referenced by G__write_Cell_head3(), and Rast_put_cellhd().
void G__write_Cell_head3 | ( | FILE * | fd, |
const struct Cell_head * | cellhd, | ||
int | is_cellhd | ||
) |
Write 3D cell header or window.
[in,out] | fd | header file |
[in] | cellhd | pointer to cell header structure |
[in] | is_cellhd | 1 cell header; 0 window |
Definition at line 78 of file wr_cellhd.c.
References Cell_head::bottom, Cell_head::cols3, Cell_head::depths, Cell_head::ew_res3, G__write_Cell_head(), G_format_resolution(), Cell_head::ns_res3, Cell_head::proj, Cell_head::rows3, Cell_head::tb_res, and Cell_head::top.
void G_add_error_handler | ( | void(*)(void *) | func, |
void * | closure | ||
) |
Add new error handler.
Example
func | handler to add |
closure | pointer to closure data |
Definition at line 70 of file gis/handler.c.
Referenced by db_set_error_handler_driver(), Rast__error_handler(), and Vect_set_error_handler_io().
void G_add_keyword | ( | const char * | keyword | ) |
void G_add_mapset_to_search_path | ( | const char * | mapset | ) |
Add mapset to the list of mapsets in search path.
Mapset is add in memory only, not to the SEARCH_PATH file! List is check first if already exists.
mapset | mapset name to be added to the search path |
Definition at line 200 of file mapset_nme.c.
References G_is_mapset_in_search_path().
void G_adjust_Cell_head | ( | struct Cell_head * | cellhd, |
int | row_flag, | ||
int | col_flag | ||
) |
Adjust cell header.
This function fills in missing parts of the input cell header (or region). It also makes projection-specific adjustments. The cellhd structure must have its north, south, east, west, and proj fields set.
If row_flag is true, then the north-south resolution is computed from the number of rows in the cellhd structure. Otherwise the number of rows is computed from the north-south resolution in the structure, similarly for col_flag and the number of columns and the east-west resolution.
Note: 3D values are not adjusted.
[in,out] | cellhd | pointer to Cell_head structure |
row_flag | compute n-s resolution | |
col_flag | compute e-w resolution |
Definition at line 51 of file adj_cellhd.c.
References _, Cell_head::cols, Cell_head::ew_res, G_fatal_error(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, PROJECTION_LL, Cell_head::rows, and Cell_head::south.
void G_adjust_Cell_head3 | ( | struct Cell_head * | cellhd, |
int | row_flag, | ||
int | col_flag, | ||
int | depth_flag | ||
) |
Adjust cell header for 3D values.
This function fills in missing parts of the input cell header (or region). It also makes projection-specific adjustments. The cellhd structure must have its north, south, east, west, and proj fields set.
If row_flag is true, then the north-south resolution is computed from the number of rows in the cellhd structure. Otherwise the number of rows is computed from the north-south resolution in the structure, similarly for col_flag and the number of columns and the east-west resolution.
If depth_flag is true, top-bottom resolution is calculated from depths. If depth_flag are false, number of depths is calculated from top-bottom resolution.
[in,out] | cellhd | pointer to Cell_head structure |
row_flag | compute n-s resolution | |
col_flag | compute e-w resolution | |
depth_flag | compute t-b resolution |
Definition at line 165 of file adj_cellhd.c.
References _, Cell_head::cols, Cell_head::cols3, Cell_head::depths, Cell_head::ew_res, Cell_head::ew_res3, G_fatal_error(), Cell_head::north, Cell_head::ns_res, Cell_head::ns_res3, Cell_head::proj, PROJECTION_LL, Cell_head::rows, Cell_head::rows3, Cell_head::south, and Cell_head::tb_res.
double G_adjust_east_longitude | ( | double | east, |
double | west | ||
) |
Adjust east longitude.
This routine returns an equivalent east that is at least as large as the west coordinate.
Note: This routine should be used only with latitude-longitude coordinates.
east | east coordinate |
west | west coordinate |
Definition at line 32 of file gis/window_map.c.
double G_adjust_easting | ( | double | east, |
const struct Cell_head * | window | ||
) |
Returns east not smaller than west.
If the region projection is PROJECTION_LL
, then this routine returns an equivalent east that is not smaller than the coordinate for the western edge of the region and, if possible, smaller than the coordinate for the eastern edge of the region. Otherwise no adjustment is made and the original east is returned.
east | east coordinate |
window | pointer to Cell_head |
Definition at line 58 of file gis/window_map.c.
Referenced by G_plot_where_en().
int G_adjust_window_ll | ( | struct Cell_head * | cellhd | ) |
Adjust window for lat/lon.
This function tries to automatically fix fp precision issues and adjust rounding errors for lat/lon.
Note: 3D values are not adjusted.
[in,out] | cellhd | pointer to Cell_head structure |
Definition at line 554 of file adj_cellhd.c.
References _, Cell_head::east, Cell_head::ew_res, G_fatal_error(), G_lat_format(), G_lat_scan(), G_llres_format(), G_llres_scan(), G_lon_format(), G_lon_scan(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, PROJECTION_LL, Cell_head::south, and Cell_head::west.
void G_adjust_window_to_box | ( | const struct Cell_head * | src, |
struct Cell_head * | dst, | ||
int | rows, | ||
int | cols | ||
) |
Adjusts window to a rectangular box.
Creates a new window dst from a window src which fits into the rectangular box with dimensions rows by cols.
[in] | src | source window |
[in,out] | dst | destination window |
[in] | rows | number of rows in box |
[in] | cols | number of columns in box |
Definition at line 33 of file wind_2_box.c.
int int int G_aprintf | ( | const char * | format, |
... | |||
) |
Adjust the width of string specifiers to the display space instead of the number of bytes for wide characters and print them formatted using the adjusted display width.
compare
ABCD|
and
ABCD|
[in] | format | string format |
[in] | ... | arguments for the format string |
double G_area_for_zone_on_ellipsoid | ( | double | north, |
double | south | ||
) |
Calculates area between latitudes.
This routine shows how to calculate area between two lats, but isn't efficient for row by row since G_darea0_on_ellipsoid() will be called twice for the same lat, once as a south then again as a north.
Returns the area between latitudes north and south scaled by the factor s passed to G_begin_zone_area_on_ellipsoid().
north | north coordinate |
south | south coordinate |
Definition at line 89 of file area_ellipse.c.
References G_darea0_on_ellipsoid().
double G_area_for_zone_on_sphere | ( | double | north, |
double | south | ||
) |
Calculates area between latitudes.
This routine shows how to calculate area between two lats, but isn't efficient for row by row since G_darea0_on_sphere() will be called twice for the same lat, once as a south then again as a north.
Returns the area between latitudes north and south scaled by the factor s passed to G_begin_zone_area_on_sphere().
north | ||
[in] | south |
Definition at line 70 of file area_sphere.c.
References G_darea0_on_sphere().
double G_area_of_cell_at_row | ( | int | row | ) |
Cell area in specified row.
This routine returns the area in square meters of a cell in the specified row. This value is constant for planimetric grids and varies with the row if the projection is latitude-longitude.
row | row number |
Definition at line 87 of file gis/area.c.
References PROJECTION_LL.
double G_area_of_polygon | ( | const double * | x, |
const double * | y, | ||
int | n | ||
) |
Area in square meters of polygon.
Returns the area in square meters of the polygon described by the n pairs of x,y coordinate vertices. It is used both for planimetric and latitude-longitude projections.
You should call G_begin_polygon_area_calculations() function before calling this function.
Note: If the database is planimetric with the non-meter grid, this routine performs the required unit conversion to produce square meters.
x | array of x coordinates |
y | array of y coordinates |
n | number of x,y coordinate pairs |
Definition at line 159 of file gis/area.c.
References G_ellipsoid_polygon_area(), G_planimetric_polygon_area(), and PROJECTION_LL.
void G_ascii_check | ( | char * | string | ) |
Removes non-ascii characters from buffer.
Updates string with non_ascii characters removed, except for tabs, which are turned into spaces.
[in,out] | string | buffer to have non-ascii characters removed |
Definition at line 34 of file ascii_chk.c.
Referenced by Rast__read_history().
int G_asprintf | ( | char ** | , |
const char * | , | ||
... | |||
) |
char* G_basename | ( | char * | filename, |
const char * | desired_ext | ||
) |
Truncates filename to the base part (before the last '.') if it matches the extension, otherwise leaves it unchanged.
Checks if a filename matches a certain file extension (case insensitive) and if so, truncates the string to the base file name (cf. basename Unix command)
filename | string containing filename |
desired_ext | string containing extension to look for (case insensitive) |
Definition at line 38 of file basename.c.
Referenced by G_parser().
int G_begin_cell_area_calculations | ( | void | ) |
Begin cell area calculations.
This routine must be called once before any call to G_area_of_cell_at_row(). It perform all inititalizations needed to do area calculations for grid cells, based on the current window "projection" field. It can be used in either planimetric projections or the latitude-longitude projection.
Definition at line 46 of file gis/area.c.
int int G_begin_distance_calculations | ( | void | ) |
Begin distance calculations.
Initializes the distance calculations. It is used both for the planimetric and latitude-longitude projections.
Definition at line 42 of file gis/distance.c.
Referenced by Vect_line_geodesic_distance().
void G_begin_ellipsoid_polygon_area | ( | double | a, |
double | e2 | ||
) |
Begin area calculations.
This initializes the polygon area calculations for the ellipsoid with semi-major axis a (in meters) and ellipsoid eccentricity squared e2.
a | semi-major axis |
e2 | ellipsoid eccentricity squared |
Definition at line 61 of file area_poly1.c.
void G_begin_execute | ( | void(*)(void *) | func, |
void * | , | ||
void ** | , | ||
int | |||
) |
void G_begin_geodesic_distance | ( | double | a, |
double | e2 | ||
) |
Begin geodesic distance.
Initializes the distance calculations for the ellipsoid with semi-major axis a (in meters) and ellipsoid eccentricity squared e2. It is used only for the latitude-longitude projection.
Note: Must be called once to establish the ellipsoid.
a | semi-major axis in meters |
e2 | ellipsoid eccentricity |
int G_begin_geodesic_equation | ( | double | , |
double | , | ||
double | , | ||
double | |||
) |
Definition at line 40 of file geodesic.c.
int G_begin_polygon_area_calculations | ( | void | ) |
Begin polygon area calculations.
This initializes the polygon area calculation routines. It is used both for planimetric and latitude-longitude projections.
Definition at line 120 of file gis/area.c.
int G_begin_rhumbline_equation | ( | double | lon1, |
double | lat1, | ||
double | lon2, | ||
double | lat2 | ||
) |
Start rhumbline calculations.
Note: This function must be called before other rhumbline functions to initialize parameters.
[in] | lon1,lat1 | longitude, latitude of first point |
[in] | lon2,lat2 | longitude, latitude of second point |
Definition at line 60 of file rhumbline.c.
void G_begin_zone_area_on_ellipsoid | ( | double | a, |
double | e2, | ||
double | s | ||
) |
Begin area calculations for ellipsoid.
Initializes raster area calculations for an ellipsoid, where a is the semi-major axis of the ellipse (in meters), e2 is the ellipsoid eccentricity squared, and s is a scale factor to allow for calculations of part of the zone (s=1.0 is full zone, s=0.5 is half the zone, and s=360/ew_res is for a single grid cell).
Note: e2 must be positive. A negative value makes no sense, and zero implies a sphere.
a | semi-major axis |
e2 | ellipsoid eccentricity |
s | scale factor |
Definition at line 47 of file area_ellipse.c.
void G_begin_zone_area_on_sphere | ( | double | r, |
double | s | ||
) |
Initialize calculations for sphere.
Initializes raster area calculations for a sphere. The radius of the sphere is r and s is a scale factor to allow for calculations of a part of the zone (see G_begin_zone_area_on_ellipsoid()).
r | radius of sphere |
s | scale factor |
Definition at line 36 of file area_sphere.c.
void G_bresenham_line | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
int(*)(int, int) | point | ||
) |
Bresenham line algorithm.
Draws a line from x1,y1 to x2,y2 using Bresenham's algorithm. A routine to plot points must be provided, as is defined as: point(x, y) plot a point at x,y.
This routine does not require a previous call to G_setup_plot() to function correctly, and is independent of all following routines.
x0,y0 | first point |
x1,y1 | end point |
point | pointer to point plotting function |
Definition at line 30 of file bres_line.c.
int G_bz2_compress | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 88 of file cmprbzip.c.
int G_bz2_expand | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 169 of file cmprbzip.c.
int G_check_compressor | ( | int | ) |
Definition at line 140 of file compress.c.
Referenced by Rast__error_handler(), and Rast__open_old().
int G_check_input_output_name | ( | const char * | input, |
const char * | output, | ||
int | error | ||
) |
Check input and output file names.
Check: 1) output is legal map name, 2) if can find input map, and 3) if input was found in current mapset, check if input != output.
input | input map name |
output | output map name |
error | error type: G_FATAL_EXIT, G_FATAL_PRINT, G_FATAL_RETURN |
Definition at line 68 of file legal_name.c.
int G_check_overwrite | ( | int | argc, |
char ** | argv | ||
) |
Check for overwrite mode.
Check variables OVERWRITE, GRASS_OVERWRITE and '–o' flag.
The parser G_parser() checks if the map already exists in current mapset, we can switch out the check and do it in the module after the parser.
argc | number of arguments |
argv | array of arguments |
Definition at line 34 of file overwrite.c.
References G_getenv_nofatal(), G_setenv_nogisrc(), and getenv().
char* G_chop | ( | char * | line | ) |
Chop leading and trailing white spaces.
space, \f, \n, \r, \t, \v
Modified copy of G_squeeze() by RB in March 2000.
line | buffer to be worked on |
Definition at line 328 of file strings.c.
Referenced by check_create_export_opts(), check_create_import_opts(), check_mapset_in_layer_name(), dig_read_frmt_ascii(), G_str_to_color(), and read_coor().
void G_close_mail | ( | struct Popen * | ) |
Definition at line 65 of file pager.c.
References G_popen_close().
void G_close_option_file | ( | FILE * | fp | ) |
Close an input/output file returned by G_open_option_file(). If the file pointer is stdin, stdout, or stderr, nothing happens.
file | pointer |
void G_close_pager | ( | struct Popen * | ) |
Definition at line 35 of file pager.c.
References G_popen_close().
const char* G_color_name | ( | int | ) |
Definition at line 44 of file named_colr.c.
char* G_color_rules_description_type | ( | void | ) |
Get color rules description for Option->descriptions.
The type of color rule including range is appended to the description
Definition at line 124 of file gis/color_rules.c.
References name.
Referenced by G_define_standard_option().
char* G_color_rules_descriptions | ( | void | ) |
Get color rules description for Option->descriptions.
Definition at line 79 of file gis/color_rules.c.
char* G_color_rules_options | ( | void | ) |
Get list of color rules for Option->options.
Definition at line 40 of file gis/color_rules.c.
References list, name, and NULL.
Referenced by G_define_standard_option().
int G_color_values | ( | const char * | , |
float * | , | ||
float * | , | ||
float * | |||
) |
Definition at line 29 of file named_colr.c.
int G_compare_projections | ( | const struct Key_Value * | proj_info1, |
const struct Key_Value * | proj_units1, | ||
const struct Key_Value * | proj_info2, | ||
const struct Key_Value * | proj_units2 | ||
) |
Compare projections including units.
proj_info1 | projection info to compare |
proj_units1 | projection units to compare |
proj_info2 | projection info to compare |
proj_units2 | projection units to compare |
Definition at line 234 of file make_loc.c.
References G_find_key_value(), NULL, and TRUE.
int G_compress | ( | unsigned char * | , |
int | , | ||
unsigned char * | , | ||
int | , | ||
int | |||
) |
Definition at line 221 of file compress.c.
int G_compress_bound | ( | int | , |
int | |||
) |
Definition at line 205 of file compress.c.
char* G_compressor_name | ( | int | ) |
Definition at line 118 of file compress.c.
Referenced by Rast__error_handler(), and Rast__open_old().
int G_compressor_number | ( | char * | ) |
Definition at line 100 of file compress.c.
References compressor, G_strcasecmp(), and compressor_list::name.
Referenced by Rast__error_handler().
const char* G_config_path | ( | void | ) |
Get user's config path directory.
Returns a pointer to a string which is the full path name of the user's GRASS config directory in their home directory.
The path is not guaranteed to exist.
Definition at line 98 of file home.c.
References _, CONFIG_DIR, G_fatal_error(), G_home(), G_initialize_done(), G_is_initialized(), G_mkdir(), G_store(), getenv(), GPATH_MAX, and HOST_DIRSEP.
char* G_convert_dirseps_from_host | ( | char * | path | ) |
Converts directory separator characters in a string from the native host character to the GRASS separator character (/)
path | String to be converted |
Definition at line 105 of file paths.c.
References GRASS_DIRSEP, and HOST_DIRSEP.
char* G_convert_dirseps_to_host | ( | char * | path | ) |
Converts directory separator characters in a string to the native host separator character (/ on Unix, \ on Windows)
path | String to be converted |
Definition at line 83 of file paths.c.
References GRASS_DIRSEP, and HOST_DIRSEP.
int G_copy_file | ( | const char * | infile, |
const char * | outfile | ||
) |
Copies one file to another.
Creates a copy of a file. The destination file will be overwritten if it already exists, so the calling module should check this first if it is important.
infile | String containing path to source file |
outfile | String containing path to destination file |
Definition at line 34 of file copy_file.c.
References G_warning(), and NULL.
Referenced by G_rename_file().
int G_counter_next | ( | struct Counter * | ) |
Definition at line 46 of file counter.c.
Referenced by G_tempfile_pid().
void G_create_alt_env | ( | void | ) |
Set up alternative environment variables.
Definition at line 561 of file env.c.
Referenced by G_make_mapset().
void G_create_alt_search_path | ( | void | ) |
Define alternative mapset search path.
Definition at line 103 of file mapset_nme.c.
struct Key_Value* G_create_key_value | ( | void | ) |
Allocate and initialize Key_Value structure.
Definition at line 23 of file key_value1.c.
References G_malloc, and G_zero().
Referenced by GPJ_osr_to_grass().
double G_darea0_on_ellipsoid | ( | double | lat | ) |
Calculate integral for area between two latitudes.
This routine is part of the integral for the area between two latitudes.
lat | latitude |
Definition at line 63 of file area_ellipse.c.
Referenced by G_area_for_zone_on_ellipsoid().
double G_darea0_on_sphere | ( | double | lat | ) |
Calculates integral for area between two latitudes.
lat | latitude |
Definition at line 48 of file area_sphere.c.
References Radians.
Referenced by G_area_for_zone_on_sphere().
const char* G_database_datum_name | ( | void | ) |
Get datum name for the current location.
Returns a pointer to the name of the map datum of the current database. If there is no map datum explicitly associated with the actual database, the standard map datum WGS84 is returned, on error a NULL pointer is returned.
Definition at line 184 of file proj3.c.
References name.
const char* G_database_ellipse_name | ( | void | ) |
const char* G_database_epsg_code | ( | void | ) |
const char* G_database_projection_name | ( | void | ) |
Query cartographic projection for the current location.
Returns a pointer to a string which is a printable name for projection code proj (as returned by G_projection). Returns NULL if proj is not a valid projection.
Definition at line 110 of file proj3.c.
References G_projection(), G_projection_name(), name, PROJECTION_LL, PROJECTION_UTM, and PROJECTION_XY.
Referenced by Vect_get_proj_name().
int G_database_unit | ( | ) |
Get units id for the current location.
Definition at line 65 of file proj3.c.
References G_projection(), G_projection_units(), name, and U_UNDEFINED.
Referenced by G_database_unit_name().
const char* G_database_unit_name | ( | int | plural | ) |
Get units (localized) name for the current location.
Returns a string describing the database grid units. It returns a plural form (eg. 'feet') if plural is non-zero. Otherwise it returns a singular form (eg. 'foot').
plural | plural form if non-zero |
Definition at line 53 of file proj3.c.
References FALSE, G_database_unit(), and G_get_units_name().
Referenced by G_get_units_name(), G_units(), and gsd_scalebar().
double G_database_units_to_meters_factor | ( | void | ) |
Conversion to meters.
Returns a factor which converts the grid unit to meters (by multiplication). If the database is not metric (eg. imagery) then 0.0 is returned.
Definition at line 138 of file proj3.c.
Referenced by N_init_geom_data_3d().
const char* G_date | ( | void | ) |
Current date and time.
Returns a pointer to a string which is the current date and time. The format is the same as that produced by the UNIX date
command.
Definition at line 26 of file date.c.
Referenced by Vect__init_head(), and Vect_hist_command().
const char* G_datum_description | ( | int | ) |
Definition at line 68 of file gis/datum.c.
References G_read_datum_table().
const char* G_datum_ellipsoid | ( | int | ) |
Definition at line 78 of file gis/datum.c.
References G_read_datum_table().
const char* G_datum_name | ( | int | ) |
Definition at line 58 of file gis/datum.c.
References G_read_datum_table().
int G_debug | ( | int | , |
const char * | , | ||
... | |||
) |
Referenced by add_coor(), alloc_statistics(), Cairo_Color(), Cairo_end_raster(), Cairo_Erase(), Cairo_Graph_close(), Cairo_Graph_set(), cairo_read_image(), Cairo_Set_window(), cairo_write_image(), check_create_import_opts(), close_band_files(), db__driver_begin_transaction(), db__driver_commit_transaction(), db_close_database_shutdown_driver(), db_d_init_error(), db_delete_table(), db_get_login_dump(), db_set_default_connection(), db_start_driver_open_database(), dig__read_head(), dig__write_head(), dig_add_node(), dig_area_add_isle(), dig_area_del_isle(), dig_cidx_free(), dig_cidx_init(), dig_cidx_sort(), dig_del_line(), dig_find_area_box(), dig_find_isle_box(), dig_find_node(), dig_free_plus(), dig_free_plus_areas(), dig_free_plus_isles(), dig_free_plus_lines(), dig_free_plus_nodes(), dig_init_plus(), dig_load_plus(), dig_node_add_updated(), dig_node_line_angle(), dig_Rd_P_area(), dig_Rd_P_isle(), dig_Rd_P_line(), dig_Rd_P_node(), dig_Rd_Plus_head(), dig_Rd_spidx(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_read_frmt_ascii(), dig_select_areas(), dig_select_isles(), dig_select_lines(), dig_select_nodes(), dig_spidx_add_area(), dig_spidx_add_isle(), dig_spidx_add_node(), dig_spidx_del_area(), dig_spidx_del_isle(), dig_spidx_del_node(), dig_spidx_init(), dig_Wr_P_line(), dig_Wr_P_node(), dig_Wr_Plus_head(), dig_Wr_spidx(), dig_Wr_spidx_head(), dig_write_cidx_head(), free_perimeters(), G__read_Cell_head(), G_find_raster(), G_find_raster2(), G_find_vector(), G_find_vector2(), G_get_available_mapsets(), G_get_projepsg(), G_has_vector_timestamp(), G_math_add_spvector(), G_math_alloc_spmatrix(), G_math_alloc_spvector(), G_option_to_separator(), G_read_vector_timestamp(), G_str_to_color(), G_write_vector_timestamp(), get_key_data(), GP_delete_site(), gp_delete_site(), GP_draw_site(), gp_free_site(), gp_get_last_site(), gp_get_new_site(), gp_get_prev_site(), gp_get_site(), GP_get_trans(), GP_get_zmode(), gp_init_site(), gp_num_sites(), GP_select_surf(), gp_set_defaults(), GP_set_trans(), GP_set_zmode(), GP_site_exists(), GP_surf_is_selected(), GP_unselect_surf(), GP_unset_style_thematic(), GPJ__get_datum_params(), GPJ_init_transform(), GPJ_osr_to_grass(), gs_calc_normals(), GS_clear(), GS_default_draw_color(), gs_delete_surf(), GS_delete_surface(), GS_done_draw(), GS_draw_fringe(), GS_draw_surf(), GS_draw_wire(), gs_free_surf(), GS_get_aspect(), gs_get_att_src(), gs_get_att_typbuff(), gs_get_att_type(), GS_get_drawres(), GS_get_exag_guess(), GS_get_focus(), GS_get_from(), gs_get_last_surface(), GS_get_modelposition1(), gs_get_new_surface(), gs_get_prev_surface(), gs_get_surf(), GS_get_to(), GS_get_trans(), GS_get_zextents(), GS_get_zrange(), gs_getall_surfaces(), GS_global_exag(), gs_init_surf(), gs_malloc_lookup(), GS_moveto(), GS_new_surface(), gs_num_datah_reused(), gs_num_surfaces(), GS_ready_draw(), gs_set_att_const(), GS_set_att_defaults(), gs_set_defaults(), GS_set_drawres(), GS_set_exag(), GS_set_focus(), GS_set_focus_center_map(), GS_set_global_exag(), GS_set_infocus(), GS_set_nofocus(), GS_set_trans(), GS_set_viewport(), GS_set_wire_color(), GS_surf_exists(), Gs_update_attrange(), gs_update_curmask(), gsd_surf(), gsd_wire_arrows(), gsd_wire_surf(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsds_free_datah(), gv_delete_vect(), GV_delete_vector(), gv_free_vect(), gv_get_last_vect(), gv_get_new_vect(), gv_get_prev_vect(), gv_get_vect(), gv_init_vect(), gv_num_vects(), gv_set_defaults(), GV_set_trans(), GV_unset_style_thematic(), GV_vect_exists(), GVL_delete_vol(), gvl_delete_vol(), GVL_draw_wire(), gvl_file_free_datah(), gvl_free_vol(), GVL_get_dims(), gvl_get_last_vol(), gvl_get_new_vol(), gvl_get_prev_vol(), gvl_get_vol(), gvl_getall_vols(), gvl_init_vol(), GVL_isosurf_add(), GVL_isosurf_del(), gvl_isosurf_freemem(), gvl_isosurf_get_att_src(), GVL_isosurf_get_drawres(), GVL_isosurf_get_flags(), gvl_isosurf_get_isosurf(), gvl_isosurf_init(), GVL_isosurf_num_isosurfs(), gvl_isosurf_set_att_changed(), gvl_isosurf_set_att_const(), GVL_isosurf_set_att_const(), GVL_isosurf_set_drawres(), GVL_isosurf_set_flags(), GVL_isosurf_unset_att(), GVL_new_vol(), gvl_num_vols(), GVL_set_draw_wire(), GVL_set_focus_center_map(), GVL_set_trans(), GVL_slice_get_drawres(), GVL_slice_num_slices(), GVL_slice_set_drawres(), GVL_vol_exists(), gvld_vol(), gvld_wind3_box(), gvld_wire_vol(), I_cluster_exec_allocate(), I_cluster_sum2(), I_find_subgroup(), I_find_subgroup2(), I_find_subgroup_file(), I_find_subgroup_file2(), I_iclass_add_signature(), I_iclass_analysis(), I_iclass_free_statistics(), I_iclass_init_group(), I_iclass_init_signatures(), I_iclass_init_statistics(), M_do_copy(), make_all_statistics(), N_alloc_gradient_field_2d(), N_alloc_gradient_field_3d(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_calc_gradient_field_2d_stats(), N_calc_gradient_field_3d_stats(), N_compute_gradient_field_2d(), N_compute_gradient_field_3d(), N_copy_array_2d(), N_copy_array_3d(), N_copy_gradient_2d(), N_copy_gradient_3d(), N_copy_gradient_field_2d(), N_copy_gradient_field_3d(), N_copy_gradient_neighbours_2d(), N_copy_gradient_neighbours_3d(), N_copy_gradient_neighbours_x(), N_copy_gradient_neighbours_y(), N_copy_gradient_neighbours_z(), N_create_27star(), N_create_5star(), N_create_7star(), N_create_9star(), N_create_gradient_2d(), N_create_gradient_3d(), N_create_gradient_neighbours_2d(), N_create_gradient_neighbours_3d(), N_create_gradient_neighbours_x(), N_create_gradient_neighbours_y(), N_create_gradient_neighbours_z(), N_free_les(), N_get_geom_data_area_of_cell(), N_get_gradient_2d(), N_get_gradient_neighbours_2d(), N_init_geom_data_3d(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), Nviz_get_exag(), Nviz_get_exag_height(), Nviz_get_viewpoint_position(), Nviz_look_here(), Nviz_set_rotation(), Nviz_set_viewpoint_persp(), Nviz_set_viewpoint_position(), Nviz_set_viewpoint_twist(), open_band_files(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), perimeter_add_point(), pg_addedge(), PNG_Graph_set(), print_vol_fields(), Rast__create_window_mapping(), Rast__error_handler(), Rast_get_next_marked_d_cat(), Rast_read_fp_range(), Rast_sort_cats(), Rast_unset_window(), rbtree_traverse(), rbtree_traverse_backwd(), read_band_row(), read_coor(), seg_setup(), sort_intersection_list(), sub_Vectmem(), V1_close_nat(), V1_close_ogr(), V1_close_pg(), V1_delete_line_nat(), V1_delete_line_ogr(), V1_delete_line_pg(), V1_open_new_nat(), V1_open_new_ogr(), V1_open_new_pg(), V1_open_old_nat(), V1_open_old_ogr(), V1_open_old_pg(), V1_read_next_line_nat(), V1_read_next_line_pg(), V1_rewind_ogr(), V1_rewind_pg(), V2_close_ogr(), V2_close_pg(), V2_open_old_ogr(), V2_open_old_pg(), V2_rewind_ogr(), V2_rewind_pg(), Vect__execute_get_value_pg(), Vect__execute_pg(), Vect__insert_face_pg(), Vect__load_map_lines_pg(), Vect__load_map_nodes_pg(), Vect__load_plus_head(), Vect__open_cursor_next_line_pg(), Vect__read_head(), Vect_array_to_cat_list(), Vect_attach_isle(), Vect_attach_isles(), Vect_build_line_area(), Vect_build_ogr(), Vect_build_partial(), Vect_build_pg(), Vect_build_sidx_from_topo(), Vect_cat_list_to_array(), Vect_check_dblink(), Vect_cidx_dump(), Vect_cidx_get_field_index(), Vect_cidx_open(), Vect_cidx_save(), Vect_close(), Vect_coor_info(), Vect_copy(), Vect_find_area(), Vect_find_node(), Vect_get_area_centroid(), Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_area_points(), Vect_get_area_points_geos(), Vect_get_dblink(), Vect_get_field(), Vect_get_field2(), Vect_get_field_by_name(), Vect_get_field_number(), Vect_get_finfo_dsn_name(), Vect_get_finfo_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_isle_area(), Vect_get_isle_points(), Vect_get_isle_points_geos(), Vect_get_next_line_id(), Vect_get_point_in_poly_isl(), Vect_get_proj_name(), Vect_graph_add_edge(), Vect_graph_build(), Vect_graph_init(), Vect_graph_set_node_costs(), Vect_hist_command(), Vect_hist_copy(), Vect_hist_rewind(), Vect_hist_write(), Vect_line_parallel2(), Vect_map_del_dblink(), Vect_net_get_line_cost(), Vect_net_get_node_cost(), Vect_open_fidx(), Vect_open_new(), Vect_open_tmp_new(), Vect_open_topo(), Vect_point_buffer2(), Vect_point_in_poly(), Vect_read_dblinks(), Vect_read_next_line(), Vect_rewind(), Vect_save_fidx(), Vect_save_sidx(), Vect_save_topo(), Vect_select_areas_by_polygon(), Vect_select_isles_by_box(), Vect_select_nodes_by_box(), Vect_set_thresh(), Vect_set_updated(), Vect_spatial_index_add_item(), Vect_spatial_index_del_item(), Vect_spatial_index_destroy(), Vect_spatial_index_init(), Vect_write_dblinks(), vector2perimeters(), Vedit_delete_area_centroid(), Vedit_delete_areas_cat(), and Vedit_get_min_distance().
int G_default_compressor | ( | void | ) |
Definition at line 126 of file compress.c.
Referenced by Rast__error_handler().
struct Flag* G_define_flag | ( | void | ) |
Initializes a Flag struct.
Allocates memory for the Flag structure and returns a pointer to this memory.
Flags are always represented by single letters. A user "turns them on" at the command line using a minus sign followed by the character representing the flag.
Definition at line 156 of file parser.c.
References G_malloc, G_zero(), NULL, and st.
Referenced by G_define_standard_flag().
struct GModule* G_define_module | ( | void | ) |
struct Option* G_define_option | ( | void | ) |
Initializes an Option struct.
Allocates memory for the Option structure and returns a pointer to this memory.
Options are provided by user on command line using the standard format: key=value. Options identified as REQUIRED must be specified by user on command line. The option string can either specify a range of values (e.g. "10-100") or a list of acceptable values (e.g. "red,orange,yellow"). Unless the option string is NULL, user provided input will be evaluated against this string.
Definition at line 210 of file parser.c.
References G_malloc, G_zero(), Option::multiple, NO, Option::required, and st.
Referenced by G_define_standard_option(), M_define_option(), N_define_standard_option(), and Rast3d_set_window_params().
struct Flag* G_define_standard_flag | ( | int | flag | ) |
Create standardised Flag structure.
This function will create a standardised Flag structure defined by parameter flag. A list of valid parameters below. It allocates memory for the Flag structure and returns a pointer to this memory.
If an invalid parameter was specified a empty Flag structure will be returned (not NULL).
flag | type of Flag struct to create specified by STD_FLG enum. |
Definition at line 969 of file parser_standard_options.c.
References _, Flag::description, G_define_flag(), G_FLG_V_TABLE, G_FLG_V_TOPO, Flag::key, and Flag::label.
struct Option* G_define_standard_option | ( | int | opt | ) |
Create standardised Option structure.
This function will create a standardised Option structure defined by parameter opt.
Valid parameters are defined by the STD_OPT enum in the file gis.h. A list of valid parameter values sorted to groups is below.
This function allocates memory for the Option structure and returns a pointer to this memory.
If an invalid parameter was specified a empty Option structure will be returned (not NULL).
Values also need to be added to general/g.parser/standard_option.c
opt | type of Option struct to create specified by STD_OPT enum |
Definition at line 139 of file parser_standard_options.c.
References _, Option::answer, DEFAULT_FG_COLOR, Option::description, Option::descriptions, G_asprintf(), G_color_rules_description_type(), G_color_rules_options(), G_define_option(), G_getenv_nofatal(), G_OPT_C, G_OPT_CN, G_OPT_DB_COLUMN, G_OPT_DB_COLUMNS, G_OPT_DB_DATABASE, G_OPT_DB_DRIVER, G_OPT_DB_KEYCOLUMN, G_OPT_DB_SCHEMA, G_OPT_DB_SQL, G_OPT_DB_TABLE, G_OPT_DB_WHERE, G_OPT_F_BIN_INPUT, G_OPT_F_INPUT, G_OPT_F_OUTPUT, G_OPT_F_SEP, G_OPT_I_GROUP, G_OPT_I_SUBGROUP, G_OPT_M_COLR, G_OPT_M_COORDS, G_OPT_M_DATATYPE, G_OPT_M_DBASE, G_OPT_M_DIR, G_OPT_M_LOCATION, G_OPT_M_MAPSET, G_OPT_M_NPROCS, G_OPT_M_NULL_VALUE, G_OPT_M_REGION, G_OPT_M_UNITS, G_OPT_MAP_INPUT, G_OPT_MAP_INPUTS, G_OPT_MAP_TYPE, G_OPT_MEMORYMB, G_OPT_R3_COMPRESSION, G_OPT_R3_INPUT, G_OPT_R3_INPUTS, G_OPT_R3_MAP, G_OPT_R3_MAPS, G_OPT_R3_OUTPUT, G_OPT_R3_PRECISION, G_OPT_R3_TILE_DIMENSION, G_OPT_R3_TYPE, G_OPT_R_BASE, G_OPT_R_BASENAME_INPUT, G_OPT_R_BASENAME_OUTPUT, G_OPT_R_COVER, G_OPT_R_ELEV, G_OPT_R_ELEVS, G_OPT_R_INPUT, G_OPT_R_INPUTS, G_OPT_R_INTERP_TYPE, G_OPT_R_MAP, G_OPT_R_MAPS, G_OPT_R_OUTPUT, G_OPT_R_OUTPUTS, G_OPT_R_TYPE, G_OPT_STDS_INPUT, G_OPT_STDS_INPUTS, G_OPT_STDS_OUTPUT, G_OPT_STDS_TYPE, G_OPT_STR3DS_INPUT, G_OPT_STR3DS_INPUTS, G_OPT_STR3DS_OUTPUT, G_OPT_STRDS_INPUT, G_OPT_STRDS_INPUTS, G_OPT_STRDS_OUTPUT, G_OPT_STRDS_OUTPUTS, G_OPT_STVDS_INPUT, G_OPT_STVDS_INPUTS, G_OPT_STVDS_OUTPUT, G_OPT_T_SAMPLE, G_OPT_T_TYPE, G_OPT_T_WHERE, G_OPT_V3_TYPE, G_OPT_V_CAT, G_OPT_V_CATS, G_OPT_V_FIELD, G_OPT_V_FIELD_ALL, G_OPT_V_ID, G_OPT_V_IDS, G_OPT_V_INPUT, G_OPT_V_INPUTS, G_OPT_V_MAP, G_OPT_V_MAPS, G_OPT_V_OUTPUT, G_OPT_V_TYPE, G_store(), Option::gisprompt, GV_KEY_COLUMN, Option::key, Option::key_desc, Option::label, Option::multiple, NO, Option::options, Option::required, Option::type, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, and YES.
void G_disable_interactive | ( | void | ) |
Disables the ability of the parser to operate interactively.
When a user calls a command with no arguments on the command line, the parser will enter its own standardized interactive session in which all flags and options are presented to the user for input. A call to G_disable_interactive() disables the parser's interactive prompting.
Definition at line 139 of file parser.c.
References st.
double G_distance | ( | double | e1, |
double | n1, | ||
double | e2, | ||
double | n2 | ||
) |
Returns distance in meters.
This routine computes the distance, in meters, from x1,y1 to x2,y2. If the projection is latitude-longitude, this distance is measured along the geodesic. Two routines perform geodesic distance calculations.
e1,n1 | east-north coordinates of first point |
e2,n2 | east-north coordinates of second point |
Definition at line 75 of file gis/distance.c.
References G_geodesic_distance(), and PROJECTION_LL.
Referenced by Vect_line_geodesic_distance().
double G_distance2_point_to_line | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | |||
) |
Definition at line 15 of file gis/line_dist.c.
double G_distance_between_line_segments | ( | double | ax1, |
double | ay1, | ||
double | ax2, | ||
double | ay2, | ||
double | bx1, | ||
double | by1, | ||
double | bx2, | ||
double | by2 | ||
) |
Returns distance between two line segments in meters.
ax1,ay1,ax2,ay2 | first segment |
bx1,by1,bx2,by2 | second segment |
Definition at line 91 of file gis/distance.c.
References G_intersect_line_segments(), and x.
double G_distance_point_to_line_segment | ( | double | xp, |
double | yp, | ||
double | x1, | ||
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Returns distance between a point and line segment in meters.
xp,yp | point coordinates |
x1,y1 | segment point coordinates |
x2,y2 | segment point coordinates |
Definition at line 120 of file gis/distance.c.
void G_done_msg | ( | const char * | , |
... | |||
) |
char* G_double_to_basename_format | ( | double | number, |
size_t | ndigits, | ||
size_t | ndecimals | ||
) |
Convert a double to a string substituting the dot with underscore 12.3456 => '12_3456'.
number | the double number that will be convert to string |
ndigits | the number of integer digits in the output string |
ndecimals | the number of decimals in the output string |
Definition at line 79 of file basename.c.
References G_malloc, and GNAME_MAX.
Referenced by G_generate_basename().
double G_drand48 | ( | void | ) |
Generate a floating-point value in the range [0,1)
Definition at line 158 of file lrand48.c.
References r.
Referenced by G_math_rand().
const char* G_ellipsoid_description | ( | int | n | ) |
Get description for nth ellipsoid.
This function returns a pointer to the description text for the nth ellipsoid. If n is less than 0 or greater than the number of known ellipsoids, it returns a NULL pointer.
n | ellipsoid identificator |
Definition at line 184 of file get_ellipse.c.
References G_read_ellipsoid_table().
const char* G_ellipsoid_name | ( | int | n | ) |
Get ellipsoid name.
This function returns a pointer to the short name for the nth ellipsoid. If n is less than 0 or greater than the number of known ellipsoids, it returns a NULL pointer.
n | ellipsoid identificator |
Definition at line 133 of file get_ellipse.c.
References G_read_ellipsoid_table().
double G_ellipsoid_polygon_area | ( | const double * | lon, |
const double * | lat, | ||
int | n | ||
) |
Area of lat-long polygon.
Returns the area in square meters of the polygon described by the n pairs of lat,long vertices for latitude-longitude grids.
Note: This routine computes the area of a polygon on the ellipsoid. The sides of the polygon are rhumb lines and, in general, not geodesics. Each side is actually defined by a linear relationship between latitude and longitude, i.e., on a rectangular/equidistant cylindrical/Plate Carr{'e}e grid, the side would appear as a straight line. For two consecutive vertices of the polygon, (lat_1, long1) and (lat_2,long_2), the line joining them (i.e., the polygon's side) is defined by:
lat_2 - lat_1 lat = lat_1 + (long - long_1) * --------------- long_2 - long_1
where long_1 < long < long_2. The values of QbarA, etc., are determined by the integration of the Q function. Into www.integral-calculator.com, paste this expression :
sin(x)+ (2/3)e^2(sin(x))^3 + (3/5)e^4(sin(x))^5 + (4/7)e^6(sin(x))^7
and you'll get their values. (Last checked 30 Oct 2013).
This function correctly computes (within the limits of the series approximation) the area of a quadrilateral on the ellipsoid when two of its sides run along meridians and the other two sides run along parallels of latitude.
lon | array of longitudes |
lat | array of latitudes |
n | number of lat,lon pairs |
Definition at line 129 of file area_poly1.c.
Referenced by G_area_of_polygon().
int G_expand | ( | unsigned char * | , |
int | , | ||
unsigned char * | , | ||
int | , | ||
int | |||
) |
Definition at line 236 of file compress.c.
Referenced by G_read_compressed().
int G_faprintf | ( | FILE * | stream, |
const char * | format, | ||
... | |||
) |
fprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | stream | file pointer |
[in] | format | string format |
[in] | ... | arguments for the format string |
void void void void G_fatal_error | ( | const char * | , |
... | |||
) |
Referenced by AS_option_to_algorithm(), Cairo_Graph_set(), cairo_read_xid(), cairo_write_bmp(), cairo_write_ppm(), cairo_write_xid(), check_create_import_opts(), clean_dir(), db_set_default_connection(), dig__read_head(), dig_area_del_isle(), dig_fwrite(), dig_load_plus(), dig_node_line_angle(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), dig_spidx_del_area(), dig_spidx_del_isle(), dig_spidx_del_node(), dig_Wr_spidx_head(), G__read_gisrc_path(), G_adjust_Cell_head(), G_adjust_Cell_head3(), G_adjust_window_ll(), G_config_path(), G_fseek(), G_getenv(), G_getenv2(), G_home(), G_list(), G_location_path(), G_ls2(), G_make_mapset(), G_mapset(), G_mapset_path(), G_open_option_file(), G_option_to_separator(), G_owner(), G_read_key_value_file(), G_srand48_auto(), G_vector_norm_euclid(), G_vector_norm_maxval(), G_write_key_value_file(), G_write_projsrid(), G_write_projwkt(), G_zstd_compress_bound(), GK_print_keys(), GPJ_init_transform(), I_sort_signatures_by_semantic_label(), I_SortSigSetBySemanticLabel(), IL_create_bitmask(), IL_write_temp_2d(), M_do_list(), M_do_remove(), main(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_compute_gradient_field_2d(), N_compute_gradient_field_3d(), N_compute_gradient_field_components_2d(), N_compute_gradient_field_components_3d(), N_copy_array_2d(), N_copy_array_3d(), NetA_betweenness_closeness(), NetA_flow(), NetA_initialise_varray(), NetA_min_cut(), NetA_strongly_connected_components(), NetA_weakly_connected_components(), pg_addedge(), port_init(), Rast3d_fatal_error_noargs(), Rast__check_fp_type(), Rast__check_null_bit(), Rast__null_bitstream_size(), Rast__open_null_write(), Rast__open_old(), Rast_close(), Rast_get_cellhd(), Rast_get_vrt(), Rast_map_is_fp(), Rast_map_type(), Rast_option_to_interp_type(), Rast_put_cellhd(), Rast_put_reclass(), Rast_quantize_fp_map(), Rast_read_histogram(), Rast_set_fp_type(), Rast_set_quant_rules(), Rast_unopen(), Rast_window_cols(), Rast_window_rows(), Rast_write_fp_range(), Rast_write_history(), Rast_write_quant(), Rast_write_range(), Rast_write_rstats(), read_image(), RTreeWriteBranch(), RTreeWriteNode(), seg_seek_fast(), seg_seek_slow(), V1_close_nat(), V1_close_ogr(), V1_close_pg(), V1_delete_line_ogr(), V1_delete_line_pg(), V1_open_new_ogr(), V1_open_old_ogr(), V1_rewind_ogr(), V1_rewind_pg(), V2__write_area_sfa(), V2_close_ogr(), V2_close_pg(), V2_open_old_ogr(), V2_open_old_pg(), V2_rewind_ogr(), V2_rewind_pg(), Vect__get_area_points(), Vect_build_line_area(), Vect_build_ogr(), Vect_build_partial(), Vect_build_sidx(), Vect_cat_set(), Vect_cats_set_constraint(), Vect_copy(), Vect_get_area_centroid(), Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_isle_area(), Vect_get_isle_points(), Vect_graph_add_edge(), Vect_graph_build(), Vect_new_line_struct(), Vect_new_map_struct(), Vect_open_fidx(), Vect_overlay(), Vect_save_fidx(), Vect_save_frmt(), Vect_set_db_updated(), Vect_sfa_get_num_features(), Vect_spatial_index_del_item(), write_bmp(), write_image(), write_pgm(), and write_ppm().
jmp_buf* G_fatal_longjmp | ( | int | ) |
Definition at line 67 of file gis/error.c.
char* G_file_name | ( | char * | path, |
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
Builds full path names to GIS data files.
If name is of the form "nnn@ppp" then path is set as if name had been "nnn" and mapset had been "ppp" (mapset parameter itself is ignored in this case).
Paths to files are currently in form: /path/to/location/mapset/element/name
path input buffer memory must be allocated by caller.
C:
Python:
[out] | path | allocated buffer to hold resultant full path to file |
element | database element (eg, "cell", "cellhd", "vector", etc) | |
name | name of file to build path to (fully qualified names allowed) | |
mapset | mapset name |
Definition at line 61 of file file_name.c.
Referenced by G_get_projepsg(), G_get_projinfo(), G_get_projunits(), G_has_vector_timestamp(), G_make_mapset_element(), G_mapset_permissions(), G_myname(), G_rename(), G_write_projsrid(), G_write_projwkt(), list_subgroups(), M__empty(), M_do_copy(), main(), Rast_map_is_fp(), Rast_map_type(), V1_close_nat(), Vect__get_element_path(), and Vect_copy().
char* G_file_name_misc | ( | char * | path, |
const char * | dir, | ||
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
Builds full path names to GIS misc data files.
Paths to misc files are currently in form: /path/to/location/mapset/dir/name/element
path input buffer memory must be allocated by caller.
C:
Python:
[out] | path | allocated buffer to hold resultant full path to file |
dir | misc directory (e.g., "cell_misc", "group") | |
element | database element (in this case – file to build path to e.g., "history", "REF") | |
name | name of object (raster, group; fully qualified names allowed e.g., "my_raster@PERMANENT") | |
mapset | mapset name |
Definition at line 101 of file file_name.c.
Referenced by Rast3d_filename(), Rast__check_fp_type(), and Rast__close_null().
char* G_file_name_tmp | ( | char * | path, |
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
Builds full path names to GIS data files in temporary directory (for internal use only)
By default temporary directory is located $LOCATION/$MAPSET/.tmp/$HOSTNAME. If GRASS_VECTOR_TMPDIR_MAPSET is set to "0", the temporary directory is located in TMPDIR (environmental variable defined by the user or GRASS initialization script if not given). Note that GRASS_VECTOR_TMPDIR_MAPSET variable is currently used only by vector library.
[out] | path | buffer to hold resultant full path to file |
element | database element (eg, "cell", "cellhd", "vector", etc) | |
name | name of file to build path to (fully qualified names allowed) | |
mapset | mapset name |
Definition at line 126 of file file_name.c.
References getenv(), and NULL.
Referenced by G_make_mapset_element_tmp(), and Vect__get_element_path().
int G_find_color_rule | ( | const char * | name | ) |
Check if color rule is defined.
name | color rule name |
Definition at line 247 of file gis/color_rules.c.
char* G_find_etc | ( | const char * | name | ) |
searches for a file from the etc search list in GRASS_ADDON_ETC returns the full path to where the file was found.
note: rejects all names that begin with "."
name | file name to look for |
Definition at line 63 of file find_etc.c.
const char* G_find_file | ( | const char * | element, |
char * | name, | ||
const char * | mapset | ||
) |
Searches for a file from the mapset search list or in a specified mapset.
Returns the mapset name where the file was found.
If the user specifies a fully qualified element (name) which exists, then G_find_file() modifies "name" by removing the "@mapset" part.
Rejects all names that begin with "."
If name is of the form nnn in ppp then only mapset ppp is searched.
element | database element (eg, "cell", "cellhd", "colr", etc) |
name | file name to look for |
mapset | mapset to search. if mapset is "" will search in mapset search list |
Definition at line 203 of file find_file.c.
Referenced by G_find_raster(), and G_find_vector().
const char* G_find_file2 | ( | const char * | element, |
const char * | name, | ||
const char * | mapset | ||
) |
Searches for a file from the mapset search list or in a specified mapset. (look but don't touch)
Returns the mapset name where the file was found.
Exactly the same as G_find_file() except that if name is in the form "<i>name@mapset</i>", and is found, G_find_file2() will not alter name by removing the "@<i>mapset</i>" part.
Rejects all names that begin with "."
element | database element (eg, "cell", "cellhd", "colr", etc) |
name | file name to look for |
mapset | mapset to search. if mapset is "" will search in mapset search list |
Definition at line 249 of file find_file.c.
Referenced by G_find_raster2(), G_find_vector2(), Gs_load_3dview(), I_find_group(), I_find_group2(), M_find(), V1_close_ogr(), and Vect_close().
const char* G_find_file2_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
Searches for a misc file from the mapset search list or in a specified mapset. (look but don't touch)
Returns the mapset name where the misc file was found. Paths to misc files currently follow structure: mapset/dir/name/element
dir | file directory |
element | database element (eg, "cell", "cellhd", "colr", etc) |
name | file name to look for |
mapset | mapset to search. if mapset is "" will search in mapset search list |
Definition at line 270 of file find_file.c.
Referenced by G_find_raster3d(), G_has_raster3d_timestamp(), G_has_raster_timestamp(), I_find_group_file(), I_find_group_file2(), I_find_subgroup(), I_find_subgroup2(), I_find_subgroup_file(), I_find_subgroup_file2(), Rast_read_fp_range(), Rast_read_histogram(), and Rast_read_range().
const char* G_find_file_misc | ( | const char * | dir, |
const char * | element, | ||
char * | name, | ||
const char * | mapset | ||
) |
Searches for a misc file from the mapset search list or in a specified mapset.
Returns the mapset name where the misc file was found. Paths to misc files currently follow structure: mapset/dir/name/element
dir | file directory |
element | database element (eg, "cell", "cellhd", "colr", etc) |
name | file name to look for |
mapset | mapset to search. if mapset is "" will search in mapset search list |
Definition at line 224 of file find_file.c.
Referenced by Rast3d_mask_file_exists().
const char* G_find_key_value | ( | const char * | key, |
const struct Key_Value * | kv | ||
) |
Find given key (case sensitive)
key | key to be found |
kv | pointer to Key_value structure |
Definition at line 84 of file key_value1.c.
Referenced by G_compare_projections(), G_get_datumparams_from_projinfo(), G_get_projinfo(), GPJ__get_datum_params(), GPJ_grass_to_osr2(), GPJ_osr_to_grass(), Rast__check_fp_type(), and Vect_close().
const char* G_find_raster | ( | char * | name, |
const char * | mapset | ||
) |
Find a raster map.
Looks for the raster map name in the database. The mapset parameter can either be the empty string "", which means search all the mapsets in the user's current mapset search path (see Mapset_Search_Path for more details about the search path) or it can be a specific mapset name, which means look for the raster map only in this one mapset (for example, in the current mapset). If found, the mapset where the raster map lives is returned. If not found, the NULL pointer is returned.
Note: If the user specifies a fully qualified raster map which exists, then G_find_raster() modifies name by removing the "@<i>mapset</i>".
For example, to find a raster map anywhere in the database:
To check that the raster map exists in the current mapset:
[in,out] | name | map name |
mapset | mapset name or "" |
Definition at line 55 of file find_rast.c.
References G_debug(), and G_find_file().
Referenced by I_iclass_init_group(), Rast__check_for_auto_masking(), Rast__mask_info(), Rast_get_cellhd(), and Rast_get_vrt().
const char* G_find_raster2 | ( | const char * | name, |
const char * | mapset | ||
) |
Find a raster map (look but don't touch)
The same as G_find_raster() but doesn't remove the "@<i>mapset</i>" qualification from name, if present.
Returns NULL if the map wasn't found, or the mapset the raster was found in if it was.
name | map name |
mapset | mapset name or "" |
Definition at line 76 of file find_rast.c.
References G_debug(), and G_find_file2().
Referenced by gsd_put_legend(), IL_create_bitmask(), M_do_remove(), M_do_rename(), Rast__check_fp_type(), Rast__open_null_write(), Rast__open_old(), Rast_get_vrt(), Rast_map_is_fp(), Rast_map_to_img_str(), and Rast_map_type().
const char* G_find_raster3d | ( | const char * | name, |
const char * | mapset | ||
) |
Search for a 3D raster map in current search path or in a specified mapset.
Note: rejects all names that begin with '.'
name | map name |
mapset | mapset to search. ("" for search path) |
Definition at line 28 of file find_rast3d.c.
References G_find_file2_misc().
Referenced by M_do_remove(), and M_do_rename().
const char* G_find_vector | ( | char * | name, |
const char * | mapset | ||
) |
Finds a vector map.
Searches for a vector map from the mapset search list or in a specified mapset. Returns the mapset name where the vector map was found.
NOTES: If the user specifies a fully qualified vector map which exists, then G_find_vector() modifies name by removing the "@<i>mapset</i>" part.
Rejects all names that begin with "."
name | vector map name |
mapset | mapset name or "" for search path |
Definition at line 41 of file find_vect.c.
References G_debug(), G_find_file(), and GV_DIRECTORY.
const char* G_find_vector2 | ( | const char * | name, |
const char * | mapset | ||
) |
Find a vector map (look but don't touch)
The same as G_find_vector() but doesn't remove the "@<i>mapset</i>" qualification from name, if present.
Returns NULL if the map wasn't found, or the mapset the vector was found in if it was.
name | vector map name |
mapset | mapset name where to search |
Definition at line 62 of file find_vect.c.
References G_debug(), G_find_file2(), and GV_DIRECTORY.
Referenced by M_do_remove(), M_do_rename(), and Vect_copy().
FILE* G_fopen_append | ( | const char * | element, |
const char * | name | ||
) |
Open a database file for update (append mode)
The database file name under the element in the current mapset is opened for for writing. The UNIX fopen() routine, with "a" append mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file descriptor from the fopen() is returned.
element | database element name |
name | map file name |
Definition at line 280 of file gis/open.c.
FILE* G_fopen_append_misc | ( | const char * | , |
const char * | , | ||
const char * | |||
) |
Definition at line 222 of file open_misc.c.
Referenced by I_fopen_group_file_append(), and I_fopen_subgroup_file_append().
FILE* G_fopen_modify | ( | const char * | element, |
const char * | name | ||
) |
Open a database file for update (r+ mode)
The database file name under the element in the current mapset is opened for for writing. The UNIX fopen() routine, with "r+" append mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file descriptor from the fopen() is returned.
element | database element name |
name | map file name |
Definition at line 308 of file gis/open.c.
Referenced by V1_open_new_nat(), and V1_open_old_nat().
FILE* G_fopen_modify_misc | ( | const char * | , |
const char * | , | ||
const char * | |||
) |
Definition at line 235 of file open_misc.c.
FILE* G_fopen_new | ( | const char * | element, |
const char * | name | ||
) |
Open a new database file.
The database file name under the element in the current mapset is created and opened for writing (but not reading). The UNIX fopen() routine, with "w" write mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the fopen() is returned.
element | database element name |
name | map file name |
Definition at line 220 of file gis/open.c.
Referenced by G_put_3dview(), G_write_vector_timestamp(), I_put_group(), Rast__quant_export(), Rast_put_cellhd(), Rast_write_history(), V1_open_new_nat(), Vect__write_head(), Vect_save_frmt(), Vect_save_topo(), and Vect_write_dblinks().
FILE* G_fopen_new_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name | ||
) |
open a new database misc file
The database file element under dir/name in the current mapset is created and opened for writing (but not reading). The UNIX fopen( ) routine, with "w" write mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the fopen( ) is returned.
element | |
name |
Definition at line 182 of file open_misc.c.
Referenced by I_fopen_group_file_new(), I_fopen_signature_file_new(), I_fopen_sigset_file_new(), I_fopen_subgroup_file_new(), Rast3d_write_cats(), Rast3d_write_colors(), Rast3d_write_history(), Rast__quant_export(), and Rast_write_range().
FILE* G_fopen_old | ( | const char * | element, |
const char * | name, | ||
const char * | mapset | ||
) |
Open a database file for reading.
The database file name under the element in the specified mapset is opened for reading (but not for writing). The UNIX fopen() routine, with "r" read mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file descriptor from the fopen() is returned.
element | database element name |
name | map file name |
mapset | mapset name containing map name |
Definition at line 253 of file gis/open.c.
Referenced by G_read_vector_timestamp(), I_get_group(), Rast__quant_import(), Rast_get_cell_title(), Rast_get_cellhd(), Rast_read_history(), V1_open_old_nat(), Vect__read_head(), Vect_cidx_open(), Vect_close(), Vect_open_fidx(), and Vect_open_topo().
FILE* G_fopen_old_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
open a database misc file for reading
The database file element under dir/name in the specified mapset is opened for reading (but not for writing). The UNIX fopen( ) routine, with "r" read mode, is used to open the file. If the file does not exist, the NULL pointer is returned. Otherwise the file descriptor from the fopen( ) is returned.
element | |
name | |
mapset |
Definition at line 210 of file open_misc.c.
Referenced by fopen_group_file_old(), fopen_subgroup_file_old(), I_fopen_signature_file_old(), I_fopen_sigset_file_old(), Rast3d_read_history(), Rast_get_vrt(), Rast_is_reclassed_to(), Rast_read_histogram(), and Rast_read_range().
void G_format_easting | ( | double | east, |
char * | buf, | ||
int | projection | ||
) |
Easting to ASCII.
Converts the double representation of the east coordinate to its ASCII representation (into buf).
east | easting | |
[out] | buf | buffer to hold formatted string |
projection | projection code, or -1 to force full precision FP |
Definition at line 49 of file wind_format.c.
References G_lon_format(), and PROJECTION_LL.
Referenced by G__write_Cell_head().
void G_format_northing | ( | double | north, |
char * | buf, | ||
int | projection | ||
) |
Northing to ASCII.
Converts the double representation of the north coordinate to its ASCII representation (into buf).
north | northing | |
[out] | buf | buffer to hold formatted string |
projection | projection code, or -1 to force full precision FP |
Definition at line 29 of file wind_format.c.
References G_lat_format(), and PROJECTION_LL.
Referenced by G__write_Cell_head().
void G_format_resolution | ( | double | res, |
char * | buf, | ||
int | projection | ||
) |
Resolution to ASCII.
Converts the double representation of the resolution to its ASCII representation (into buf).
resolution | resolution value | |
[out] | buf | buffer to hold formatted string |
projection | projection code, or -1 to force full precision FP |
Definition at line 69 of file wind_format.c.
References G_llres_format(), and PROJECTION_LL.
Referenced by G__write_Cell_head(), and G__write_Cell_head3().
int G_format_timestamp | ( | const struct TimeStamp * | ts, |
char * | buf | ||
) |
Create text string from TimeStamp structure.
Fills string *buf with info from TimeStamp structure *ts in a pretty way. The TimeStamp struct is defined in gis.h and populated with e.g. G_read_raster_timestamp().
ts | TimeStamp structure containing time info |
buf | string to receive formatted timestamp |
Definition at line 181 of file timestamp.c.
struct Key_Value* G_fread_key_value | ( | FILE * | fd | ) |
Read key/values pairs from file.
Allocated memory must be freed G_free_key_value().
fd | file to read key/values from |
Definition at line 49 of file key_value2.c.
Referenced by G_read_key_value_file(), and Vect_close().
void G_free | ( | void * | buf | ) |
Free allocated memory.
[in,out] | buf | buffer holding original data |
Definition at line 149 of file gis/alloc.c.
References free(), and G_incr_void_ptr.
Referenced by cairo_write_ppm(), close_band_files(), db_CatValArray_free(), db_d_append_error(), destroy_si_struct(), dig_cidx_free(), dig_file_free(), dig_free_area(), dig_free_isle(), dig_free_line(), dig_free_node(), dig_free_plus_areas(), dig_free_plus_isles(), dig_free_plus_lines(), dig_free_plus_nodes(), free_datum_list(), free_ellps_list(), free_fontcap(), free_perimeters(), free_slice_buff(), free_vol_buff(), free_volfile_buffs(), G__read_Cell_head(), G_free_fmatrix(), G_free_fvector(), G_free_ilist(), G_free_imatrix(), G_free_ivector(), G_free_key_value(), G_free_list(), G_free_ls_filter(), G_free_matrix(), G_free_tokens(), G_free_vector(), G_get_available_mapsets(), G_init_ilist(), G_list(), G_ls(), G_ls_regex_filter(), G_math_free_spmatrix(), G_math_free_spvector(), G_math_solver_sparse_gs(), G_math_solver_sparse_jacobi(), G_matrix_free(), G_matrix_LU_solve(), G_read_compressed(), G_vector_free(), gk_free_key(), gk_make_linear_framesfromkeys(), gp_free_site(), GPJ_free_datum(), GPJ_free_datum_transform(), GPJ_free_ellps(), GPJ_init_transform(), GPJ_osr_to_grass(), GPJ_set_csv_loc(), gs_free_surf(), gs_init_normbuff(), gs_malloc_lookup(), GS_write_ppm(), GS_write_tif(), gv_free_vect(), gv_free_vectmem(), gvl_free_vol(), GVL_isosurf_del(), gvl_isosurf_freemem(), Gvl_unload_colors_data(), I_free(), I_free_double2(), I_free_double3(), I_free_int2(), I_free_signatures_list(), I_iclass_free_statistics(), I_sc_free_cats(), kdtree_destroy(), N_free_geom_data(), N_free_gradient_2d(), N_free_gradient_3d(), N_free_gradient_field_2d(), N_free_gradient_field_3d(), N_free_gradient_neighbours_2d(), N_free_gradient_neighbours_3d(), N_free_gradient_neighbours_x(), N_free_gradient_neighbours_y(), N_free_gradient_neighbours_z(), N_free_les(), NetA_timetable_result_release(), Nviz_destroy_render_window(), Nviz_draw_all_site(), Nviz_draw_all_vol(), Nviz_get_exag(), path_free(), pg_destroy_struct(), Rast__close_null(), Rast__color_free_fp_lookup(), Rast__color_free_lookup(), Rast__create_window_mapping(), Rast_clear_history(), Rast_close_gdal_link(), Rast_close_gdal_write_link(), Rast_close_vrt(), Rast_command_history(), Rast_format_history(), Rast_fpreclass_reset(), Rast_free_cats(), Rast_free_cell_stats(), Rast_free_histogram(), Rast_free_history(), Rast_free_reclass(), Rast_get_vrt_row(), Rast_map_to_img_str(), Rast_quant_free(), Rast_set_d_cat(), Rast_set_history(), Segment_close(), Segment_release(), set_proj_share(), tgis_free_map_list(), tgis_init_map_list(), V1_close_ogr(), V1_close_pg(), Vect__close_cursor_pg(), Vect__free_cache(), Vect__free_offset(), Vect__insert_face_pg(), Vect_build_ogr(), Vect_build_pg(), Vect_close(), Vect_destroy_boxlist(), Vect_destroy_cat_list(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_destroy_map_struct(), Vect_get_finfo_geometry_type(), Vect_new_varray(), Vect_set_comment(), Vect_set_date(), Vect_set_map_date(), Vect_set_map_name(), Vect_set_organization(), Vect_set_person(), and write_pgm().
void G_free_ilist | ( | struct ilist * | list | ) |
Free allocated memory of an integer list.
list | The pointer to an integer list |
Definition at line 27 of file ilist.c.
References G_free(), and ilist::value.
Referenced by Rast_close_vrt().
void G_free_key_value | ( | struct Key_Value * | kv | ) |
Free allocated Key_Value structure.
[in] | kv | Key_Value structure to be freed |
Definition at line 103 of file key_value1.c.
References G_free(), Key_Value::key, Key_Value::nalloc, Key_Value::nitems, and Key_Value::value.
Referenced by G_get_projinfo(), GPJ_get_datum_params(), and Rast__check_fp_type().
void G_free_list | ( | char ** | list | ) |
Free list.
list | char* array to be freed |
Definition at line 251 of file gis/list.c.
References G_free().
void G_free_ls_filter | ( | void * | ) |
Definition at line 191 of file ls_filter.c.
References G_free().
void G_free_tokens | ( | char ** | tokens | ) |
Free memory allocated to tokens.
Note: G_free_tokens() must be called when finished with tokens to release memory.
[out] | tokens |
Definition at line 204 of file gis/token.c.
References G_free(), and NULL.
Referenced by check_create_export_opts(), check_create_import_opts(), GPJ_grass_to_osr2(), V1_close_ogr(), and Vect__open_cursor_next_line_pg().
void G_fseek | ( | FILE * | fp, |
off_t | offset, | ||
int | whence | ||
) |
Change the file position of the stream.
The value of whence must be one of the constants `SEEK_SET', `SEEK_CUR', or `SEEK_END', to indicate whether the offset is relative to the beginning of the file, the current file position, or the end of the file, respectively.
fp | file descriptor |
offset | offset |
whence |
Definition at line 50 of file gis/seek.c.
References _, and G_fatal_error().
Referenced by dfread_header(), dfwrite_header(), dig_fseek(), G__read_Cell_head(), IL_write_temp_2d(), new_dspf(), open_stream(), AMI_STREAM< T >::seek(), AMI_STREAM< T >::stream_len(), Vect_hist_copy(), and Vect_open_fidx().
off_t G_ftell | ( | FILE * | fp | ) |
Get the current file position of the stream.
fp | file descriptor |
Definition at line 29 of file gis/seek.c.
Referenced by dfwrite_header(), dig_ftell(), AMI_STREAM< T >::read_item(), AMI_STREAM< T >::stream_len(), Vect_hist_copy(), and AMI_STREAM< T >::write_item().
char* G_fully_qualified_name | ( | const char * | name, |
const char * | mapset | ||
) |
Get fully qualified element name.
Returns a fully qualified name for GIS element name in mapset. Currently this string is in the form name, but the programmer should pretend not to know this and always call this routine to get the fully qualified name.
String is allocated by G_store().
name | element name |
mapset | mapset name |
Definition at line 101 of file nme_in_mps.c.
References G_store(), GMAPSET_MAX, and GNAME_MAX.
Referenced by M_do_copy(), Rast__check_fp_type(), Rast__open_old(), Rast__quant_import(), Rast_map_is_fp(), Rast_quantize_fp_map(), Rast_read_fp_range(), and Rast_read_range().
int G_fwrite_key_value | ( | FILE * | fd, |
const struct Key_Value * | kv | ||
) |
Write key/value pairs to file.
[in,out] | fd | file to write to |
kv | pointer Key_Value structure |
Definition at line 25 of file key_value2.c.
References err(), Key_Value::key, Key_Value::nitems, and Key_Value::value.
Referenced by G_write_key_value_file().
char* G_generate_basename | ( | const char * | basename, |
double | number, | ||
size_t | ndigits, | ||
size_t | ndecimals | ||
) |
Generate the format string.
basename | String with the basename |
digits | Number of digits number |
decimals | Number of decimal number |
filler | String used to fill, default is 0 |
Definition at line 168 of file basename.c.
References G_double_to_basename_format(), G_get_basename_separator(), and G_malloc.
double G_geodesic_distance | ( | double | lon1, |
double | lat1, | ||
double | lon2, | ||
double | lat2 | ||
) |
Calculates geodesic distance.
Calculates the geodesic distance from lon1,lat1 to lon2,lat2 in meters.
Note: The calculation of the geodesic distance is fairly costly.
lon1,lat1 | longitude,latitude of first point |
lon2,lat2 | longitude,latitude of second point |
Definition at line 196 of file geodist.c.
References G_geodesic_distance_lon_to_lon(), G_set_geodesic_distance_lat1(), and G_set_geodesic_distance_lat2().
Referenced by G_distance().
double G_geodesic_distance_lon_to_lon | ( | double | lon1, |
double | lon2 | ||
) |
Calculates geodesic distance.
Calculates the geodesic distance from lon1,lat1 to lon2,lat2 in meters where lat1 was the latitude passed to G_set_geodesic_distance_latl() and lat2 was the latitude passed to G_set_geodesic_distance_lat2().
lon1 | first longitude |
lon2 | second longitude |
Definition at line 121 of file geodist.c.
Referenced by G_geodesic_distance().
double G_geodesic_lat_from_lon | ( | double | ) |
Definition at line 75 of file geodesic.c.
int G_get_3dview | ( | const char * | fname, |
const char * | mapset, | ||
struct G_3dview * | View | ||
) |
Gets a 3D View.
If reading an old format, the window boundaries are not checked against the current window since boundaries weren't saved.
[in] | fname | |
[in] | mapset | |
[in,out] | View |
Definition at line 251 of file view.c.
Referenced by Gs_load_3dview().
Sets default for v based on w.
[in,out] | v | |
[in] | w |
Definition at line 62 of file view.c.
References G_3dview::ambient, G_3dview::bg_col, G_3dview::colorgrid, Cell_head::cols, Cell_head::compressed, G_3dview::display_type, G_3dview::doavg, G_3dview::dozero, Cell_head::east, Cell_head::ew_res, G_3dview::exag, Cell_head::format, G_3dview::fov, G_3dview::fringe, G_3dview::from_to, G_3dview::grid_col, G_3dview::lightcol, G_3dview::lightpos, G_3dview::lightson, G_3dview::mesh_freq, Cell_head::north, Cell_head::ns_res, G_3dview::other_col, G_3dview::poly_freq, Cell_head::proj, Cell_head::rows, G_3dview::shading, G_3dview::shine, Cell_head::south, G_3dview::surfonly, G_3dview::twist, G_3dview::vwin, Cell_head::west, and Cell_head::zone.
Referenced by Gs_save_3dview().
char** G_get_available_mapsets | ( | void | ) |
Get list of available mapsets for current location.
List is updated by each call to this function.
Definition at line 144 of file mapset_nme.c.
References G_calloc, G_debug(), G_free(), G_location_path(), G_realloc, G_stat(), G_store(), GPATH_MAX, NULL, opendir(), and readdir().
char* G_get_basename_separator | ( | ) |
Return the environmental basename variable or the default value.
return pointer to basename separator
Definition at line 112 of file basename.c.
References GBASENAME_SEP, getenv(), and NULL.
Referenced by G_generate_basename(), and G_join_basename_strings().
int G_get_datum_by_name | ( | const char * | ) |
Definition at line 45 of file gis/datum.c.
References G_read_datum_table().
int G_get_datumparams_from_projinfo | ( | const struct Key_Value * | , |
char * | , | ||
char * | |||
) |
Definition at line 109 of file gis/datum.c.
References G_find_key_value(), and NULL.
void G_get_default_window | ( | struct Cell_head * | window | ) |
Get the default region.
Reads the default region for the location into region. 3D values are set to defaults if not available in WIND file.
An error message is printed and exit() is called if there is a problem reading the default region.
[out] | window | pointer to Cell_head |
Definition at line 93 of file get_window.c.
Referenced by G_make_mapset().
void G_get_element_window | ( | struct Cell_head * | window, |
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
Get region for selected element (raster, vector, window, etc.)
G_fatal_error() is called on error
[out] | window | pointer to Cell_head |
element | element type | |
name | element name | |
mapset | mapset name |
Definition at line 108 of file get_window.c.
int G_get_ellipsoid_by_name | ( | const char * | name, |
double * | a, | ||
double * | e2 | ||
) |
Get ellipsoid parameters by name.
This routine returns the semi-major axis a (in meters) and eccentricity squared e2 for the named ellipsoid.
name | ellipsoid name | |
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
Definition at line 105 of file get_ellipse.c.
int G_get_ellipsoid_parameters | ( | double * | a, |
double * | e2 | ||
) |
get ellipsoid parameters
This routine returns the semi-major axis a (in meters) and the eccentricity squared e2 for the ellipsoid associated with the database. If there is no ellipsoid explicitly associated with the database, it returns the values for the WGS 84 ellipsoid.
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
Definition at line 67 of file get_ellipse.c.
const char* G_get_env_name | ( | int | n | ) |
Get variable name for index n.
For example:
n | index of variable |
int G_get_gisrc_mode | ( | void | ) |
const char* G_get_mapset_name | ( | int | n | ) |
Get name of the n'th mapset from the current mapset search path.
The first call will initialize the list.
n | mapset index |
Definition at line 44 of file mapset_nme.c.
References G__get_list_of_mapsets(), and NULL.
size_t G_get_num_decimals | ( | const char * | str | ) |
Get number of decimals from a string.
str | String to analyse |
Definition at line 58 of file basename.c.
References NULL.
int G_get_overwrite | ( | ) |
Get overwrite value.
Definition at line 934 of file parser.c.
References st.
Referenced by V1_open_new_ogr().
struct Key_Value* G_get_projepsg | ( | void | ) |
Gets EPSG information for the current location.
DEPRECATED: Use G_get_projsrid() instead.
Note: Allocated Key_Value structure should be freed by G_free_key_value().
Definition at line 102 of file get_projinfo.c.
References EPSG_FILE, G_debug(), G_file_name(), G_location(), G_projection(), G_read_key_value_file(), GPATH_MAX, NULL, PERMANENT, and PROJECTION_XY.
Referenced by G_get_projinfo().
struct Key_Value* G_get_projinfo | ( | void | ) |
Gets projection information for location.
Note: Allocated Key_Value structure should be freed by G_free_key_value().
Prints a warning if no projection information available.
Definition at line 61 of file get_projinfo.c.
References _, G_file_name(), G_find_key_value(), G_free_key_value(), G_get_projepsg(), G_location(), G_projection(), G_read_key_value_file(), G_set_key_value(), G_warning(), GPATH_MAX, NULL, PERMANENT, PROJECTION_FILE, and PROJECTION_XY.
Referenced by GPJ_get_datum_params().
char* G_get_projsrid | ( | void | ) |
Get srid (spatial reference id) for the current location.
Typically an srid will be of the form authority NAME:CODE, e.g. EPSG:4326
This srid is passed to proj_create() using PROJ or OSRSetFromUserInput() using GDAL. Therefore various other forms of srid are possible, e.g. in OSRSetFromUserInput():
PROJJSON (PROJ >= 6.2)
Definition at line 233 of file get_projinfo.c.
struct Key_Value* G_get_projunits | ( | void | ) |
Gets units information for location.
Note: Allocated Key_Value structure should be freed by G_free_key_value().
Prints a warning if no units information available.
Definition at line 32 of file get_projinfo.c.
References _, G_file_name(), G_location(), G_projection(), G_read_key_value_file(), G_warning(), GPATH_MAX, NULL, PERMANENT, PROJECTION_XY, and UNIT_FILE.
char* G_get_projwkt | ( | void | ) |
Get WKT information for the current location.
Definition at line 127 of file get_projinfo.c.
void G_get_set_window | ( | struct Cell_head * | window | ) |
Get the current working window (region)
The current working window values are returned in the structure window
.
Previous calls to G_set_window() affects values returned by this function. Previous calls to G_put_window() affects values returned by this function only if the current working window is not initialized.
[out] | window | pointer to window structure to be set |
Definition at line 35 of file gis/set_window.c.
Referenced by D_setup(), G_projection(), G_setup_plot(), G_zone(), GS_get_to_real(), GS_set_focus_real(), I_iclass_analysis(), and N_init_geom_data_3d().
int G_get_spheroid_by_name | ( | const char * | name, |
double * | a, | ||
double * | e2, | ||
double * | f | ||
) |
Get spheroid parameters by name.
This function returns the semi-major axis a (in meters), the eccentricity squared e2 and the inverse flattening f for the named ellipsoid.
name | spheroid name | |
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
[out] | f | inverse flattening |
Definition at line 154 of file get_ellipse.c.
Copy TimeStamp into [two] Datetimes structs.
Use to copy the TimeStamp information into Datetimes, as the members of struct TimeStamp shouldn't be accessed directly.
ts | source TimeStamp structure | |
[out] | dt1 | first DateTime struct to be filled |
[out] | dt2 | second DateTime struct to be filled |
[out] | count | return code |
Definition at line 258 of file timestamp.c.
const char* G_get_units_name | ( | int | units, |
int | plural, | ||
int | square | ||
) |
Get localized units name.
Units codes (gis.h):
units | units code |
plural | plural form if true |
square | area units if true |
Definition at line 203 of file units.c.
References _, G_database_unit_name(), G_units(), NULL, U_ACRES, U_DAYS, U_DEGREES, U_FEET, U_HECTARES, U_HOURS, U_KILOMETERS, U_METERS, U_MILES, U_MINUTES, U_MONTHS, U_SECONDS, U_UNKNOWN, U_USFEET, and U_YEARS.
Referenced by G_database_unit_name(), Rast3d_get_vertical_unit(), and Rast3d_print_header().
void G_get_window | ( | struct Cell_head * | window | ) |
Get the current region.
Reads the region as stored in the WIND file in the user's current mapset into region.
3D values are set to defaults if not available in WIND file. An error message is printed and exit() is called if there is a problem reading the region.
Note: GRASS applications that read or write raster maps should not use this routine since its use implies that the active module region will not be used. Programs that read or write raster map data (or vector data) can query the active module region using Rast_window_rows() and Rast_window_cols().
[out] | window | pointer to Cell_head |
Definition at line 47 of file get_window.c.
Referenced by G__init_window(), G_point_in_region(), and P_set_dim().
const char* G_getenv | ( | const char * | name | ) |
Get environment variable.
G_fatal_error() is called when variable is not found.
name | variable name |
Definition at line 353 of file env.c.
References _, G_fatal_error(), G_getenv_nofatal(), and NULL.
Referenced by G_gisbase(), G_gisdbase(), and G_location().
const char* G_getenv2 | ( | const char * | name, |
int | loc | ||
) |
Get variable from specific place.
Locations:
G_fatal_error() is called when variable is not found.
name | variable name |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 379 of file env.c.
References _, G_fatal_error(), G_getenv_nofatal2(), and NULL.
const char* G_getenv_nofatal | ( | const char * | name | ) |
Get environment variable.
name | variable name |
Definition at line 398 of file env.c.
References getenv().
Referenced by G__mapset(), G_check_overwrite(), G_define_standard_option(), and G_getenv().
const char* G_getenv_nofatal2 | ( | const char * | name, |
int | loc | ||
) |
Get environment variable from specific place.
name | variable name |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 417 of file env.c.
References getenv().
Referenced by db_get_connection(), db_get_default_database_name(), db_get_default_driver_name(), db_get_default_group_name(), db_get_default_schema_name(), G_getenv2(), tgis_get_connection(), tgis_get_database_name(), and tgis_get_driver_name().
int G_getl | ( | char * | buf, |
int | n, | ||
FILE * | fd | ||
) |
Gets a line of text from a file.
This routine runs fgets() to fetch a line of text from a file (advancing file pointer) and removes trailing newline. fgets() does not recognize '\r
' as an EOL and will read past * it.
buf | string buffer to receive read data |
n | maximum number of bytes to read |
fd | file descriptor structure |
Definition at line 31 of file getl.c.
Referenced by G__read_Cell_head(), G_matrix_read(), G_myname(), Rast__read_history(), and Rast_get_cell_title().
int G_getl2 | ( | char * | buf, |
int | n, | ||
FILE * | fd | ||
) |
Gets a line of text from a file of any pedigree.
This routine is like G_getl() but is more portable. It supports text files created on various platforms (UNIX, MacOS9, DOS), i.e. \n (\012)
, \r (\015)
, and \r\n (\015\012)
style newlines.
Reads in at most n-1 characters from stream (the last spot is reserved for the end-of-string NUL) and stores them into the buffer pointed to by buf. Reading stops after an EOF or a newline. New line is not stored in the buffer. At least n must be allocated for the string buffer.
buf | string buffer to receive read data, at least n must be allocated |
n | maximum number of bytes to read |
fd | file descriptor structure |
Definition at line 64 of file getl.c.
Referenced by dig_read_frmt_ascii(), I_get_group_title(), Rast_get_vrt(), read_coor(), Vect__read_head(), and Vect_read_ascii_head().
const char* G_gisbase | ( | void | ) |
Get full path name of the top level module directory.
Returns the full path name of the top level directory for GRASS programs. This directory will have subdirectories which will contain modules and files required for the running of the system. Some of these directories are:
bin commands run by the user etc modules and data files used by GRASS commands
The use of G_gisbase() to find these subdirectories enables GRASS modules to be written independently of where the GRASS system is actually installed on the machine. For example, to run the module sroff in the GRASS etc directory:
Definition at line 41 of file gisbase.c.
References G_getenv().
Referenced by GPJ_osr_to_grass(), GPJ_set_csv_loc(), and parse_fontcap().
const char* G_gisdbase | ( | void | ) |
Get name of top level database directory.
Returns the full UNIX path name of the directory which holds the database locations.
Definition at line 26 of file gisdbase.c.
References G_getenv().
Referenced by G__location_path(), G__mapset_path(), G_make_mapset(), G_write_projsrid(), G_write_projwkt(), and Vect_hist_command().
int G_has_raster3d_timestamp | ( | const char * | name, |
const char * | mapset | ||
) |
Check if timestamp for 3D raster map exists.
name | map name |
mapset | mapset name |
Definition at line 573 of file timestamp.c.
References G_find_file2_misc(), and GRID3.
int G_has_raster_timestamp | ( | const char * | name, |
const char * | mapset | ||
) |
Check if timestamp for raster map exists.
name | map name |
mapset | mapset name |
Definition at line 354 of file timestamp.c.
References G_find_file2_misc(), and RAST_MISC.
int G_has_vector_timestamp | ( | const char * | name, |
const char * | layer, | ||
const char * | mapset | ||
) |
Check if timestamp for vector map exists.
name | map name |
layer | The layer names, in case of NULL, layer one is assumed |
mapset | mapset name |
Definition at line 420 of file timestamp.c.
References G_debug(), G_file_name(), G_snprintf(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, NULL, and R_OK.
Referenced by G_read_vector_timestamp().
const char* G_home | ( | void | ) |
Get user's home directory.
Returns a pointer to a string which is the full path name of the user's home directory.
Calls G_fatal_error() on failure.
Definition at line 32 of file home.c.
References _, G__home(), G_fatal_error(), and NULL.
Referenced by G_config_path().
void G_ilist_add | ( | struct ilist * | list, |
int | val | ||
) |
Add item to ilist.
This function adds an integer to the list but does not check for duplicates. In case reallocation fails, G_fatal_error() will be invoked by the allocation function.
list | The ilist pointer |
val | The value to attach |
Definition at line 77 of file ilist.c.
References ilist::alloc_values, G_realloc, ilist::n_values, and ilist::value.
Referenced by Rast_get_vrt().
void void void G_important_message | ( | const char * | , |
... | |||
) |
Referenced by GPJ_init_transform().
int G_info_format | ( | void | ) |
Get current message format.
Maybe set to either "standard" or "gui" (normally GRASS takes care)
Definition at line 532 of file gis/error.c.
References G_init_logging().
void G_init_all | ( | void | ) |
Initialize environment.
Definition at line 142 of file gisinit.c.
References G__check_gisinit(), G__get_list_of_mapsets(), G__home(), G__init_window(), G__machine_name(), G_init_debug(), G_init_env(), G_init_locale(), G_init_logging(), G_init_tempfile(), G_read_datum_table(), G_read_ellipsoid_table(), G_verbose(), and G_whoami().
void G_init_debug | ( | void | ) |
Initiate debugging.
Definition at line 27 of file debug.c.
References G_is_initialized().
Referenced by G_debug(), and G_init_all().
void G_init_env | ( | void | ) |
void G_init_ilist | ( | struct ilist * | list | ) |
Init an integer list and free allocated memory.
list | The pointer to an integer list |
Definition at line 57 of file ilist.c.
References ilist::alloc_values, G_free(), ilist::n_values, NULL, and ilist::value.
Referenced by G_new_ilist(), and RTreeSearch2().
void G_init_logging | ( | void | ) |
Definition at line 351 of file gis/error.c.
Referenced by G_info_format(), and G_init_all().
void G_init_tempfile | ( | void | ) |
Initialize environment for creating tempfiles.
Definition at line 29 of file tempfile.c.
References G_is_initialized().
Referenced by G_init_all(), and G_tempfile_pid().
void G_init_timestamp | ( | struct TimeStamp * | ts | ) |
Initialize timestamp structure.
ts | pointer to TimeStamp structure |
Definition at line 93 of file timestamp.c.
void G_initialize_done | ( | int * | ) |
Definition at line 76 of file counter.c.
Referenced by G__init_window(), G_config_path(), G_set_verbose(), G_verbose(), and Rast__init_window().
int G_insert_commas | ( | char * | buf | ) |
Inserts commas into a number string.
Examples:
Note: Does not work with negative numbers.
[in,out] | buf | string |
Definition at line 38 of file commas.c.
References color_name::number.
int G_intersect_line_segments | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
double * | |||
) |
Definition at line 80 of file gis/intersect.c.
Referenced by G_distance_between_line_segments().
int G_is_absolute_path | ( | const char * | path | ) |
Checks if a specified path looks like an absolute path on the host system.
path | String containing path to check |
Definition at line 62 of file paths.c.
References G_is_dirsep().
Referenced by COM_Set_font().
int G_is_dirsep | ( | char | c | ) |
Checks if a specified character is a valid directory separator character on the host system.
c | Character to check |
Definition at line 45 of file paths.c.
Referenced by G_is_absolute_path(), and G_parser().
int G_is_gisbase | ( | const char * | path | ) |
int G_is_initialized | ( | int * | ) |
Definition at line 59 of file counter.c.
Referenced by G__init_window(), G_config_path(), G_init_debug(), G_init_tempfile(), G_set_verbose(), G_verbose(), Rast__init(), Rast__init_window(), and Rast_create_gdal_link().
void int G_is_little_endian | ( | void | ) |
int G_is_location | ( | const char * | path | ) |
int G_is_mapset | ( | const char * | path | ) |
int G_is_mapset_in_search_path | ( | const char * | mapset | ) |
Check if given mapset is in search path.
mapset | mapset name |
Definition at line 214 of file mapset_nme.c.
Referenced by G_add_mapset_to_search_path().
int G_is_units_type_spatial | ( | int | units | ) |
int G_is_units_type_temporal | ( | int | units | ) |
char* G_join_basename_strings | ( | const char ** | strings, |
size_t | len | ||
) |
join an array of strings using the basename separator
strings | is an array of strings |
len | is the length of the array |
Definition at line 130 of file basename.c.
References G_get_basename_separator(), and G_malloc.
void G_lat_format | ( | double | , |
char * | |||
) |
Definition at line 41 of file ll_format.c.
Referenced by G_adjust_window_ll(), and G_format_northing().
const char* G_lat_format_string | ( | void | ) |
Definition at line 51 of file ll_format.c.
void G_lat_parts | ( | double | , |
int * | , | ||
int * | , | ||
double * | , | ||
char * | |||
) |
Definition at line 117 of file ll_format.c.
int G_lat_scan | ( | const char * | , |
double * | |||
) |
Definition at line 46 of file ll_scan.c.
Referenced by G_adjust_window_ll().
int G_legal_filename | ( | const char * | s | ) |
Check for legal database file name.
Legal file names will not begin with '.' or NULL and must not contain the characters, ' ' (space), '/', '"'. '\'' (single quote), '@', ',', '=', '*', and all other non-alphanumeric characters within.
The function prints a warning on error.
s | file name to check |
Definition at line 34 of file legal_name.c.
Referenced by G_make_mapset().
int G_limit_east | ( | double * | east, |
int | proj | ||
) |
Function not yet implemented...
If the projection has absolute limits (like lat/lon), then this routine modifies the input coordinate to be within the limit.
Note: Function not yet implemented.
[in] | east | |
[in] | proj |
Definition at line 35 of file wind_limits.c.
int G_limit_north | ( | double * | north, |
int | proj | ||
) |
Limit north (y) coordinate.
If the projection has absolute limits (like lat/lon), then this routine modifies the input coordinate to be within the limit.
[in,out] | north | north coordinate |
[in] | proj | projection id |
Definition at line 75 of file wind_limits.c.
References PROJECTION_LL.
int G_limit_south | ( | double * | south, |
int | proj | ||
) |
Limit south (y) coordinate.
If the projection has absolute limits (like lat/lon), then this routine modifies the input coordinate to be within the limit.
[in] | south | south coordinate |
[in] | proj | projection id |
Definition at line 105 of file wind_limits.c.
References PROJECTION_LL.
int G_limit_west | ( | double * | west, |
int | proj | ||
) |
Function not yet implemented...
If the projection has absolute limits (like lat/lon), then this routine modifies the input coordinate to be within the limit.
Note: Function not yet implemented.
[in] | west | |
[in] | proj |
Definition at line 56 of file wind_limits.c.
char** G_list | ( | int | element, |
const char * | gisbase, | ||
const char * | location, | ||
const char * | mapset | ||
) |
List specified type of elements. Application must release the allocated memory.
element | element type (G_ELEMENT_RASTER, G_ELEMENT_VECTOR, G_ELEMENT_REGION ) |
gisbase | path to GISBASE |
location | location name |
mapset | mapset name |
Definition at line 176 of file gis/list.c.
References _, count, G_calloc, G_ELEMENT_GROUP, G_ELEMENT_RASTER, G_ELEMENT_REGION, G_ELEMENT_VECTOR, G_fatal_error(), G_free(), G_malloc, list, NULL, opendir(), and readdir().
void G_list_color_rules | ( | FILE * | out | ) |
Print color rules.
out | file where to print |
Definition at line 175 of file gis/color_rules.c.
void G_list_color_rules_description_type | ( | FILE * | out, |
char * | name | ||
) |
Print color rules with description and type.
The type of color rule including range is appended to the description. If a color rule name is given, color info is printed only for this rule.
name | optional color rule name, or NULL |
out | file where to print |
Definition at line 198 of file gis/color_rules.c.
void G_list_element | ( | const char * | element, |
const char * | desc, | ||
const char * | mapset, | ||
int(*)(const char *, const char *, const char *) | lister | ||
) |
General purpose list function.
Will list files from all mapsets in the mapset list for a specified database element.
Note: output is to stdout piped thru the more utility
Given file name, and mapset, lister() should copy a string into 'buf' when called with name == "", should set buf to general title for mapset list.
element | database element (eg, "cell", "cellhd", etc.) |
desc | description for element (if NULL, element is used) |
mapset | mapset to be listed "" to list all mapsets in mapset search list "." will list current mapset |
lister | if given will call this routine to get a list title. NULL if no titles desired. |
Definition at line 50 of file gis/list.c.
Referenced by M_do_list().
void G_llres_format | ( | double | , |
char * | |||
) |
Definition at line 71 of file ll_format.c.
Referenced by G_adjust_window_ll(), and G_format_resolution().
const char* G_llres_format_string | ( | void | ) |
Definition at line 82 of file ll_format.c.
int G_llres_scan | ( | const char * | , |
double * | |||
) |
Definition at line 56 of file ll_scan.c.
Referenced by G_adjust_window_ll(), and G_scan_resolution().
const char* G_location | ( | void | ) |
Get current location name.
Returns the name of the current database location. This routine should be used by modules that need to display the current location to the user. See Locations for an explanation of locations.
Definition at line 32 of file location.c.
References G_getenv().
Referenced by G__location_path(), G__mapset_path(), G_get_projepsg(), G_get_projinfo(), G_get_projunits(), G_make_mapset(), I_location_info(), and Vect_hist_command().
char* G_location_path | ( | void | ) |
Get current location UNIX-like path.
Allocated buffer should be freed by G_free(). See G__location_path().
Returns the full UNIX path name of the current database location. For example, if the user is working in location spearfish in the /home/user/grassdata database directory, this routine will return a string which looks like /home/user/grassdata/spearfish.
This function also checks if location path is readable by the current user. It calls G_fatal_error() on failure.
Definition at line 54 of file location.c.
References _, G__location_path(), and G_fatal_error().
Referenced by db_set_default_connection(), and G_get_available_mapsets().
void G_lon_format | ( | double | , |
char * | |||
) |
Definition at line 56 of file ll_format.c.
Referenced by G_adjust_window_ll(), and G_format_easting().
const char* G_lon_format_string | ( | void | ) |
Definition at line 66 of file ll_format.c.
void G_lon_parts | ( | double | , |
int * | , | ||
int * | , | ||
double * | , | ||
char * | |||
) |
Definition at line 133 of file ll_format.c.
int G_lon_scan | ( | const char * | , |
double * | |||
) |
Definition at line 51 of file ll_scan.c.
Referenced by G_adjust_window_ll().
int G_lookup_key_value_from_file | ( | const char * | file, |
const char * | key, | ||
char | value[], | ||
int | n | ||
) |
Look up for key in file.
[in] | file | filename |
[in] | key | key to be found in file |
[out] | value | value for key |
[in] | n | number of characters to be copied |
Definition at line 48 of file key_value4.c.
Referenced by GPJ_osr_to_grass().
long G_lrand48 | ( | void | ) |
void G_ls | ( | const char * | dir, |
FILE * | stream | ||
) |
Prints a directory listing to a stream, in prettified column format.
A replacement for system("ls -C"). Lists the contents of the directory specified to the given stream, e.g. stderr. Tries to determine an appropriate column width to keep the number of lines used to a minimum and look pretty on the screen.
dir | Directory to list |
stream | Stream to print listing to |
Definition at line 137 of file ls.c.
References G_free(), G_ls2(), and G_ls_format().
char** G_ls2 | ( | const char * | dir, |
int * | num_files | ||
) |
Stores a sorted directory listing in an array.
The filenames in the specified directory are stored in an array of strings, then sorted alphabetically. Each filename has space allocated using G_store(), which can be freed using G_free() if necessary. The same goes for the array itself.
dir | Directory to list |
num_files | Pointer to an integer in which the total number of files listed will be stored |
Definition at line 95 of file ls.c.
References _, G_fatal_error(), G_realloc, G_store(), NULL, opendir(), and readdir().
Referenced by G_ls(), and list_subgroups().
void G_ls_format | ( | char ** | list, |
int | num_items, | ||
int | perline, | ||
FILE * | stream | ||
) |
Prints a listing of items to a stream, in prettified column format.
Lists the contents of the array passed to the given stream, e.g. stderr. Prints the number of items specified by "perline" to each line, unless perline is given as 0 in which case the function tries to determine an appropriate column width to keep the number of lines used to a minimum and look pretty on the screen.
list | Array of strings containing items to be printed |
num_items | Number of items in the array |
perline | Number of items to print per line, 0 for autodetect |
stream | Stream to print listing to |
Definition at line 165 of file ls.c.
References max, and screen_width.
Referenced by G_ls().
void* G_ls_glob_filter | ( | const char * | , |
int | , | ||
int | |||
) |
Definition at line 172 of file ls_filter.c.
void* G_ls_regex_filter | ( | const char * | , |
int | , | ||
int | , | ||
int | |||
) |
Definition at line 152 of file ls_filter.c.
References G_free(), G_malloc, G_set_ls_exclude_filter(), and NULL.
int G_lstat | ( | const char * | file_name, |
struct stat * | buf | ||
) |
Get file status.
Returns information about the specified file.
file_name | file name, in the case of a symbolic link, the link itself is stat-ed, not the file that it refers to |
stat | pointer to structure filled with file information |
Definition at line 145 of file paths.c.
Referenced by G_recursive_remove(), and list_subgroups().
int G_lz4_compress | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
int G_lz4_expand | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
int G_make_location | ( | const char * | location_name, |
struct Cell_head * | wind, | ||
const struct Key_Value * | proj_info, | ||
const struct Key_Value * | proj_units | ||
) |
Create a new location.
This function creates a new location in the current database, initializes the projection, default window and current window.
location_name | Name of the new location. Should not include the full path, the location will be created within the current database. |
wind | default window setting for the new location. All fields should be set in this structure, and care should be taken to ensure that the proj/zone fields match the definition in the proj_info parameter(see G_set_cellhd_from_projinfo()). |
proj_info | projection definition suitable to write to the PROJ_INFO file, or NULL for PROJECTION_XY. |
proj_units | projection units suitable to write to the PROJ_UNITS file, or NULL. |
Definition at line 53 of file make_loc.c.
int G_make_location_crs | ( | const char * | location_name, |
struct Cell_head * | wind, | ||
const struct Key_Value * | proj_info, | ||
const struct Key_Value * | proj_units, | ||
const char * | proj_srid, | ||
const char * | proj_wkt | ||
) |
Create a new location.
This function creates a new location in the current database, initializes the projection, default window and current window, and sets WKT, srid, and EPSG code if present
location_name | Name of the new location. Should not include the full path, the location will be created within the current database. |
wind | default window setting for the new location. All fields should be set in this structure, and care should be taken to ensure that the proj/zone fields match the definition in the proj_info parameter(see G_set_cellhd_from_projinfo()). |
proj_info | projection definition suitable to write to the PROJ_INFO file, or NULL for PROJECTION_XY. |
proj_units | projection units suitable to write to the PROJ_UNITS file, or NULL. |
proj_epsg | EPSG code suitable to write to the PROJ_EPSG file, or NULL. |
proj_wkt | WKT definition suitable to write to the PROJ_WKT file, or NULL. |
proj_srid | Spatial reference ID suitable to write to the PROJ_SRID file, or NULL. |
Definition at line 186 of file make_loc.c.
int G_make_location_epsg | ( | const char * | location_name, |
struct Cell_head * | wind, | ||
const struct Key_Value * | proj_info, | ||
const struct Key_Value * | proj_units, | ||
const struct Key_Value * | proj_epsg | ||
) |
Create a new location.
This function creates a new location in the current database, initializes the projection, default window and current window, and sets the EPSG code if present
location_name | Name of the new location. Should not include the full path, the location will be created within the current database. |
wind | default window setting for the new location. All fields should be set in this structure, and care should be taken to ensure that the proj/zone fields match the definition in the proj_info parameter(see G_set_cellhd_from_projinfo()). |
proj_info | projection definition suitable to write to the PROJ_INFO file, or NULL for PROJECTION_XY. |
proj_units | projection units suitable to write to the PROJ_UNITS file, or NULL. |
proj_epsg | EPSG code suitable to write to the PROJ_EPSG file, or NULL. |
Definition at line 127 of file make_loc.c.
int G_make_mapset | ( | const char * | gisdbase_name, |
const char * | location_name, | ||
const char * | mapset_name | ||
) |
Create a new mapset.
This function creates a new mapset in the given location, initializes default window and the current window.
Calls G_fatal_error() if location doesn't exist.
gisdbase_name | full path of GISDBASE to create mapset in (NULL for the current GISDBASE) |
location_name | name of location to create mapset in (NULL for the current location) |
mapset_name | Name of the new mapset. Should not include the full path, the mapset will be created within the specified database and location. |
Definition at line 43 of file make_mapset.c.
References _, G_create_alt_env(), G_fatal_error(), G_get_default_window(), G_gisdbase(), G_legal_filename(), G_location(), G_mkdir(), G_put_element_window(), G_setenv_nogisrc(), G_switch_env(), GPATH_MAX, and NULL.
int G_make_mapset_dir_object | ( | const char * | type, |
const char * | name | ||
) |
Create directory for an object of a given type.
Creates the specified element directory in the current mapset. It will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists to ensure that it exists.
Any failure to create it, including the case when it exists (i.e., was created by another process after the existence test) is considered a failure because two processes should not attempt to create two objects of the same name (and type).
This function is for objects which are directories (the function does not create files).
Calls G_fatal_error() on failure.
type | object type (e.g., vector ) |
name | object name (e.g., bridges ) |
Definition at line 108 of file mapset_msc.c.
Referenced by G__make_mapset_element_misc(), Rast3d_make_mapset_map_directory(), and Vect_copy().
int G_make_mapset_element | ( | const char * | p_element | ) |
Create element in the current mapset.
Make the specified element in the current mapset will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists.
Calls G_fatal_error() on failure.
p_element | element to be created in mapset |
Definition at line 44 of file mapset_msc.c.
References G_file_name(), G_mapset(), GPATH_MAX, and NULL.
int G_make_mapset_element_tmp | ( | const char * | p_element | ) |
Create element in the temporary directory.
See G_file_name_tmp() for details.
p_element | element to be created in mapset (e.g., elevation ) |
Definition at line 131 of file mapset_msc.c.
References G_file_name_tmp(), G_mapset(), GPATH_MAX, and NULL.
int G_make_mapset_object_group | ( | const char * | type | ) |
Create directory for group of elements of a given type.
Creates the specified element directory in the current mapset. It will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists to ensure that it exists.
If creation fails, but the directory exists after the failure, the function reports success. Therefore, two processes creating a directory in this way can work in parallel.
Calls G_fatal_error() on failure.
type | object type (e.g., cell ) |
Definition at line 74 of file mapset_msc.c.
Referenced by db_set_default_connection(), M_do_copy(), and Rast__quant_export().
int G_make_mapset_object_group_tmp | ( | const char * | type | ) |
Create directory for type of objects in the temporary directory.
See G_file_name_tmp() for details.
type | object type (e.g., cell ) |
Definition at line 153 of file mapset_msc.c.
const char* G_mapset | ( | void | ) |
Get current mapset name.
Returns the name of the current mapset in the current location. This routine is often used when accessing files in the current mapset. See Mapsets for an explanation of mapsets.
G_fatal_error() is called on error.
Definition at line 33 of file gis/mapset.c.
References _, G__mapset(), and G_fatal_error().
Referenced by check_mapset_in_layer_name(), db_set_default_connection(), fopen_group_file_old(), fopen_subgroup_file_old(), G_make_mapset_element(), G_make_mapset_element_tmp(), G_read_vector_timestamp(), G_rename(), G_write_vector_timestamp(), Gs_save_3dview(), I_find_group(), I_find_group_file(), I_find_subgroup(), I_find_subgroup_file(), I_fopen_group_file_append(), I_fopen_group_file_new(), I_fopen_signature_file_old(), I_fopen_sigset_file_old(), I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), I_get_control_points(), I_get_group(), I_list_subgroups(), I_location_info(), I_put_control_points(), M__empty(), M_do_copy(), M_do_remove(), M_do_rename(), main(), Rast3d_mask_file_exists(), Rast3d_write_colors(), Rast__check_for_auto_masking(), Rast__close_null(), Rast__mask_info(), Rast__open_null_write(), Rast__quant_export(), Rast__quant_import(), Rast_remove_colors(), Rast_write_range(), V1_close_ogr(), Vect_close(), Vect_copy(), Vect_hist_command(), Vect_remove_colors(), Vect_save_fidx(), and Vect_set_db_updated().
char* G_mapset_path | ( | void | ) |
Get current mapset UNIX-like path.
Allocated buffer should be freed by G_free(). See G__mapset_path().
Returns the full UNIX path name of the current mapset. For example, if the user is working in mapset user1, location spearfish in the /home/user/grassdata database directory, this routine will return a string which looks like /home/user/grassdata/spearfish/user1.
This function also checks if mapset path is readable by the current user. It calls G_fatal_error() on failure.
Definition at line 73 of file gis/mapset.c.
References _, G__mapset_path(), and G_fatal_error().
int G_mapset_permissions | ( | const char * | mapset | ) |
Check for user mapset permission.
mapset | mapset name |
Definition at line 262 of file mapset_msc.c.
References G_file_name(), G_stat(), and GPATH_MAX.
int G_mapset_permissions2 | ( | const char * | gisdbase, |
const char * | location, | ||
const char * | mapset | ||
) |
Check for user mapset permission.
gisdbase | full path to GISDBASE |
location | location name |
mapset | mapset name |
Definition at line 291 of file mapset_msc.c.
double G_meridional_radius_of_curvature | ( | double | lon, |
double | a, | ||
double | e2 | ||
) |
void G_message | ( | const char * | , |
... | |||
) |
double G_meters_to_units_factor | ( | int | units | ) |
Units conversion from meters to units.
Units codes (gis.h):
Returns a factor which converts meters to units (by multiplication).
units | units code |
Definition at line 37 of file units.c.
References U_FEET, U_KILOMETERS, U_METERS, U_MILES, and U_USFEET.
double G_meters_to_units_factor_sq | ( | int | units | ) |
Units conversion from square meters to square units.
Units codes (gis.h):
Returns a factor which converts square meters to square units (by multiplication).
units | units code |
Definition at line 87 of file units.c.
References U_ACRES, U_FEET, U_HECTARES, U_KILOMETERS, U_METERS, U_MILES, and U_USFEET.
int G_mkdir | ( | const char * | path | ) |
Creates a new directory.
Creates a new directory with permissions 0777 (on Unix) or default permissions(?) on Windows.
path | String containing path of directory to be created |
Definition at line 27 of file paths.c.
Referenced by G_config_path(), G_make_mapset(), and V1_close_nat().
int G_mkstemp | ( | char * | template, |
int | flags, | ||
int | mode | ||
) |
Returns a file descriptor.
This routine opens the file and returns a descriptor.
The last two take the arguments "flags" and "mode". "flags" should be O_WRONLY or O_RDWR, plus any other desired flags (e.g. O_APPEND). "mode" is the file mode (0666 would be typical).
The functions does not use the PID, although the caller can do so.
In theory, up to 26^5 (= ~12 million) filenames will be attempted until it finds one which doesn't exist.
Definition at line 127 of file mkstemp.c.
Referenced by ami_single_temp_name().
FILE* G_mkstemp_fp | ( | char * | template, |
int | flags, | ||
int | mode | ||
) |
Returns a file descriptor.
This routine opens the file and returns a FILE*.
The last two take the arguments "flags" and "mode". "flags" should be O_WRONLY or O_RDWR, plus any other desired flags (e.g. O_APPEND). "mode" is the file mode (0666 would be typical).
The functions does not use the PID, although the caller can do so.
In theory, up to 26^5 (= ~12 million) filenames will be attempted until it finds one which doesn't exist.
char* G_mktemp | ( | char * | template | ) |
Opens a temporary file.
This routine opens the file.
The last two take the arguments "flags" and "mode". "flags" should be O_WRONLY or O_RDWR, plus any other desired flags (e.g. O_APPEND). "mode" is the file mode (0666 would be typical).
The functions does not use the PID, although the caller can do so.
In theory, up to 26^5 (= ~12 million) filenames will be attempted until it finds one which doesn't exist.
Note: G_mktemp() as such it is prone to race conditions (some other process may create that file after G_mktemp() returns).
long G_mrand48 | ( | void | ) |
char* G_myname | ( | void | ) |
Returns location title.
Returns a one line title for the database location. This title is read from the file MYNAME in the PERMANENT mapset. See also Permanent_Mapset for a discussion of the PERMANENT mapset.
Note: This name is the first line in the file $GISDBASE/$LOCATION_NAME/PERMANENT/MYNAME
Definition at line 31 of file myname.c.
References _, G_file_name(), G_getl(), G_store(), GNAME_MAX, GPATH_MAX, and name.
int G_name_is_fully_qualified | ( | const char * | fullname, |
char * | name, | ||
char * | mapset | ||
) |
Check if map name is fully qualified (map @ mapset)
Returns a fully qualified name for the file name in mapset. Currently this string is in the form name, but the programmer should pretend not to know this and always call this routine to get the fully qualified name.
Note:
fullname | full map name | |
[out] | name | map name |
[out] | mapset | mapset name |
Definition at line 36 of file nme_in_mps.c.
References name.
Referenced by G_rename(), G_unqualified_name(), M_do_remove(), Rast__quant_export(), Rast__quant_import(), Rast_remove_colors(), Vect_copy(), and Vect_remove_colors().
struct ilist* G_new_ilist | ( | ) |
Return a new integer list.
G_fatal_error() will be invoked by the allocation function.
Definition at line 43 of file ilist.c.
References G_init_ilist(), G_malloc, l, NULL, and ilist::value.
Referenced by Rast_get_vrt().
void G_newlines_to_spaces | ( | char * | ) |
Definition at line 3 of file nl_to_spaces.c.
Referenced by Rast_set_cats_title(), and Rast_set_d_cat().
int G_no_compress | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 156 of file compress.c.
int G_no_expand | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 178 of file compress.c.
int G_num_standard_colors | ( | void | ) |
Get number of named colors (RGB triplets)
Definition at line 65 of file color_str.c.
int G_number_of_tokens | ( | char ** | tokens | ) |
Return number of tokens.
tokens |
Definition at line 185 of file gis/token.c.
References NULL.
Referenced by G_set_keywords(), GPJ_grass_to_osr2(), and Vect__open_cursor_next_line_pg().
FILE* G_open_mail | ( | struct Popen * | ) |
Definition at line 45 of file pager.c.
References G_popen_clear(), G_popen_write(), G_whoami(), and NULL.
int G_open_new | ( | const char * | element, |
const char * | name | ||
) |
Open a new database file.
Creates name in the current mapset and opens it for write only.
The database file name under the element in the current mapset is created and opened for writing (but not reading). The UNIX open() routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the open() is returned.
element | database element name |
name | map file name |
Definition at line 148 of file gis/open.c.
int G_open_new_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name | ||
) |
open a new database misc file
The database file element under dir/name in the current mapset is created and opened for writing (but not reading). The UNIX open( ) routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the open( ) is returned.
element | |
name |
Definition at line 113 of file open_misc.c.
Referenced by Rast_write_fp_range(), and Rast_write_rstats().
int G_open_old | ( | const char * | element, |
const char * | name, | ||
const char * | mapset | ||
) |
Open a database file for reading.
The database file name under the element in the specified mapset is opened for reading (but not for writing). The UNIX open() routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file descriptor from the open() is returned.
element | database element name |
name | map file name |
mapset | mapset containing map name |
Definition at line 170 of file gis/open.c.
Referenced by Rast__open_old().
int G_open_old_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name, | ||
const char * | mapset | ||
) |
open a database misc file for reading
The database file element under dir/name in the specified mapset is opened for reading (but not for writing). The UNIX open( ) routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file descriptor from the open( ) is returned.
element | |
name | |
mapset |
Definition at line 134 of file open_misc.c.
Referenced by Rast3d_open_cell_old_no_header(), Rast3d_read_range(), and Rast_read_fp_range().
FILE* G_open_option_file | ( | const struct Option * | option | ) |
Get an input/output file pointer from the option. If the file name is omitted or '-', it returns either stdin or stdout based on the gisprompt.
Calls G_fatal_error() on error. File pointer can be later closed by G_close_option_file().
option | pointer to a file option |
Definition at line 1800 of file parser.c.
References _, Option::answer, G_fatal_error(), Option::gisprompt, Option::key, Option::multiple, and NULL.
FILE* G_open_pager | ( | struct Popen * | ) |
Definition at line 13 of file pager.c.
References G_popen_clear(), G_popen_write(), getenv(), and NULL.
int G_open_update | ( | const char * | element, |
const char * | name | ||
) |
Open a database file for update.
The database file name under the element in the current mapset is opened for reading and writing. The UNIX open() routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the open() is returned.
element | database element name |
name | map file name |
Definition at line 191 of file gis/open.c.
int G_open_update_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name | ||
) |
open a database misc file for update
The database file element under dir/name in the current mapset is opened for reading and writing. The UNIX open( ) routine is used to open the file. If the file does not exist, -1 is returned. Otherwise the file is positioned at the end of the file and the file descriptor from the open( ) is returned.
element | |
name |
Definition at line 155 of file open_misc.c.
void G_option_collective | ( | void * | first, |
... | |||
) |
Sets the options to be collective.
If any option is present, all the other options must also be present all or nothing from a set.
first | first given option |
Definition at line 347 of file parser_dependencies.c.
void G_option_excludes | ( | void * | first, |
... | |||
) |
Exclude selected options.
If the first option is present, none of the other options may also (should?) be present.
first | first given option |
Definition at line 320 of file parser_dependencies.c.
void G_option_exclusive | ( | void * | first, |
... | |||
) |
Sets the options to be mutually exclusive.
When running the module, at most one option from a set can be provided.
first | first given option |
Definition at line 202 of file parser_dependencies.c.
void G_option_required | ( | void * | first, |
... | |||
) |
Sets the options to be required.
At least one option from a set must be given.
first | first given option |
Definition at line 226 of file parser_dependencies.c.
void G_option_requires | ( | void * | first, |
... | |||
) |
Define a list of options from which at least one option is required if first option is present.
If the first option is present, at least one of the other options must also be present.
If you want all options to be provided use G_option_requires_all() function. If you want more than one option to be present but not all, call this function multiple times.
first | first given option |
Definition at line 257 of file parser_dependencies.c.
void G_option_requires_all | ( | void * | first, |
... | |||
) |
Define additionally required options for an option.
If the first option is present, all the other options must also be present.
If it is enough if only one option from a set is present, use G_option_requires() function.
first | first given option |
Definition at line 293 of file parser_dependencies.c.
void G_option_rule | ( | int | type, |
int | nopts, | ||
void ** | opts | ||
) |
Set generic option rule.
Supported rule types:
type | rule type |
nopts | number of options in the array |
opts | array of options |
Definition at line 76 of file parser_dependencies.c.
char* G_option_to_separator | ( | const struct Option * | option | ) |
Get separator string from the option.
Calls G_fatal_error() on error. Allocated string can be later freed by G_free().
option | pointer to separator option |
Definition at line 1738 of file parser.c.
References _, Option::answer, G_debug(), G_fatal_error(), G_store(), Option::gisprompt, Option::key, and NULL.
const char* G_original_program_name | ( | void | ) |
Return original path of the executed program.
This function returns the name of the program as set by the call to G_gisinit().
Unlike G_program_name() which returns name of the module this function return original path which was used to execute the program. For standard GRASS modules, it will be the same as the result from G_program_name() function.
Definition at line 46 of file progrm_nme.c.
int G_owner | ( | const char * | path | ) |
int G_parser | ( | int | argc, |
char ** | argv | ||
) |
Parse command line.
The command line parameters argv and the number of parameters argc from the main() routine are passed directly to G_parser(). G_parser() accepts the command line input entered by the user, and parses this input according to the input options and/or flags that were defined by the programmer.
Note: The only functions which can legitimately be called before G_parser() are:
The usual order a module calls functions is:
argc | number of arguments |
argv | argument list |
Definition at line 320 of file parser.c.
References _, err(), FALSE, G_basename(), G_is_dirsep(), G_store(), G_verbose_std(), G_warning(), Option::key, NULL, Option::required, and st.
void G_percent | ( | long | n, |
long | d, | ||
int | s | ||
) |
Print percent complete messages.
This routine prints a percentage complete message to stderr. The percentage complete is (n/d)*100, and these are printed only for each s percentage. This is perhaps best explained by example:
This example code will print completion messages at 10% increments; i.e., 0%, 10%, 20%, 30%, etc., up to 100%. Each message does not appear on a new line, but rather erases the previous message.
Note that to prevent the illusion of the module stalling, the G_percent() call is placed before the time consuming part of the for loop, and an additional call is generally needed after the loop to "finish it off" at 100%.
n | current element |
d | total number of elements |
s | increment size |
Definition at line 62 of file percent.c.
Referenced by NetA_betweenness_closeness().
void G_percent_reset | ( | void | ) |
Reset G_percent() to 0%; do not add newline.
Definition at line 119 of file percent.c.
Referenced by NetA_betweenness_closeness().
double G_planimetric_polygon_area | ( | const double * | x, |
const double * | y, | ||
int | n | ||
) |
Calculates planimetric polygon area.
x | array of x values |
y | array of y values |
n | number of x,y pairs |
Definition at line 25 of file area_poly2.c.
Referenced by G_area_of_polygon().
int G_plot_area | ( | double *const * | xs, |
double *const * | ys, | ||
int * | rpnts, | ||
int | rings | ||
) |
Plot multiple polygons.
Like G_plot_polygon(), except it takes a set of polygons, each with npts[i] vertices, where the number of polygons is specified with the rings argument. It is especially useful for plotting vector areas with interior islands.
xs | pointer to pointer for X's |
ys | pointer to pointer for Y's |
rpnts | array of ints w/ num points per ring |
rings | number of rings |
void G_plot_fx | ( | double(*)(double) | f, |
double | east1, | ||
double | east2 | ||
) |
Plot f(east1) to f(east2)
The function f(east) is plotted from east1 to east2. The function f(east) must return the map northing coordinate associated with east.
f | plotting function |
east1 | easting (first point) |
east2 | easting (second point) |
Definition at line 779 of file plot.c.
References G_plot_line().
void G_plot_line | ( | double | east1, |
double | north1, | ||
double | east2, | ||
double | north2 | ||
) |
Plot line between latlon coordinates (fastline)
A line from east1,north1 to east2,north2 is plotted in output x,y coordinates (e.g. pixels for graphics.) This routine handles global wrap-around for latitude-longitude databases.
east1,north1 | first point (start line node) |
east2,north2 | second point (end line node) |
Definition at line 207 of file plot.c.
Referenced by G_plot_fx().
void G_plot_line2 | ( | double | east1, |
double | north1, | ||
double | east2, | ||
double | north2 | ||
) |
Plot line between latlon coordinates (slowline)
A line from east1,north1 to east2,north2 is plotted in output x,y coordinates (e.g. pixels for graphics.) This routine handles global wrap-around for latitude-longitude databases.
east1,north1 | first point (start line node) |
east2,north2 | second point (end line node) |
void G_plot_point | ( | double | east, |
double | north | ||
) |
Plot point.
east | easting |
north | northing |
Definition at line 188 of file plot.c.
References G_plot_where_xy(), and x.
int G_plot_polygon | ( | const double * | x, |
const double * | y, | ||
int | n | ||
) |
Plot filled polygon with n vertices.
The polygon, described by the n vertices east,north, is plotted in the output x,y space as a filled polygon.
x | coordinates of vertices |
y | coordinates of vertices |
n | number of vertices |
void G_plot_where_en | ( | int | x, |
int | y, | ||
double * | east, | ||
double * | north | ||
) |
Converts x,y to east,north.
The pixel coordinates x,y are converted to map coordinates east,north.
x | x coordinate |
y | y coordinate |
east | easting |
north | northing |
Definition at line 176 of file plot.c.
References EAST, G_adjust_easting(), and NORTH.
void G_plot_where_xy | ( | double | east, |
double | north, | ||
int * | x, | ||
int * | y | ||
) |
Converts east,north to x,y.
The map coordinates east,north are converted to pixel coordinates x,y.
east | easting |
north | nothing |
x | x coordinate |
y | y coordinate |
Definition at line 158 of file plot.c.
Referenced by G_plot_point().
int G_point_in_region | ( | double | easting, |
double | northing | ||
) |
Returns TRUE if coordinate is within the current region settings.
easting | |
northing |
Definition at line 26 of file wind_in.c.
References G_get_window(), and G_point_in_window().
int G_point_in_window | ( | double | easting, |
double | northing, | ||
const struct Cell_head * | window | ||
) |
Returns TRUE if coordinate is within the given map region.
Use instead of G_point_in_region() when used in a loop (it's more efficient to only fetch the window once) or for checking if a point is in another region (e.g. contained with a raster map's bounds).
easting | |
northing | |
window |
Definition at line 51 of file wind_in.c.
Referenced by G_point_in_region().
int G_pole_in_polygon | ( | const double * | x, |
const double * | y, | ||
int | n | ||
) |
Check if pole is in polygon.
For latitude-longitude coordinates, this routine determines if the polygon defined by the n coordinate vertices x,y contains one of the poles.
Note: Use this routine only if the projection is PROJECTION_LL.
x | array of x coordinates |
y | array of y coordinates |
n | number of coordinates |
Definition at line 35 of file pole_in_poly.c.
void G_popen_clear | ( | struct Popen * | ) |
Definition at line 59 of file popen.c.
References Popen::fp, NULL, and Popen::pid.
Referenced by G_open_mail(), and G_open_pager().
void G_popen_close | ( | struct Popen * | ) |
Definition at line 75 of file popen.c.
References Popen::fp, G_wait(), and Popen::pid.
Referenced by G_close_mail(), and G_close_pager().
FILE* G_popen_read | ( | struct Popen * | , |
const char * | , | ||
const char ** | |||
) |
FILE* G_popen_write | ( | struct Popen * | , |
const char * | , | ||
const char ** | |||
) |
Definition at line 65 of file popen.c.
Referenced by G_open_mail(), and G_open_pager().
const char* G_program_name | ( | void | ) |
Return module name.
Routine returns the name of the module as set by the call to G_gisinit().
Definition at line 28 of file progrm_nme.c.
References name.
void G_progress | ( | long | n, |
int | s | ||
) |
Print progress info messages.
Use G_percent() when number of elements is defined.
This routine prints a progress info message to stderr. The value n is printed only for each s. This is perhaps best explained by example:
This example code will print progress in messages at 1000 increments; i.e., 1000, 2000, 3000, 4000, etc., up to number of features for given vector map. Each message does not appear on a new line, but rather erases the previous message.
n | current element |
s | increment size |
int G_projection | ( | void | ) |
Query cartographic projection.
This routine returns a code indicating the projection for the active region. The current values are (see gis.h)
Others may be added in the future.
Definition at line 32 of file proj1.c.
References G_get_set_window(), and Cell_head::proj.
Referenced by G_database_projection_name(), G_database_unit(), G_get_projepsg(), G_get_projinfo(), G_get_projunits(), G_shortest_way(), and Rast__check_for_auto_masking().
const char* G_projection_name | ( | int | n | ) |
Get projection name.
n | projection code |
Definition at line 55 of file proj2.c.
References _, NULL, PROJECTION_LL, PROJECTION_OTHER, PROJECTION_UTM, and PROJECTION_XY.
Referenced by G_database_projection_name(), Rast__open_old(), and Vect_get_proj_name().
int G_projection_units | ( | int | n | ) |
Get projection units code (for internal use only)
n | projection code |
Supported units (see gis.h):
Definition at line 32 of file proj2.c.
References PROJECTION_LL, PROJECTION_UTM, PROJECTION_XY, U_DEGREES, U_METERS, U_UNDEFINED, and U_UNKNOWN.
Referenced by G_database_unit().
int G_put_3dview | ( | const char * | fname, |
const char * | mapset, | ||
const struct G_3dview * | View, | ||
const struct Cell_head * | Win | ||
) |
Saves info to a 3d.view file.
The address of a window (struct Cell_head *) may be passed, or if NULL is passed, the Cell_head structure inside the G_3dview struct will be used. e.g., if you called G_get_3dview_defaults with the Cell_head you want saved, the G_3dview returned already contains the new Cell_head. But if you're using all the keywords, so didn't need defaults, pass this routine the address of a Cell_head.
User should call G_get_3dview_defaults before filling a G_3dview struct to be written if not using all of the optional keywords.
These keywords are constant in all 3d.view files:
PGM_ID
cell keywords:
north
south
east
west
rows
cols
required keywords:
TO_EASTING
TO_NORTHING
TO_HEIGHT
FROM_EASTING
FROM_NORTHING
FROM_HEIGHT
Z_EXAG
FIELD_VIEW
optional keywords: (defaults provided when reading)
TWIST
MESH_FREQ
POLY_RES
DOAVG
DISPLAY_TYPE
DOZERO
COLORGRID
SHADING
FRINGE
BG_COL
GRID_COL
OTHER_COL
LIGHTS_ON
LIGHTPOS
LIGHTCOL
LIGHTAMBIENT
SHINE
SURFACEONLY
[in] | fname | file name |
[in] | mapset | |
[in] | View | |
[in] | Win |
Definition at line 170 of file view.c.
References _, G_fopen_new(), G_warning(), and NULL.
Referenced by Gs_save_3dview().
int G_put_element_window | ( | const struct Cell_head * | window, |
const char * | dir, | ||
const char * | name | ||
) |
Write the region.
Writes the region file (WIND) in the user's current mapset from region.
Warning: Since this routine actually changes the region, it should only be called by modules which the user knows will change the region. It is probably fair to say that only the g.region
should call this routine.
[in,out] | window | pointer to Cell_head |
dir | directory name | |
name | file name |
Definition at line 74 of file put_window.c.
Referenced by G_make_mapset().
int G_put_window | ( | const struct Cell_head * | window | ) |
Writes the region (window)
Writes the region file (WIND) in the user's current mapset or when environmental variable WIND_OVERRIDE
is set, it writes the region to file specified by WIND_OVERRIDE
variable.
When WIND_OVERRIDE
is set the current process and child processes are affected. Otherwise the whole GRASS session is affected.
WIND_OVERRIDE
is not set, this routine actually changes the region. So in this case it should only be called by modules which the user knows will change the region. It is probably fair to say that only the g.region
should call this routine unless WIND_OVERRIDE
is set.This function does not adjust the window
before setting the region so you should call G_adjust_Cell_head() before calling this function.
[in,out] | window | pointer to Cell_head |
Definition at line 46 of file put_window.c.
void G_putenv | ( | const char * | name, |
const char * | value | ||
) |
double G_radius_of_conformal_tangent_sphere | ( | double | lon, |
double | a, | ||
double | e2 | ||
) |
int int G_rasprintf | ( | char ** | , |
size_t * | , | ||
const char * | , | ||
... | |||
) |
char* G_rc_path | ( | const char * | element, |
const char * | item | ||
) |
Returns path to element and item.
Either element or item can be NULL, but not both. If element is NULL, then the file is assumed to live at the top level. If file is NULL, then it is assumed the caller is not interested in the file. If the element or rc dir do not exist, they are created. However, the file is never checked for.
[in] | element | |
[in] | item |
Definition at line 292 of file user_config.c.
int G_read_compressed | ( | int | , |
int | , | ||
unsigned char * | , | ||
int | , | ||
int | |||
) |
Definition at line 247 of file compress.c.
References _, b, err(), G_calloc, G_COMPRESSED_NO, G_COMPRESSED_YES, G_expand(), G_free(), G_warning(), and NULL.
void G_read_datum_table | ( | void | ) |
Definition at line 146 of file gis/datum.c.
References file, and GPATH_MAX.
Referenced by G_datum_description(), G_datum_ellipsoid(), G_datum_name(), G_get_datum_by_name(), and G_init_all().
int G_read_ellipsoid_table | ( | int | fatal | ) |
Read ellipsoid table.
fatal | non-zero value for G_fatal_error(), otherwise G_warning() is used |
Definition at line 247 of file get_ellipse.c.
References file, and GPATH_MAX.
Referenced by G_ellipsoid_description(), G_ellipsoid_name(), and G_init_all().
struct Key_Value* G_read_key_value_file | ( | const char * | file | ) |
Read key/values pairs from file.
Allocated memory must be freed G_free_key_value(). Call G_fatal_error() when unable to read key/value items from the file.
[in] | file | filename for reading |
Definition at line 53 of file key_value3.c.
References _, G_fatal_error(), and G_fread_key_value().
Referenced by G_get_projepsg(), G_get_projinfo(), G_get_projunits(), and Rast__check_fp_type().
int G_read_raster3d_timestamp | ( | const char * | name, |
const char * | mapset, | ||
struct TimeStamp * | ts | ||
) |
Read timestamp from 3D raster map.
name | map name | |
mapset | mapset name | |
[out] | ts | TimeStamp struct to populate |
Definition at line 591 of file timestamp.c.
int G_read_raster_timestamp | ( | const char * | name, |
const char * | mapset, | ||
struct TimeStamp * | ts | ||
) |
Read timestamp from raster map.
name | map name | |
mapset | mapset the map lives in | |
[out] | ts | TimeStamp struct to populate |
Definition at line 372 of file timestamp.c.
int G_read_vector_timestamp | ( | const char * | name, |
const char * | layer, | ||
const char * | mapset, | ||
struct TimeStamp * | ts | ||
) |
Read timestamp from vector map.
name | map name | |
layer | The layer names, in case of NULL, layer one is assumed | |
mapset | mapset name | |
[out] | ts | TimeStamp struct to populate |
Definition at line 455 of file timestamp.c.
References _, G__read_timestamp(), G_debug(), G_fopen_old(), G_has_vector_timestamp(), G_mapset(), G_snprintf(), G_warning(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, and NULL.
char* G_recreate_command | ( | void | ) |
Creates command to run non-interactive.
Creates a command-line that runs the current command completely non-interactive.
Definition at line 822 of file parser.c.
References FALSE, and recreate_command().
Referenced by Rast_command_history(), and Vect_hist_command().
int G_recursive_copy | ( | const char * | src, |
const char * | dst | ||
) |
Copy recursively source directory to destination directory.
RULE:
This rule is designed according to general/manage/lib/copy.sh.
POSSIBLE CASES:
* if src is a file: * if dst does not exist: * copy src to dst RULE 1 * if dst is a file: * delete dst and copy src to dst RULE 2 * if dst is a directory: * try recursive_copy(src, dst/src) RULE 3 * if src is a directory: * if dst does not exist: * copy src to dst RULE 1 * if dst is a file: * delete dst and copy src to dst RULE 2 * if dst is a directory: * try RULE 4 * for i in `ls src` * do * recursive_copy(src/$i, dst/$i) * done *
src | source directory |
dst | destination directory |
Definition at line 70 of file copy_dir.c.
Referenced by M_do_copy(), and V1_close_nat().
int G_recursive_remove | ( | const char * | path | ) |
int G_remove | ( | const char * | element, |
const char * | name | ||
) |
Remove a database file.
The file or directory name under the database element directory in the current mapset is removed.
If name is a directory, everything within the directory is removed as well.
element | element name |
name | file name |
Definition at line 44 of file remove.c.
Referenced by G_remove_vector_timestamp(), M_do_copy(), M_do_remove(), M_do_rename(), Rast__quant_export(), Rast_remove_colors(), and Vect_remove_colors().
void G_remove_commas | ( | char * | buf | ) |
void G_remove_error_handler | ( | void(*)(void *) | func, |
void * | closure | ||
) |
Remove existing error handler.
func | handler to be remove |
closure | pointer to closure data |
Definition at line 84 of file gis/handler.c.
Referenced by db_unset_error_handler_driver().
int G_remove_misc | ( | const char * | dir, |
const char * | element, | ||
const char * | name | ||
) |
Remove a database misc file.
The file or directory name under the database element directory in the current mapset is removed.
If name is a directory, everything within the directory is removed as well.
element | element name |
name | file name |
Definition at line 65 of file remove.c.
Referenced by G_remove_raster3d_timestamp(), G_remove_raster_timestamp(), Rast3d_remove_color(), Rast__quant_export(), Rast__remove_fp_range(), Rast_remove_histogram(), Rast_write_fp_range(), Rast_write_range(), and Rast_write_rstats().
int G_remove_raster3d_timestamp | ( | const char * | name | ) |
Remove timestamp from 3D raster map.
Only timestamp files in current mapset can be removed.
name | map name |
Definition at line 624 of file timestamp.c.
References G_remove_misc(), and GRID3.
int G_remove_raster_timestamp | ( | const char * | name | ) |
Remove timestamp from raster map.
Only timestamp files in current mapset can be removed.
name | map name |
Definition at line 405 of file timestamp.c.
References G_remove_misc(), and RAST_MISC.
int G_remove_vector_timestamp | ( | const char * | name, |
const char * | layer | ||
) |
Remove timestamp from vector map.
Only timestamp files in current mapset can be removed.
name | map name |
layer | The layer names, in case of NULL, layer one is assumed |
Definition at line 550 of file timestamp.c.
References G_remove(), G_snprintf(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, and GV_TIMESTAMP_ELEMENT.
int G_rename | ( | const char * | element, |
const char * | oldname, | ||
const char * | newname | ||
) |
Rename a database file.
The file or directory oldname under the database element directory in the current mapset is renamed to newname.
element | element name |
oldname | current name |
newname | new name |
Definition at line 70 of file rename.c.
References G_file_name(), G_mapset(), G_name_is_fully_qualified(), G_rename_file(), GMAPSET_MAX, GNAME_MAX, and GPATH_MAX.
Referenced by M_do_rename().
int G_rename_file | ( | const char * | oldname, |
const char * | newname | ||
) |
Rename a file or a directory in the filesystem.
The file or directory oldname is renamed to newname.
oldname | current name |
newname | new name |
Definition at line 32 of file rename.c.
References G_copy_file().
Referenced by G_rename(), and PS_Graph_close().
void G_reset_mapsets | ( | void | ) |
Reset number of mapsets.
Definition at line 132 of file mapset_nme.c.
double G_rhumbline_lat_from_lon | ( | double | lon | ) |
Calculates rhumbline latitude.
Note: Function only works if lon1 < lon < lon2.
[in] | lon | longitude |
Definition at line 100 of file rhumbline.c.
int G_rle_compress | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
int G_rle_expand | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
void G_rotate_around_point | ( | double | X0, |
double | Y0, | ||
double * | X1, | ||
double * | Y1, | ||
double | angle | ||
) |
Rotate point (double version)
Given a point, angle, and origin, rotate the point around the origin by the given angle. Coordinates and results are double prec floating point.
X0 | X component of origin (center of circle) | |
Y0 | Y component of origin (center of circle) | |
[out] | X1 | X component of point to be rotated (variable is modified!) |
[out] | Y1 | Y component of point to be rotated (variable is modified!) |
angle | in degrees, measured CCW from east |
Definition at line 35 of file rotate.c.
Referenced by G_rotate_around_point_int().
void G_rotate_around_point_int | ( | int | X0, |
int | Y0, | ||
int * | X1, | ||
int * | Y1, | ||
double | angle | ||
) |
Rotate point (int version)
Given a point, angle, and origin, rotate the point around the origin by the given angle. Coordinates are given in integer and results are rounded back to integer.
X0 | X component of origin (center of circle) | |
Y0 | Y component of origin (center of circle) | |
[out] | X1 | X component of point to be rotated (variable is modified!) |
[out] | Y1 | Y component of point to be rotated (variable is modified!) |
angle | in degrees, measured CCW from east |
Definition at line 62 of file rotate.c.
References G_rotate_around_point(), and x.
int G_saprintf | ( | char * | str, |
const char * | format, | ||
... | |||
) |
sprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | str | string buffer |
[in] | format | string format |
[in] | ... | arguments for the format string |
int G_scan_easting | ( | const char * | buf, |
double * | easting, | ||
int | projection | ||
) |
ASCII easting to double.
Converts the ASCII "easting" coordinate string in buf to its double representation (into easting).
Supported projection codes (see gis.h):
buf | buffer containing string easting | |
[out] | easting | easting |
projection | projection code |
Definition at line 69 of file wind_scan.c.
References PROJECTION_LL.
int G_scan_northing | ( | const char * | buf, |
double * | northing, | ||
int | projection | ||
) |
ASCII northing to double.
Converts the ASCII "northing" coordinate string in buf to its double representation (into northing).
Supported projection codes (see gis.h):
buf | buffer hold string northing | |
[out] | northing | northing |
projection | projection code |
Definition at line 38 of file wind_scan.c.
References PROJECTION_LL.
int G_scan_resolution | ( | const char * | buf, |
double * | res, | ||
int | projection | ||
) |
ASCII resolution to double.
Converts the ASCII "resolution" string in buf to its double representation (into resolution).
Supported projection codes (see gis.h):
buf | buffer containing string resolution | |
[out] | resolution | resolution value |
projection | projection code |
Definition at line 100 of file wind_scan.c.
References G_llres_scan(), and PROJECTION_LL.
int G_scan_timestamp | ( | struct TimeStamp * | ts, |
const char * | buf | ||
) |
Fill a TimeStamp structure from a datetime string.
Populate a TimeStamp structure (defined in gis.h) from a text string. Checks to make sure text string is in valid GRASS datetime format.
ts | TimeStamp structure to be populated |
buf | string containing formatted time info |
Definition at line 215 of file timestamp.c.
void G_set_distance_to_line_tolerance | ( | double | ) |
Definition at line 8 of file gis/line_dist.c.
References TOLERANCE.
void G_set_error_routine | ( | int(*)(const char *, int) | error_routine | ) |
Establishes error_routine as the routine that will handle the printing of subsequent error messages.
error_routine | routine will be called like this: error_routine(msg, fatal) |
Definition at line 261 of file gis/error.c.
void G_set_geodesic_distance_lat1 | ( | double | lat1 | ) |
Sets geodesic distance lat1.
Set the first latitude.
Note: Must be called first.
lat1 | first latitude |
Definition at line 69 of file geodist.c.
References Radians.
Referenced by G_geodesic_distance().
void G_set_geodesic_distance_lat2 | ( | double | lat2 | ) |
Sets geodesic distance lat2.
Set the second latitude.
Note: Must be called second.
lat2 | second latitidue |
Definition at line 83 of file geodist.c.
References Radians.
Referenced by G_geodesic_distance().
void G_set_gisrc_mode | ( | int | mode | ) |
void G_set_key_value | ( | const char * | key, |
const char * | value, | ||
struct Key_Value * | kv | ||
) |
Set value for given key.
key | key to be set up | |
value | value for given key | |
[in,out] | kv | Key_value structure to be modified |
Definition at line 38 of file key_value1.c.
Referenced by G_get_projinfo(), and GPJ_osr_to_grass().
void G_set_keywords | ( | const char * | keywords | ) |
Set keywords from the string.
keywords | keywords separated by commas |
Definition at line 866 of file parser.c.
References G_number_of_tokens(), G_tokenize(), and st.
void G_set_ls_exclude_filter | ( | int(*)(const char *, void *) | , |
void * | |||
) |
Referenced by G_ls_regex_filter().
void G_set_ls_filter | ( | int(*)(const char *, void *) | , |
void * | |||
) |
void G_set_percent_routine | ( | int(*)(int) | percent_routine | ) |
void G_set_program_name | ( | const char * | s | ) |
Set program name.
Program name set to name (name will be returned by G_program_name*())
Extension like .exe or .py is stripped from program name.
s | program name |
Definition at line 61 of file progrm_nme.c.
void G_set_timestamp_range | ( | struct TimeStamp * | , |
const struct DateTime * | , | ||
const struct DateTime * | |||
) |
int G_set_verbose | ( | int | level | ) |
Set verbosity level.
–q
or –quiet
flag.–v
or –verbose
flag.level | new verbosity level (-1,0,1,2,3) |
Definition at line 116 of file verbose.c.
References G_initialize_done(), G_is_initialized(), MAXLEVEL, and MINLEVEL.
void G_set_window | ( | struct Cell_head * | window | ) |
Establishes window
as the current working window (region).
This function adjusts the window
before setting the region so you don't have to call G_adjust_Cell_head().
window | window to become operative window |
Definition at line 53 of file gis/set_window.c.
void G_setenv | ( | const char * | name, |
const char * | value | ||
) |
Set environment variable (updates .gisrc)
If value is NULL, becomes an G_unsetenv().
name | variable name |
value | variable value |
void G_setenv2 | ( | const char * | name, |
const char * | value, | ||
int | loc | ||
) |
Set environment variable from specific place (updates .gisrc)
If value is NULL, becomes an G_unsetenv().
name | variable name |
value | variable value |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 452 of file env.c.
Referenced by db_set_connection(), and tgis_set_connection().
void G_setenv_nogisrc | ( | const char * | name, |
const char * | value | ||
) |
Set environment name to value (doesn't update .gisrc)
name | variable name |
value | variable value |
Definition at line 465 of file env.c.
Referenced by G_check_overwrite(), and G_make_mapset().
void G_setenv_nogisrc2 | ( | const char * | name, |
const char * | value, | ||
int | loc | ||
) |
void G_setup_fill | ( | int | gap | ) |
Set row_fill routine to row_solid_fill or row_dotted_fill.
After calling this function, G_plot_polygon() and G_plot_area() fill shapes with solid or dotted lines. If gap is greater than zero, this value will be used for row_dotted_fill. Otherwise, row_solid_fill is used.
gap |
void G_setup_plot | ( | double | t, |
double | b, | ||
double | l, | ||
double | r, | ||
int(*)(int, int) | Move, | ||
int(*)(int, int) | Cont | ||
) |
Initialize plotting routines.
Initializes the plotting capability. This routine must be called once before calling the G_plot_*() routines described below. The parameters t, b, l, r are the top, bottom, left, and right of the output x,y coordinate space. They are not integers, but doubles to allow for subpixel registration of the input and output coordinate spaces. The input coordinate space is assumed to be the current GRASS region, and the routines supports both planimetric and latitude-longitude coordinate systems.
Move and Cont are subroutines that will draw lines in x,y space. They will be called as follows:
t,b,l,r | top, bottom, left, right |
move | Move function |
Cont | Cont function |
Definition at line 94 of file plot.c.
References b, G_get_set_window(), l, r, and t.
void G_shortest_way | ( | double * | east1, |
double * | east2 | ||
) |
Shortest way between two eastings.
For lat-lon projection (PROJECTION_LL
), east1, east2 are changed so that they are no more than 180 degrees apart. Their true locations are not changed. For all other projections, this function does nothing.
[in,out] | east1 | east (x) coordinate of first point |
[in,out] | east2 | east (x) coordinate of second point |
Definition at line 28 of file short_way.c.
References G_projection(), and PROJECTION_LL.
void G_sleep | ( | unsigned | int | ) |
Definition at line 11 of file sleep.c.
Referenced by dig_falloc(), dig_frealloc(), and main().
int G_sleep_on_error | ( | int | flag | ) |
Turn on/off no_sleep flag.
If flag is 0, then no pause will occur after printing an error or warning message. Otherwise the pause will occur.
flag | if non-zero/zero value is given G_sleep() will be activated/deactivated |
Definition at line 243 of file gis/error.c.
int G_snaprintf | ( | char * | str, |
size_t | size, | ||
const char * | format, | ||
... | |||
) |
snprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | str | string buffer |
[in] | size | string buffer size |
[in] | format | string format |
[in] | ... | arguments for the format string |
int G_snprintf | ( | char * | , |
size_t | , | ||
const char * | , | ||
... | |||
) |
void G_squeeze | ( | char * | line | ) |
Remove superfluous white space.
Leading and trailing white space is removed from the string line and internal white space which is more than one character is reduced to a single space character. White space here means spaces, tabs, linefeeds, newlines, and formfeeds.
[in,out] | line |
void G_srand48 | ( | long | seedval | ) |
Seed the pseudo-random number generator.
seedval | 32-bit integer used to seed the PRNG |
Definition at line 53 of file lrand48.c.
References x.
Referenced by G_math_srand(), and G_srand48_auto().
long G_srand48_auto | ( | void | ) |
Seed the pseudo-random number generator from the time and PID.
A weak hash of the current time and PID is generated and used to seed the PRNG
Definition at line 71 of file lrand48.c.
References _, G_fatal_error(), G_srand48(), getenv(), NULL, and t.
Referenced by G_math_srand_auto().
int G_stat | ( | const char * | file_name, |
struct stat * | buf | ||
) |
Get file status.
Returns information about the specified file.
file_name | file name |
stat | pointer to structure filled with file information |
Definition at line 128 of file paths.c.
Referenced by G_get_available_mapsets(), G_mapset_permissions(), G_mapset_permissions2(), and G_owner().
char* G_store | ( | const char * | s | ) |
Copy string to allocated memory.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
s | string |
Definition at line 87 of file strings.c.
Referenced by cairo_read_ppm(), cairo_write_ppm(), db_get_default_database_name(), db_get_default_driver_name(), db_get_default_group_name(), db_get_default_schema_name(), db_whoami(), dig_read_frmt_ascii(), G__read_Cell_head(), G_add_keyword(), G_config_path(), G_define_standard_option(), G_fully_qualified_name(), G_get_available_mapsets(), G_ls2(), G_myname(), G_option_to_separator(), G_parser(), G_putenv(), GPJ__get_datum_params(), GPJ_get_datum_by_name(), GPJ_get_default_datum_params_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_init_transform(), GPJ_osr_to_grass(), I_iclass_init_statistics(), I_SetClassTitle(), I_SetSigTitle(), M__add_element(), Rast3d_get_window_params(), Rast3d_open_cell_old_no_header(), Rast3d_set_unit(), Rast__open_null_write(), Rast__read_history(), Rast_append_history(), Rast_get_cell_title(), Rast_get_semantic_label_or_name(), Rast_get_vrt(), Rast_mask_info(), Rast_set_cats_title(), Rast_set_d_cat(), Rast_set_history(), read_pgm(), tgis_get_database_name(), tgis_get_default_database_name(), tgis_get_driver_name(), Vect_close(), Vect_get_dblink(), Vect_get_finfo_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_finfo_topology_info(), Vect_get_proj_name(), Vect_maptype_info(), Vect_set_comment(), Vect_set_date(), Vect_set_map_date(), Vect_set_map_name(), Vect_set_organization(), Vect_set_person(), and write_pgm().
char* G_store_lower | ( | const char * | s | ) |
Copy string to allocated memory and convert copied string to lower case.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
s | string |
char* G_store_upper | ( | const char * | s | ) |
Copy string to allocated memory and convert copied string to upper case.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
s | string |
Definition at line 117 of file strings.c.
Referenced by GPJ_init_transform().
char* G_str_concat | ( | const char ** | src_strings, |
int | num_strings, | ||
const char * | sep, | ||
int | maxsize | ||
) |
String concatenation.
Concatenates the strings in src_strings, which consists of num_strings number of strings, with the separator sep. The size of the concatenated string is limited by maxsize.
src_strings | array of strings to concatenate |
num_strings | count of strings in src_strings |
sep | separator string |
maxsize | maximum number of characters of returned string |
char* G_str_replace | ( | const char * | buffer, |
const char * | old_str, | ||
const char * | new_str | ||
) |
Replace all occurrences of old_str in buffer with new_str.
Code example:
buffer | input string buffer |
old_str | string to be replaced |
new_str | new string |
Definition at line 189 of file strings.c.
Referenced by Vect_get_finfo_geometry_type().
void G_str_to_lower | ( | char * | str | ) |
Convert string to lower case.
[in,out] | str | pointer to string |
Definition at line 378 of file strings.c.
Referenced by Vect_get_finfo_geometry_type().
int G_str_to_sql | ( | char * | str | ) |
void G_str_to_upper | ( | char * | str | ) |
int int G_strcasecmp | ( | const char * | x, |
const char * | y | ||
) |
String compare ignoring case (upper or lower)
Returning a value that has the same sign as the difference between the first differing pair of characters.
Note: strcasecmp() is affected by the locale (LC_CTYPE), while G_strcasecmp() isn't.
x | first string to compare |
y | second string to compare |
Definition at line 47 of file strings.c.
Referenced by AS_option_to_algorithm(), Cairo_Graph_set(), check_mapset_in_layer_name(), clean_dir(), dig_read_frmt_ascii(), G_compressor_number(), G_str_to_color(), GPJ_get_datum_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_osr_to_grass(), M_do_copy(), M_do_remove(), M_do_rename(), M_get_element(), PNG_Graph_set(), PS_Graph_set(), Rast_close_gdal_write_link(), read_image(), V1_close_nat(), Vect_close(), Vect_set_db_updated(), and write_image().
char* G_strcasestr | ( | const char * | str, |
const char * | substr | ||
) |
Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lower)
str | string where to find sub-string |
substr | sub-string |
Definition at line 472 of file strings.c.
References G_strncasecmp(), and NULL.
char* G_strchg | ( | char * | bug, |
char | character, | ||
char | new | ||
) |
void G_strip | ( | char * | buf | ) |
Removes all leading and trailing white space from string.
[in,out] | buf | buffer to be worked on |
Definition at line 300 of file strings.c.
Referenced by Rast_get_cell_title(), Rast_set_cats_title(), and Rast_set_d_cat().
int G_strncasecmp | ( | const char * | x, |
const char * | y, | ||
int | n | ||
) |
String compare ignoring case (upper or lower) - limited number of characters.
Returning a value that has the same sign as the difference between the first differing pair of characters.
Note: strcasecmp() is affected by the locale (LC_CTYPE), while G_strcasecmp() isn't.
x | first string to compare |
y | second string to compare |
n | number or characters to compare |
Definition at line 69 of file strings.c.
Referenced by check_create_export_opts(), check_create_import_opts(), and G_strcasestr().
void int G_suppress_warnings | ( | int | flag | ) |
Suppress printing a warning message to stderr.
flag | a warning message will be suppressed if non-zero value is given |
Definition at line 223 of file gis/error.c.
Referenced by I_get_group(), I_get_group_title(), I_get_subgroup(), and I_get_target().
void G_switch_env | ( | void | ) |
void G_switch_search_path | ( | void | ) |
void G_temp_element | ( | char * | element | ) |
Populates element with a path string.
[out] | element | element name |
Definition at line 102 of file tempfile.c.
References FALSE, and G__temp_element().
Referenced by G_tempfile_pid(), and main().
char* G_tempfile | ( | void | ) |
Returns a temporary file name.
This routine returns a pointer to a string containing a unique temporary file name that can be used as a temporary file within the module. Successive calls to G_tempfile() will generate new names. Only the file name is generated. The file itself is not created. To create the file, the module must use standard UNIX functions which create and open files, e.g., creat() or fopen().
Successive calls will generate different names the names are of the form pid.n where pid is the programs process id number and n is a unique identifier.
Note: It is recommended to unlink() (remove) the temp file on exit/error. Only if GRASS is left with 'exit', the GIS mapset management will clean up the temp directory (ETC/clean_temp).
Definition at line 62 of file tempfile.c.
References G_tempfile_pid().
char* G_tempfile_pid | ( | int | pid | ) |
Create tempfile from process id.
See G_tempfile().
pid |
Definition at line 75 of file tempfile.c.
References G_counter_next(), G_init_tempfile(), G_temp_element(), GNAME_MAX, GPATH_MAX, and name.
Referenced by G_tempfile().
char** G_tokenize | ( | const char * | buf, |
const char * | delim | ||
) |
Tokenize string.
Given a string, buf, turn delimiter, delim, into '\0' (NULL) and place pointers to tokens in tokens. buf must not contain a new line (
). delim may consist of more than one character. G_free_tokens() must be called when finished with tokens to release memory.
Example:
buf | input string |
delim | string delimiter |
Definition at line 48 of file gis/token.c.
Referenced by check_create_export_opts(), check_create_import_opts(), check_mapset_in_layer_name(), G_set_keywords(), GPJ_grass_to_osr2(), and Vect__open_cursor_next_line_pg().
char** G_tokenize2 | ( | const char * | buf, |
const char * | delim, | ||
const char * | valchar | ||
) |
Tokenize string.
This function behaves similarly to G_tokenize().
It introduces valchar which defines borders of token. Within token delim is ignored.
Example:
In this example ntok1 will be 4, ntok2 only 3, i.e. { "a", "'b, c'", "d"}
buf | input string |
delim | string delimiter |
valchar | character defining border of token |
Definition at line 84 of file gis/token.c.
char* G_tolcase | ( | char * | string | ) |
char* G_toucase | ( | char * | string | ) |
double G_transverse_radius_of_curvature | ( | double | lon, |
double | a, | ||
double | e2 | ||
) |
void G_trim_decimal | ( | char * | buf | ) |
Removes trailing zeros from decimal number.
Example: 23.45000 would come back as 23.45
[in,out] | buf |
Definition at line 24 of file trim_dec.c.
Referenced by db_convert_value_to_string(), and Rast3d_write_cats().
int G_units | ( | const char * | units_name | ) |
Get units code by name.
Units codes (gis.h):
units_name | units name (singular or plural form) |
Definition at line 319 of file units.c.
References G_database_unit_name(), NULL, U_ACRES, U_DAYS, U_DEGREES, U_FEET, U_HECTARES, U_HOURS, U_KILOMETERS, U_METERS, U_MILES, U_MINUTES, U_MONTHS, U_SECONDS, U_UNKNOWN, U_USFEET, and U_YEARS.
Referenced by G_get_units_name(), and Rast3d_set_vertical_unit().
int G_unqualified_name | ( | const char * | name, |
const char * | mapset, | ||
char * | xname, | ||
char * | xmapset | ||
) |
Returns unqualified map name (without @ mapset)
Returns an unqualified name for the file name in mapset.
Note:
name | map name | |
mapset | mapset to check or NULL | |
[out] | xname | map name |
[out] | xmapset | mapset name |
Definition at line 134 of file nme_in_mps.c.
References G_name_is_fully_qualified().
Referenced by I_fopen_signature_file_old(), I_fopen_sigset_file_old(), Rast3d_open_cell_old_no_header(), Rast__open_null_write(), and Rast__open_old().
void G_unset_error_routine | ( | void | ) |
After this call subsequent error messages will be handled in the default method.
Error messages are printed directly to the screen: ERROR: message or WARNING: message
Definition at line 274 of file gis/error.c.
void G_unset_percent_routine | ( | void | ) |
void G_unset_window | ( | ) |
void G_unsetenv | ( | const char * | name | ) |
void G_unsetenv2 | ( | const char * | name, |
int | loc | ||
) |
Remove name from environment from specific place.
Updates .gisrc
name | variable name |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 506 of file env.c.
Referenced by db_set_connection().
void G_update_key_value_file | ( | const char * | file, |
const char * | key, | ||
const char * | value | ||
) |
Update file, set up value for given key.
[in] | file | filename to be updated |
[in] | key | key value |
[in] | value | value to be updated |
Definition at line 26 of file key_value4.c.
void G_usage | ( | void | ) |
Command line help/usage message.
Calls to G_usage() allow the programmer to print the usage message at any time. This will explain the allowed and required command line input to the user. This description is given according to the programmer's definitions for options and flags. This function becomes useful when the user enters options and/or flags on the command line that are syntactically valid to the parser, but functionally invalid for the command (e.g. an invalid file name.)
For example, the parser logic doesn't directly support grouping options. If two options be specified together or not at all, the parser must be told that these options are not required and the programmer must check that if one is specified the other must be as well. If this additional check fails, then G_parser() will succeed, but the programmer can then call G_usage() to print the standard usage message and print additional information about how the two options work together.
Definition at line 48 of file parser_help.c.
int G_vaprintf | ( | const char * | format, |
va_list | ap | ||
) |
vprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | format | string format |
[in] | ap | variable argument list for the format string |
int G_vasprintf | ( | char ** | out, |
const char * | fmt, | ||
va_list | ap | ||
) |
Safe replacement for asprintf().
Allocate a string large enough to hold the new output, including the terminating NULL, and return the number of characters printed. The pointer out is set to the output string and should be passed to G_free() to release the allocated storage when it is no longer needed.
[out] | out | |
[in] | fmt | |
ap |
Definition at line 42 of file asprintf.c.
References count, G_malloc, and G_realloc.
Referenced by G_asprintf(), Rast_append_format_history(), and Rast_format_history().
int G_verbose | ( | void | ) |
Get current verbosity level.
Currently, there are 5 levels of verbosity (see return codes)
–q
or –quiet
flag.. –v
or –verbose
flag. Definition at line 55 of file verbose.c.
References G_initialize_done(), G_is_initialized(), getenv(), and STDLEVEL.
Referenced by G_fatal_error(), G_important_message(), G_init_all(), G_message(), and G_verbose_message().
int G_verbose_max | ( | void | ) |
void void G_verbose_message | ( | const char * | , |
... | |||
) |
Referenced by M_do_copy(), M_do_remove(), M_do_rename(), PNG_Graph_set(), Vect_cats_set_constraint(), and Vect_save_frmt().
int G_verbose_min | ( | void | ) |
Get min verbosity level.
Definition at line 96 of file verbose.c.
References MINLEVEL.
Referenced by G_important_message().
int G_verbose_std | ( | void | ) |
Get standard verbosity level.
Definition at line 86 of file verbose.c.
References STDLEVEL.
Referenced by G_message(), G_parser(), and G_verbose_message().
int G_vfaprintf | ( | FILE * | stream, |
const char * | format, | ||
va_list | ap | ||
) |
vfprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | stream | file pointer |
[in] | format | string format |
[in] | ap | variable argument list for the format string |
int G_vsaprintf | ( | char * | str, |
const char * | format, | ||
va_list | ap | ||
) |
vsprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | str | string buffer |
[in] | format | string format |
[in] | ap | variable argument list for the format string |
int G_vsnaprintf | ( | char * | str, |
size_t | size, | ||
const char * | format, | ||
va_list | ap | ||
) |
vsnprintf() version of G_aprintf(). See G_aprintf() for more details.
[in] | str | string buffer |
[in] | size | string buffer size |
[in] | format | string format |
[in] | ap | variable argument list for the format string |
void G_warning | ( | const char * | , |
... | |||
) |
Referenced by clean_dir(), close_g3d_file(), db_delete_table(), db_get_table_number_of_rows(), db_start_driver_open_database(), dig__read_head(), dig_out_of_memory(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), dig_read_frmt_ascii(), dig_write_plus_file(), fopen_group_file_old(), fopen_subgroup_file_old(), G__matrix_add(), G_copy_file(), G_get_projinfo(), G_get_projunits(), G_matrix_init(), G_matrix_inverse(), G_matrix_LU_solve(), G_matrix_product(), G_matrix_read(), G_matrix_scalar_mul(), G_matrix_set_element(), G_matvect_extract_vector(), G_matvect_get_column(), G_matvect_get_row(), G_parser(), G_put_3dview(), G_read_compressed(), G_read_vector_timestamp(), G_vector_copy(), G_vector_init(), G_vector_norm1(), G_vector_product(), G_vector_sub(), G_write_vector_timestamp(), gk_make_linear_framesfromkeys(), GP_str_to_marker(), GPJ_init_transform(), GPJ_osr_to_grass(), gs_err(), Gs_load_3dview(), gs_malloc_lookup(), GS_write_ppm(), GS_write_tif(), GS_write_zoom(), gsd_put_legend(), gsd_rot(), I_cluster_exec(), I_create_cat_rast(), I_fopen_group_file_append(), I_fopen_group_file_new(), I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), I_get_control_points(), I_get_target(), I_iclass_analysis(), I_iclass_init_group(), I_iclass_statistics_get_histo(), I_iclass_statistics_get_max(), I_iclass_statistics_get_mean(), I_iclass_statistics_get_min(), I_iclass_statistics_get_product(), I_iclass_statistics_get_range_max(), I_iclass_statistics_get_range_min(), I_iclass_statistics_get_stddev(), I_iclass_statistics_get_sum(), I_put_control_points(), I_ReadSigSet(), M_do_copy(), M_do_remove(), M_do_rename(), main(), NetA_distance_to_points(), NetA_initialise_varray(), NetA_strongly_connected_components(), NetA_timetable_shortest_path(), NetA_weakly_connected_components(), Nviz_color_from_str(), Nviz_make_current_render_window(), Nviz_set_focus_state(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), P_popmatrix(), P_pushmatrix(), parse_fontcap(), Rast3d_read_range(), Rast3d_rewrite_header(), Rast3d_write_colors(), Rast__check_for_auto_masking(), Rast__check_fp_type(), Rast__error_handler(), Rast__quant_import(), Rast_close_gdal_write_link(), Rast_is_null_value(), Rast_read_fp_range(), Rast_read_histogram(), Rast_read_history(), Rast_read_range(), Rast_set_null_value(), Rast_write_quant(), rbtree_create(), Rowio_setup(), seg_pageout(), seg_setup(), Segment_init(), Segment_put(), SimpleErrorMessage(), V1_close_pg(), V1_delete_line_ogr(), V1_delete_line_pg(), V1_open_new_ogr(), V1_open_new_pg(), V1_open_old_nat(), V1_open_old_ogr(), V1_open_old_pg(), V2__update_area_pg(), V2__write_area_sfa(), V2_close_ogr(), V2_close_pg(), V2_open_old_ogr(), V2_open_old_pg(), Vect__close_cursor_pg(), Vect__execute_get_value_pg(), Vect__execute_pg(), Vect__load_map_lines_pg(), Vect__load_map_nodes_pg(), Vect__load_plus_head(), Vect__open_cursor_next_line_pg(), Vect__read_head(), Vect__write_head(), Vect_area_alive(), Vect_build_line_area(), Vect_build_ogr(), Vect_build_pg(), Vect_build_sidx_from_topo(), Vect_cats_in_constraint(), Vect_cats_set_constraint(), Vect_cidx_open(), Vect_close(), Vect_coor_info(), Vect_copy(), Vect_copy_map_dblinks(), Vect_fidx_dump(), Vect_get_area_box(), Vect_get_area_points(), Vect_get_area_points_geos(), Vect_get_dblink(), Vect_get_finfo_dsn_name(), Vect_get_finfo_format_info(), Vect_get_finfo_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_finfo_topology_info(), Vect_get_isle_box(), Vect_get_isle_points(), Vect_get_next_line_id(), Vect_get_node_coor(), Vect_isle_alive(), Vect_level(), Vect_map_del_dblink(), Vect_node_alive(), Vect_open_fidx(), Vect_open_topo(), Vect_read_ascii_head(), Vect_read_next_line(), Vect_save_fidx(), Vect_save_frmt(), Vect_save_sidx(), Vect_save_topo(), Vect_set_constraint_field(), Vect_sfa_get_num_features(), Vect_write_dblinks(), vector2perimeters(), and Vedit_delete_area_centroid().
const char* G_whoami | ( | void | ) |
Gets user's name.
Returns a pointer to a string containing the user's login name.
Tries getlogin() first, then goes to the password file. However, some masscomp getlogin() fails in ucb universe because the ttyname(0) rotuine fails in ucb universe. So we check for this, too.
Definition at line 35 of file gis/whoami.c.
Referenced by G_init_all(), G_open_mail(), Vect__init_head(), and Vect_hist_command().
int G_window_overlap | ( | const struct Cell_head * | window, |
double | N, | ||
double | S, | ||
double | E, | ||
double | W | ||
) |
Determines if a box overlays a map window.
Given a map window, and a box of N,S,E,W does the box overlap the map window?
Note: knows about global wrap-around for lat-long.
[in] | window | pointer to window structure |
[in] | N | north |
[in] | S | south |
[in] | E | east |
[in] | W | west |
Definition at line 37 of file wind_overlap.c.
double G_window_percentage_overlap | ( | const struct Cell_head * | window, |
double | N, | ||
double | S, | ||
double | E, | ||
double | W | ||
) |
Determines percentage of box is contained in the window.
This version returns the percentage (from 0 to 1) of the box contained in the window. This feature can be used during vector plotting to decide if it is more efficient to do a level-one read of the whole vector map, or to pay the price of a level-two startup so only those arcs that enter the window are actually read.
[in] | window | pointer to widnow structure |
[in] | N | north |
[in] | S | south |
[in] | E | east |
[in] | W | west |
Definition at line 83 of file wind_overlap.c.
int G_write_compressed | ( | int | , |
unsigned char * | , | ||
int | , | ||
int | |||
) |
Definition at line 326 of file compress.c.
void G_write_key_value_file | ( | const char * | file, |
const struct Key_Value * | kv | ||
) |
Write key/value pairs to file.
file | filename for writing |
kv | pointer Key_Value structure |
Definition at line 28 of file key_value3.c.
References _, G_fatal_error(), and G_fwrite_key_value().
int G_write_projsrid | ( | const char * | location_name, |
const char * | sridstring | ||
) |
Write srid (spatial reference id) to file.
A srid consists of an authority name and code and must be known to PROJ.
location_name | name of the location to write the srid |
sridstring | pointer to srid string |
Definition at line 560 of file make_loc.c.
References _, err(), G_fatal_error(), G_file_name(), G_gisdbase(), GPATH_MAX, and SRID_FILE.
int G_write_projwkt | ( | const char * | location_name, |
const char * | wktstring | ||
) |
Write WKT definition to file.
Any WKT string and version recognized by PROJ is supported.
location_name | name of the location to write the WKT definition |
wktstring | pointer to WKT string |
Definition at line 510 of file make_loc.c.
References _, err(), G_fatal_error(), G_file_name(), G_gisdbase(), GPATH_MAX, and WKT_FILE.
int G_write_raster3d_timestamp | ( | const char * | name, |
const struct TimeStamp * | ts | ||
) |
Write timestamp of 3D raster map.
name | map name | |
[out] | ts | TimeStamp struct to populate |
Definition at line 608 of file timestamp.c.
int G_write_raster_timestamp | ( | const char * | name, |
const struct TimeStamp * | ts | ||
) |
Write timestamp of raster map.
name | map name | |
[out] | ts | TimeStamp struct to populate |
Definition at line 389 of file timestamp.c.
int G_write_timestamp | ( | FILE * | fd, |
const struct TimeStamp * | ts | ||
) |
Output TimeStamp structure to a file as a formatted string.
A handy fd might be "stdout".
[in,out] | fd | file descriptor |
ts | pointer to TimeStamp structure |
Definition at line 158 of file timestamp.c.
Referenced by G_write_vector_timestamp().
int G_write_unompressed | ( | int | , |
unsigned char * | , | ||
int | |||
) |
int G_write_vector_timestamp | ( | const char * | name, |
const char * | layer, | ||
const struct TimeStamp * | ts | ||
) |
Write timestamp of vector map.
name | map name | |
layer | The layer names, in case of NULL, layer one is assumed | |
[out] | ts | TimeStamp struct to populate |
Definition at line 505 of file timestamp.c.
References _, G_debug(), G_fopen_new(), G_mapset(), G_snprintf(), G_warning(), G_write_timestamp(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, and NULL.
void G_write_zeros | ( | int | fd, |
size_t | n | ||
) |
Writes n bytes of 9 to file descriptor fd
[in] | fd | file descriptor |
[in] | n | number of bytes to write |
Definition at line 29 of file writ_zeros.c.
void G_xdr_get_double | ( | double * | , |
const void * | |||
) |
Definition at line 83 of file gis/xdr.c.
Referenced by Rast3d_read_range(), and Rast_read_fp_range().
void G_xdr_put_double | ( | void * | , |
const double * | |||
) |
Definition at line 88 of file gis/xdr.c.
Referenced by Rast_write_fp_range(), and Rast_write_rstats().
void G_zero | ( | void * | buf, |
int | i | ||
) |
Zero out a buffer, buf, of length i.
[out] | buf | |
i | number of bytes to be zeroed |
Definition at line 23 of file gis/zero.c.
Referenced by db_get_connection(), db_init_cursor(), db_init_string(), db_set_default_connection(), dig_alloc_area(), dig_alloc_isle(), dig_alloc_line(), dig_alloc_node(), dig_file_init(), dig_init_plus(), dig_read_frmt_ascii(), G_create_key_value(), G_define_flag(), G_define_module(), G_define_option(), gp_get_new_site(), gv_get_new_vect(), gvl_init_vol(), I_sc_add_cat(), Rast3d_read_history(), Rast__set_null_value(), Rast_read_history(), tgis_get_connection(), V2_open_old_ogr(), V2_open_old_pg(), Vect__free_cache(), Vect__free_offset(), Vect__init_head(), Vect__load_map_lines_pg(), Vect_build_ogr(), Vect_build_pg(), Vect_new_cat_list(), Vect_new_dblinks_struct(), and Vect_new_map_struct().
int G_zlib_compress | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 91 of file cmprzlib.c.
int G_zlib_expand | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 170 of file cmprzlib.c.
int G_zone | ( | void | ) |
Query cartographic zone.
This routine returns the zone for the active region. The meaning for the zone depends on the projection. For example, zone 18 for projection type 1 would be UTM zone 18.
Definition at line 25 of file zone.c.
References G_get_set_window(), and Cell_head::zone.
Referenced by Rast__check_for_auto_masking(), and Vect_get_zone().
int G_zstd_compress | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 88 of file cmprzstd.c.
int G_zstd_expand | ( | unsigned char * | src, |
int | src_sz, | ||
unsigned char * | dst, | ||
int | dst_sz | ||
) |
Definition at line 163 of file cmprzstd.c.