|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-6050dcdd58
|
#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 | __has_attribute(x) 0 |
| #define | G_ATTR_MALLOC |
| #define | G_ATTR_RET_NONNULL |
| #define | G_ATTR_ALLOC_SIZE1(N) |
| #define | G_ATTR_ALLOC_SIZE2(N, M) |
| #define | G_ATTR_OWNSHIP_RET |
| #define | G_ATTR_OWNSHIP_TAKE |
| #define | G_MALLOC_ATTR G_ATTR_MALLOC G_ATTR_ALLOC_SIZE1(3) G_ATTR_OWNSHIP_RET G_ATTR_RET_NONNULL |
| #define | G_CALLOC_ATTR G_ATTR_MALLOC G_ATTR_ALLOC_SIZE2(3, 4) G_ATTR_OWNSHIP_RET G_ATTR_RET_NONNULL |
| #define | G_REALLOC_ATTR G_ATTR_ALLOC_SIZE1(4) G_ATTR_RET_NONNULL |
| #define | G_FREE_ATTR G_ATTR_OWNSHIP_TAKE |
| #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. | |
| void | G_adjust_Cell_head3 (struct Cell_head *, int, int, int) |
| Adjust cell header for 3D values. | |
| int | G_adjust_window_ll (struct Cell_head *cellhd) |
| Adjust window for lat/lon. | |
| void | G_free (void *) |
| Free allocated memory. | |
| void * | G__malloc (const char *, int, size_t) |
| Memory allocation. | |
| void * | G__calloc (const char *, int, size_t, size_t) |
| Memory allocation. | |
| void * | G__realloc (const char *, int, void *, size_t) |
| Memory reallocation. | |
| int | G_begin_cell_area_calculations (void) |
| Begin cell area calculations. | |
| double | G_area_of_cell_at_row (int) |
| Cell area in specified row. | |
| int | G_begin_polygon_area_calculations (void) |
| Begin polygon area calculations. | |
| double | G_area_of_polygon (const double *, const double *, int) |
| Area in square meters of polygon. | |
| void | G_begin_zone_area_on_ellipsoid (double, double, double) |
| Begin area calculations for ellipsoid. | |
| double | G_darea0_on_ellipsoid (double) |
| Calculate integral for area between two latitudes. | |
| double | G_area_for_zone_on_ellipsoid (double, double) |
| Calculates area between latitudes. | |
| void | G_begin_ellipsoid_polygon_area (double, double) |
| Begin area calculations. | |
| double | G_ellipsoid_polygon_area (const double *, const double *, int) |
| Area of lat-long polygon. | |
| double | G_planimetric_polygon_area (const double *, const double *, int) |
| Calculates planimetric polygon area. | |
| void | G_begin_zone_area_on_sphere (double, double) |
| Initialize calculations for sphere. | |
| double | G_darea0_on_sphere (double) |
| Calculates integral for area between two latitudes. | |
| double | G_area_for_zone_on_sphere (double, double) |
| Calculates area between latitudes. | |
| void | G_ascii_check (char *) |
| Removes non-ascii characters from buffer. | |
| int | G_vasprintf (char **, const char *, va_list) |
| Safe replacement for asprintf(). | |
| 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. | |
| int | G_faprintf (FILE *, const char *,...) |
| fprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| int | G_saprintf (char *, const char *,...) |
| sprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| int | G_snaprintf (char *, size_t, const char *,...) |
| snprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| int | G_vaprintf (const char *, va_list) |
| vprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| int | G_vfaprintf (FILE *, const char *, va_list) |
| vfprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| int | G_vsaprintf (char *, const char *, va_list) |
| vsprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| int | G_vsnaprintf (char *, size_t, const char *, va_list) |
| vsnprintf() version of G_aprintf(). See G_aprintf() for more details. | |
| size_t | G_strlcat (char *, const char *, size_t) |
| Size-bounded string concatenation. | |
| size_t | G_strlcpy (char *, const char *, size_t) |
| Safe string copy function. | |
| char * | G_basename (char *, const char *) |
| Truncates filename to the base part (before the last '.') if it matches the extension, otherwise leaves it unchanged. | |
| size_t | G_get_num_decimals (const char *) |
| Get number of decimals from a string. | |
| 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'. | |
| char * | G_get_basename_separator (void) |
| Return the environmental basename variable or the default value. | |
| char * | G_join_basename_strings (const char **, size_t) |
| join an array of strings using the basename separator | |
| char * | G_generate_basename (const char *, double, size_t, size_t) |
| Generate the format string. | |
| void | G_bresenham_line (int, int, int, int, int(*)(int, int)) |
| Bresenham line algorithm. | |
| void | G_clicker (void) |
| char * | G_color_rules_options (void) |
| Get list of color rules for Option->options. | |
| char * | G_color_rules_descriptions (void) |
| Get color rules description for Option->descriptions. | |
| char * | G_color_rules_description_type (void) |
| Get color rules description for Option->descriptions. | |
| void | G_list_color_rules (FILE *) |
| Print color rules. | |
| void | G_list_color_rules_description_type (FILE *, char *) |
| Print color rules with description and type. | |
| int | G_find_color_rule (const char *) |
| Check if color rule is defined. | |
| int | G_num_standard_colors (void) |
| Get number of named colors (RGB triplets) | |
| int | G_insert_commas (char *) |
| Inserts commas into a number string. | |
| void | G_remove_commas (char *) |
| Removes commas from number string. | |
| 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. | |
| int | G_copy_file (const char *, const char *) |
| Copies one file to another. | |
| 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. | |
| 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. | |
| int | G_debug (int, const char *,...) __attribute__((format(printf |
| int int | G_begin_distance_calculations (void) |
| Begin distance calculations. | |
| double | G_distance (double, double, double, double) |
| Returns distance in meters. | |
| double | G_distance_between_line_segments (double, double, double, double, double, double, double, double) |
| Returns distance between two line segments in meters. | |
| double | G_distance_point_to_line_segment (double, double, double, double, double, double) |
| Returns distance between a point and line segment in meters. | |
| void | G_done_msg (const char *,...) __attribute__((format(printf |
| void int | G_is_little_endian (void) |
| Tests for little ENDIAN. | |
| void | G_init_env (void) |
| Initialize variables. | |
| const char * | G_getenv (const char *) |
| Get environment variable. | |
| const char * | G_getenv2 (const char *, int) |
| Get variable from specific place. | |
| const char * | G_getenv_nofatal (const char *) |
| Get environment variable. | |
| const char * | G_getenv_nofatal2 (const char *, int) |
| Get environment variable from specific place. | |
| void | G_setenv (const char *, const char *) |
| Set environment variable (updates .gisrc) | |
| void | G_setenv2 (const char *, const char *, int) |
| Set environment variable from specific place (updates .gisrc) | |
| void | G_setenv_nogisrc (const char *, const char *) |
| Set environment name to value (doesn't update .gisrc) | |
| void | G_setenv_nogisrc2 (const char *, const char *, int) |
| Set environment name to value from specific place (doesn't update .gisrc) | |
| void | G_unsetenv (const char *) |
| Remove name from environment. | |
| void | G_unsetenv2 (const char *, int) |
| Remove name from environment from specific place. | |
| const char * | G_get_env_name (int) |
| Get variable name for index n. | |
| void | G_set_gisrc_mode (int) |
| Set where to find/store variables. | |
| int | G_get_gisrc_mode (void) |
| Get info where variables are stored. | |
| void | G_create_alt_env (void) |
| Set up alternative environment variables. | |
| void | G_switch_env (void) |
| Switch environments. | |
| void | G__read_mapset_env (void) |
| Force to read the mapset environment file VAR. | |
| void | G__read_gisrc_env (void) |
| Force to read the GISRC environment file. | |
| void | G__read_gisrc_path (void) |
| Read or read again the GISRC (session) environment variable. | |
| jmp_buf * | G_fatal_longjmp (int) |
| int | G_info_format (void) |
| Get current message format. | |
| 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. | |
| int | G_sleep_on_error (int) |
| Turn on/off no_sleep flag. | |
| void | G_set_error_routine (int(*)(const char *, int)) |
| Establishes error_routine as the routine that will handle the printing of subsequent error messages. | |
| void | G_unset_error_routine (void) |
| After this call subsequent error messages will be handled in the default method. | |
| void | G_init_logging (void) |
| char * | G_file_name (char *, const char *, const char *, const char *) |
| Builds full path names to GIS data files. | |
| char * | G_file_name_misc (char *, const char *, const char *, const char *, const char *) |
| Builds full path names to GIS misc data files. | |
| 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) | |
| char * | G_file_name_basedir (char *, const char *, const char *, const char *, const char *) |
| Builds full path names to GIS data files in temporary directory (for internal use only) | |
| const char * | G_find_file (const char *, char *, const char *) |
| Searches for a file from the mapset search list or in a specified mapset. | |
| 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) | |
| 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. | |
| 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) | |
| 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. | |
| const char * | G_find_raster (char *, const char *) |
| Find a raster map. | |
| const char * | G_find_raster2 (const char *, const char *) |
| Find a raster map (look but don't touch) | |
| const char * | G_find_raster3d (const char *, const char *) |
| Search for a 3D raster map in current search path or in a specified mapset. | |
| const char * | G_find_vector (char *, const char *) |
| Finds a vector map. | |
| const char * | G_find_vector2 (const char *, const char *) |
| Find a vector map (look but don't touch) | |
| 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. | |
| void | G_set_geodesic_distance_lat1 (double) |
| Sets geodesic distance lat1. | |
| void | G_set_geodesic_distance_lat2 (double) |
| Sets geodesic distance lat2. | |
| double | G_geodesic_distance_lon_to_lon (double, double) |
| Calculates geodesic distance. | |
| double | G_geodesic_distance (double, double, double, double) |
| Calculates geodesic distance. | |
| int | G_get_ellipsoid_parameters (double *, double *) |
| get ellipsoid parameters | |
| int | G_get_spheroid_by_name (const char *, double *, double *, double *) |
| Get spheroid parameters by name. | |
| int | G_get_ellipsoid_by_name (const char *, double *, double *) |
| Get ellipsoid parameters by name. | |
| const char * | G_ellipsoid_name (int) |
| Get ellipsoid name. | |
| const char * | G_ellipsoid_description (int) |
| Get description for nth ellipsoid. | |
| int | G_read_ellipsoid_table (int) |
| Read ellipsoid table. | |
| struct Key_Value * | G_get_projunits (void) |
| Gets units information for location. | |
| struct Key_Value * | G_get_projinfo (void) |
| Gets projection information for location. | |
| struct Key_Value * | G_get_projepsg (void) |
| Gets EPSG information for the current location. | |
| char * | G_get_projwkt (void) |
| Get WKT information for the current location. | |
| char * | G_get_projsrid (void) |
| Get srid (spatial reference id) for the current location. | |
| void | G_get_window (struct Cell_head *) |
| Get the current region. | |
| void | G_get_default_window (struct Cell_head *) |
| Get the default region. | |
| void | G_get_element_window (struct Cell_head *, const char *, const char *, const char *) |
| Get region for selected element (raster, vector, window, etc.) | |
| int | G_getl (char *, int, FILE *) |
| Gets a line of text from a file. | |
| int | G_getl2 (char *, int, FILE *) |
| Gets a line of text from a file of any pedigree. | |
| const char * | G_gisbase (void) |
| Get full path name of the top level module directory. | |
| const char * | G_gisdbase (void) |
| Get name of top level database directory. | |
| void | G__gisinit (const char *, const char *) |
| Initialize GIS Library and ensures a valid mapset is available. | |
| void | G__no_gisinit (const char *) |
| Initialize GIS Library. | |
| void | G_init_all (void) |
| Initialize environment. | |
| void | G_add_error_handler (void(*)(void *), void *) |
| Add new error handler. | |
| void | G_remove_error_handler (void(*)(void *), void *) |
| Remove existing error handler. | |
| const char * | G_home (void) |
| Get user's home directory. | |
| const char * | G_config_path (void) |
| Get user's config path directory. | |
| void | G_init_ilist (struct ilist *) |
| Init an integer list and free allocated memory. | |
| void | G_free_ilist (struct ilist *) |
| Free allocated memory of an integer list. | |
| struct ilist * | G_new_ilist (void) |
| Return a new integer list. | |
| void | G_ilist_add (struct ilist *, int) |
| Add item to ilist. | |
| 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. | |
| int | G_is_location (const char *) |
| Test if specified directory is location. | |
| int | G_is_mapset (const char *) |
| Test if specified directory is mapset. | |
| struct Key_Value * | G_create_key_value (void) |
| Allocate and initialize Key_Value structure. | |
| void | G_set_key_value (const char *, const char *, struct Key_Value *) |
| Set value for given key. | |
| const char * | G_find_key_value (const char *, const struct Key_Value *) |
| Find given key (case sensitive) | |
| void | G_free_key_value (struct Key_Value *) |
| Free allocated Key_Value structure. | |
| int | G_fwrite_key_value (FILE *, const struct Key_Value *) |
| Write key/value pairs to file. | |
| struct Key_Value * | G_fread_key_value (FILE *) |
| Read key/values pairs from file. | |
| void | G_write_key_value_file (const char *, const struct Key_Value *) |
| Write key/value pairs to file. | |
| struct Key_Value * | G_read_key_value_file (const char *) |
| Read key/values pairs from file. | |
| void | G_update_key_value_file (const char *, const char *, const char *) |
| Update file, set up value for given key. | |
| int | G_lookup_key_value_from_file (const char *, const char *, char[], int) |
| Look up for key in file. | |
| int | G_legal_filename (const char *) |
| Check for legal database file name. | |
| int | G_check_input_output_name (const char *, const char *, int) |
| Check input and output file names. | |
| 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 *, char *)) |
| General purpose list function. | |
| char ** | G_list (int, const char *, const char *, const char *) |
| List specified type of elements. Application must release the allocated memory. | |
| void | G_free_list (char **) |
| Free list. | |
| 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. | |
| char * | G_location_path (void) |
| Get current location UNIX-like path. | |
| void | G_srand48 (long) |
| Seed the pseudo-random number generator. | |
| long | G_srand48_auto (void) |
| Seed the pseudo-random number generator from the time and PID. | |
| long | G_lrand48 (void) |
| Generate an integer in the range [0, 2^31) | |
| long | G_mrand48 (void) |
| Generate an integer in the range [-2^31, 2^31) | |
| double | G_drand48 (void) |
| Generate a floating-point value in the range [0,1) | |
| 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. | |
| void | G_ls (const char *, FILE *) |
| Prints a directory listing to a stream, in prettified column format. | |
| void | G_ls_format (char **, int, int, FILE *) |
| Prints a listing of items to a stream, in prettified column format. | |
| 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. | |
| 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. | |
| 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. | |
| int | G_write_projsrid (const char *, const char *) |
| Write srid (spatial reference id) to file. | |
| int | G_write_projwkt (const char *, const char *) |
| Write WKT definition to file. | |
| int | G_compare_projections (const struct Key_Value *, const struct Key_Value *, const struct Key_Value *, const struct Key_Value *) |
| Compare projections including units. | |
| int | G_make_mapset (const char *, const char *, const char *) |
| Create a new mapset. | |
| char * | G_tolcase (char *) |
| convert string to lower case | |
| char * | G_toucase (char *) |
| convert string to upper case | |
| const char * | G_mapset (void) |
| Get current mapset name. | |
| char * | G_mapset_path (void) |
| Get current mapset UNIX-like path. | |
| int | G_make_mapset_element (const char *) |
| Create element in the current mapset. | |
| int | G_make_mapset_element_tmp (const char *) |
| Create element in the temporary directory. | |
| int | G_make_mapset_object_group (const char *) |
| Create directory for group of elements of a given type. | |
| int | G_make_mapset_dir_object (const char *, const char *) |
| Create directory for an object of a given type. | |
| int | G_make_mapset_object_group_tmp (const char *) |
| Create directory for type of objects in the temporary directory. | |
| int | G_make_mapset_object_group_basedir (const char *, const char *) |
| Create directory for type of objects in the temporary directory. | |
| int | G__make_mapset_element_misc (const char *, const char *) |
| Create misc element in the current mapset. | |
| int | G_mapset_permissions (const char *) |
| Check for user mapset permission. | |
| int | G_mapset_permissions2 (const char *, const char *, const char *) |
| Check for user mapset permission. | |
| const char * | G_get_mapset_name (int) |
| Get name of the n'th mapset from the current mapset search path. | |
| void | G_create_alt_search_path (void) |
| Define alternative mapset search path. | |
| void | G_switch_search_path (void) |
| Switch mapset search path. | |
| void | G_reset_mapsets (void) |
| Reset number of mapsets. | |
| char ** | G_get_available_mapsets (void) |
| Get list of available mapsets for current location. | |
| void | G_add_mapset_to_search_path (const char *) |
| Add mapset to the list of mapsets in search path. | |
| int | G_is_mapset_in_search_path (const char *) |
| Check if given mapset is in search path. | |
| char * | G_myname (void) |
| Returns location title. | |
| 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) | |
| char * | G_fully_qualified_name (const char *, const char *) |
| Get fully qualified element name. | |
| int | G_unqualified_name (const char *, const char *, char *, char *) |
| Returns unqualified map name (without @ mapset) | |
| int | G_set_omp_num_threads (struct Option *) |
| Set the number of threads for OpenMP The intended usage is at the beginning of a C tool when parameters are processed, namely the G_OPT_M_NPROCS standard option. | |
| int | G_open_new (const char *, const char *) |
| Open a new database file. | |
| int | G_open_old (const char *, const char *, const char *) |
| Open a database file for reading. | |
| int | G_open_update (const char *, const char *) |
| Open a database file for update. | |
| FILE * | G_fopen_new (const char *, const char *) |
| Open a new database file. | |
| FILE * | G_fopen_old (const char *, const char *, const char *) |
| Open a database file for reading. | |
| FILE * | G_fopen_append (const char *, const char *) |
| Open a database file for update (append mode) | |
| FILE * | G_fopen_modify (const char *, const char *) |
| Open a database file for update (r+ mode) | |
| int | G_open_new_misc (const char *, const char *, const char *) |
| open a new database misc file | |
| int | G_open_old_misc (const char *, const char *, const char *, const char *) |
| open a database misc file for reading | |
| int | G_open_update_misc (const char *, const char *, const char *) |
| open a database misc file for update | |
| FILE * | G_fopen_new_misc (const char *, const char *, const char *) |
| open a new database misc file | |
| FILE * | G_fopen_old_misc (const char *, const char *, const char *, const char *) |
| open a database misc file for reading | |
| 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. | |
| 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. | |
| struct GModule * | G_define_module (void) |
| Initializes a new module. | |
| struct Flag * | G_define_flag (void) |
| Initializes a Flag struct. | |
| struct Option * | G_define_option (void) |
| Initializes an Option struct. | |
| struct Option * | G_define_standard_option (int) |
| Create standardised Option structure. | |
| struct Flag * | G_define_standard_flag (int) |
| Create standardised Flag structure. | |
| int | G_parser (int, char **) |
| Parse command line. | |
| void | G_usage (void) |
| Command line help/usage message. | |
| char * | G_recreate_command (void) |
| Creates command to run non-interactive. | |
| void | G_add_keyword (const char *) |
| Add keyword to the list. | |
| void | G_set_keywords (const char *) |
| Set keywords from the string. | |
| int | G_get_overwrite (void) |
| Get overwrite value. | |
| char * | G_option_to_separator (const struct Option *) |
| Get separator string from the option. | |
| 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. | |
| 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. | |
| void | G_option_rule (int, int, void **) |
| Set generic option rule. | |
| void | G_option_exclusive (void *,...) |
| Sets the options to be mutually exclusive. | |
| void | G_option_required (void *,...) |
| Sets the options to be required. | |
| void | G_option_requires (void *,...) |
| Define a list of options from which at least one option is required if first option is present. | |
| void | G_option_requires_all (void *,...) |
| Define additionally required options for an option. | |
| void | G_option_excludes (void *,...) |
| Exclude selected options. | |
| void | G_option_collective (void *,...) |
| Sets the options to be collective. | |
| int | G_mkdir (const char *) |
| Creates a new directory. | |
| int | G_is_dirsep (char) |
| Checks if a specified character is a valid directory separator character on the host system. | |
| int | G_is_absolute_path (const char *) |
| Checks if a specified path looks like an absolute path on the host system. | |
| char * | G_convert_dirseps_to_host (char *) |
| Converts directory separator characters in a string to the native host separator character (/ on Unix, \ on Windows) | |
| char * | G_convert_dirseps_from_host (char *) |
| Converts directory separator characters in a string from the native host character to the GRASS separator character (/) | |
| int | G_lstat (const char *, struct stat *) |
| Get file status. | |
| int | G_stat (const char *, struct stat *) |
| Get file status. | |
| int | G_owner (const char *) |
| Get owner id of path. | |
| void | G_percent (long, long, int) |
| Print percent complete messages. | |
| void | G_percent_reset (void) |
| Reset G_percent() to 0%; do not add newline. | |
| void | G_progress (long, int) |
| Print progress info messages. | |
| void | G_set_percent_routine (int(*)(int)) |
| Establishes percent_routine as the routine that will handle the printing of percentage progress messages. | |
| void | G_unset_percent_routine (void) |
| After this call subsequent percentage progress messages will be handled in the default method. | |
| 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. | |
| void | G_setup_fill (int) |
| Set row_fill routine to row_solid_fill or row_dotted_fill. | |
| void | G_plot_where_xy (double, double, int *, int *) |
| Converts east,north to x,y. | |
| void | G_plot_where_en (int, int, double *, double *) |
| Converts x,y to east,north. | |
| void | G_plot_point (double, double) |
| Plot point. | |
| void | G_plot_line (double, double, double, double) |
| Plot line between latlon coordinates (fastline) | |
| void | G_plot_line2 (double, double, double, double) |
| Plot line between latlon coordinates (slowline) | |
| int | G_plot_polygon (const double *, const double *, int) |
| Plot filled polygon with n vertices. | |
| int | G_plot_area (double *const *, double *const *, int *, int) |
| Plot multiple polygons. | |
| void | G_plot_fx (double(*)(double), double, double) |
| Plot f(east1) to f(east2) | |
| int | G_pole_in_polygon (const double *, const double *, int) |
| Check if pole is in polygon. | |
| const char * | G_program_name (void) |
| Return module name. | |
| const char * | G_original_program_name (void) |
| Return original path of the executed program. | |
| void | G_set_program_name (const char *) |
| Set program name. | |
| int | G_projection (void) |
| Query cartographic projection. | |
| int | G_projection_units (int) |
| Get projection units code (for internal use only) | |
| const char * | G_projection_name (int) |
| Get projection name. | |
| const char * | G_database_unit_name (int) |
| Get units (localized) name for the current location. | |
| int | G_database_unit (void) |
| Get units id for the current location. | |
| const char * | G_database_projection_name (void) |
| Query cartographic projection for the current location. | |
| const char * | G_database_datum_name (void) |
| Get datum name for the current location. | |
| const char * | G_database_ellipse_name (void) |
| Get ellipsoid name for the current location. | |
| double | G_database_units_to_meters_factor (void) |
| Conversion to meters. | |
| const char * | G_database_epsg_code (void) |
| Get EPGS code for the current location. | |
| int | G_put_window (const struct Cell_head *) |
| Writes the region (window) | |
| int | G_put_element_window (const struct Cell_head *, const char *, const char *) |
| Write the region. | |
| void | G_putenv (const char *, const char *) |
| Sets the UNIX environment variable name to value. | |
| double | G_meridional_radius_of_curvature (double, double, double) |
| Meridional radius of curvature. | |
| double | G_transverse_radius_of_curvature (double, double, double) |
| Transverse radius of curvature. | |
| double | G_radius_of_conformal_tangent_sphere (double, double, double) |
| Radius of conformal tangent sphere. | |
| void | G__read_Cell_head (FILE *, struct Cell_head *) |
| Read cell header (for internal use only) | |
| void | G__read_Cell_head_array (char **, struct Cell_head *) |
| Read window from NULL terminated array of strings (for internal use only) | |
| int | G_remove (const char *, const char *) |
| Remove a database file. | |
| int | G_remove_misc (const char *, const char *, const char *) |
| Remove a database misc file. | |
| int | G_recursive_remove (const char *) |
| Recursively remove all files in given directory. | |
| int | G_rename_file (const char *, const char *) |
| Rename a file or a directory in the filesystem. | |
| int | G_rename (const char *, const char *, const char *) |
| Rename a database file. | |
| int | G_begin_rhumbline_equation (double, double, double, double) |
| Start rhumbline calculations. | |
| double | G_rhumbline_lat_from_lon (double) |
| Calculates rhumbline latitude. | |
| void | G_rotate_around_point (double, double, double *, double *, double) |
| Rotate point (double version) | |
| void | G_rotate_around_point_int (int, int, int *, int *, double) |
| Rotate point (int version) | |
| off_t | G_ftell (FILE *) |
| Get the current file position of the stream. | |
| void | G_fseek (FILE *, off_t, int) |
| Change the file position of the stream. | |
| void | G_get_set_window (struct Cell_head *) |
| Get the current working window (region) | |
| void | G_set_window (struct Cell_head *) |
Establishes window as the current working window (region). | |
| void | G_unset_window (void) |
| Unset current region. | |
| void | G_shortest_way (double *, double *) |
| Shortest way between two eastings. | |
| 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) | |
| int | G_strncasecmp (const char *, const char *, int) |
| String compare ignoring case (upper or lower) - limited number of characters. | |
| char * | G_store (const char *) |
| Copy string to allocated memory. | |
| char * | G_store_upper (const char *) |
| Copy string to allocated memory and convert copied string to upper case. | |
| char * | G_store_lower (const char *) |
| Copy string to allocated memory and convert copied string to lower case. | |
| char * | G_strchg (char *, char, char) |
| Replace all occurrences of character in string bug with new. | |
| char * | G_str_replace (const char *, const char *, const char *) |
| Replace all occurrences of old_str in buffer with new_str. | |
| char * | G_str_concat (const char **, int, const char *, int) |
| String concatenation. | |
| void | G_strip (char *) |
| Removes all leading and trailing white space from string. | |
| char * | G_chop (char *) |
| Chop leading and trailing white spaces. | |
| void | G_str_to_upper (char *) |
| Convert string to upper case. | |
| void | G_str_to_lower (char *) |
| Convert string to lower case. | |
| int | G_str_to_sql (char *) |
| Make string SQL compliant. | |
| void | G_squeeze (char *) |
| Remove superfluous white space. | |
| 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) | |
| void | G_init_tempfile (void) |
| Initialize environment for creating tempfiles. | |
| char * | G_tempfile (void) |
| Returns a temporary file name. | |
| char * | G_tempfile_basedir (const char *) |
| Returns a temporary file name. | |
| char * | G_tempfile_pid (int) |
| Create tempfile from process id. | |
| char * | G_tempfile_pid_basedir (int, const char *) |
| Create tempfile from process id in given base directory. | |
| void | G_temp_element (char *) |
| Populates element with a path string. | |
| void | G__temp_element (char *, int) |
| Populates element with a path string (internal use only!) | |
| void | G__temp_element_basedir (char *, const char *) |
| Populates element with a path string (internal use only!) | |
| char * | G_mktemp (char *) |
| Opens a temporary file. | |
| int | G_mkstemp (char *, int, int) |
| Returns a file descriptor. | |
| FILE * | G_mkstemp_fp (char *, int, int) |
| Returns a file descriptor. | |
| void | G_init_timestamp (struct TimeStamp *) |
| Initialize timestamp structure. | |
| 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. | |
| void | G_get_timestamps (const struct TimeStamp *, struct DateTime *, struct DateTime *, int *) |
| Copy TimeStamp into [two] Datetimes structs. | |
| int | G_format_timestamp (const struct TimeStamp *, char *) |
| Create text string from TimeStamp structure. | |
| int | G_scan_timestamp (struct TimeStamp *, const char *) |
| Fill a TimeStamp structure from a datetime string. | |
| int | G_has_raster_timestamp (const char *, const char *) |
| Check if timestamp for raster map exists. | |
| int | G_read_raster_timestamp (const char *, const char *, struct TimeStamp *) |
| Read timestamp from raster map. | |
| int | G_write_raster_timestamp (const char *, const struct TimeStamp *) |
| Write timestamp of raster map. | |
| int | G_remove_raster_timestamp (const char *) |
| Remove timestamp from raster map. | |
| int | G_has_vector_timestamp (const char *, const char *, const char *) |
| Check if timestamp for vector map exists. | |
| int | G_read_vector_timestamp (const char *, const char *, const char *, struct TimeStamp *) |
| Read timestamp from vector map. | |
| int | G_write_vector_timestamp (const char *, const char *, const struct TimeStamp *) |
| Write timestamp of vector map. | |
| int | G_remove_vector_timestamp (const char *, const char *) |
| Remove timestamp from vector map. | |
| int | G_has_raster3d_timestamp (const char *, const char *) |
| Check if timestamp for 3D raster map exists. | |
| int | G_read_raster3d_timestamp (const char *, const char *, struct TimeStamp *) |
| Read timestamp from 3D raster map. | |
| int | G_remove_raster3d_timestamp (const char *) |
| Remove timestamp from 3D raster map. | |
| int | G_write_raster3d_timestamp (const char *, const struct TimeStamp *) |
| Write timestamp of 3D raster map. | |
| char ** | G_tokenize (const char *, const char *) |
| Tokenize string. | |
| char ** | G_tokenize2 (const char *, const char *, const char *) |
| Tokenize string. | |
| int | G_number_of_tokens (char **) |
| Return number of tokens. | |
| void | G_free_tokens (char **) |
| Free memory allocated to tokens. | |
| void | G_trim_decimal (char *) |
| Removes trailing zeros from decimal number. | |
| double | G_meters_to_units_factor (int) |
| Units conversion from meters to units. | |
| double | G_meters_to_units_factor_sq (int) |
| Units conversion from square meters to square units. | |
| const char * | G_get_units_name (int, int, int) |
| Get localized units name. | |
| int | G_units (const char *) |
| Get units code by name. | |
| int | G_is_units_type_spatial (int) |
| Check if the unit is of spatial type. | |
| int | G_is_units_type_temporal (int) |
| Check if the unit is of temporal type. | |
| char * | G_rc_path (const char *, const char *) |
| Returns path to element and item. | |
| int | G_verbose (void) |
| Get current verbosity level. | |
| int | G_verbose_min (void) |
| Get min verbosity level. | |
| int | G_verbose_std (void) |
| Get standard verbosity level. | |
| int | G_verbose_max (void) |
| Get max verbosity level. | |
| int | G_set_verbose (int) |
| Set verbosity level. | |
| void | G_3dview_warning (int) |
| Turns 3D View warnings on and off. | |
| int | G_get_3dview_defaults (struct G_3dview *, struct Cell_head *) |
| Sets default for v based on w. | |
| int | G_put_3dview (const char *, const struct G_3dview *, const struct Cell_head *) |
| Saves info to a 3d.view file in the current mapset. | |
| int | G_get_3dview (const char *, const char *, struct G_3dview *) |
| Gets a 3D View. | |
| const char * | G_whoami (void) |
| Gets user's name. | |
| void | G_adjust_window_to_box (const struct Cell_head *, struct Cell_head *, int, int) |
| Adjusts window to a rectangular box. | |
| void | G_format_northing (double, char *, int) |
| Northing to ASCII. | |
| void | G_format_easting (double, char *, int) |
| Easting to ASCII. | |
| void | G_format_resolution (double, char *, int) |
| Resolution to ASCII. | |
| int | G_point_in_region (double, double) |
| Returns TRUE if coordinate is within the current region settings. | |
| int | G_point_in_window (double, double, const struct Cell_head *) |
| Returns TRUE if coordinate is within the given map region. | |
| int | G_limit_east (double *, int) |
| Function not yet implemented... | |
| int | G_limit_west (double *, int) |
| Function not yet implemented... | |
| int | G_limit_north (double *, int) |
| Limit north (y) coordinate. | |
| int | G_limit_south (double *, int) |
| Limit south (y) coordinate. | |
| int | G_window_overlap (const struct Cell_head *, double, double, double, double) |
| Determines if a box overlays a map window. | |
| double | G_window_percentage_overlap (const struct Cell_head *, double, double, double, double) |
| Determines percentage of box is contained in the window. | |
| int | G_scan_northing (const char *, double *, int) |
| ASCII northing to double. | |
| int | G_scan_easting (const char *, double *, int) |
| ASCII easting to double. | |
| int | G_scan_resolution (const char *, double *, int) |
| ASCII resolution to double. | |
| double | G_adjust_east_longitude (double, double) |
| Adjust east longitude. | |
| double | G_adjust_easting (double, const struct Cell_head *) |
| Returns east not smaller than west. | |
| void | G__init_window (void) |
| Initialize window (region). | |
| 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. | |
| void | G__write_Cell_head3 (FILE *, const struct Cell_head *, int) |
| Write 3D cell header or window. | |
| void | G_write_zeros (int, size_t) |
| Writes n bytes of zero to file descriptor fd | |
| 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. | |
| int | G_zone (void) |
| Query cartographic zone. | |
| #define __has_attribute | ( | x | ) | 0 |
Definition at line 87 of file defs/gis.h.
Definition at line 57 of file defs/gis.h.
Definition at line 108 of file defs/gis.h.
Definition at line 109 of file defs/gis.h.
| #define G_ATTR_MALLOC |
Definition at line 95 of file defs/gis.h.
| #define G_ATTR_OWNSHIP_RET |
Definition at line 118 of file defs/gis.h.
| #define G_ATTR_OWNSHIP_TAKE |
Definition at line 119 of file defs/gis.h.
| #define G_ATTR_RET_NONNULL |
Definition at line 101 of file defs/gis.h.
Definition at line 140 of file defs/gis.h.
| #define G_CALLOC_ATTR G_ATTR_MALLOC G_ATTR_ALLOC_SIZE2(3, 4) G_ATTR_OWNSHIP_RET G_ATTR_RET_NONNULL |
Definition at line 124 of file defs/gis.h.
| #define G_FREE_ATTR G_ATTR_OWNSHIP_TAKE |
Definition at line 127 of file defs/gis.h.
Definition at line 58 of file defs/gis.h.
Definition at line 81 of file defs/gis.h.
Definition at line 139 of file defs/gis.h.
| #define G_MALLOC_ATTR G_ATTR_MALLOC G_ATTR_ALLOC_SIZE1(3) G_ATTR_OWNSHIP_RET G_ATTR_RET_NONNULL |
Definition at line 122 of file defs/gis.h.
| #define G_realloc | ( | p, | |
| n | |||
| ) | G__realloc(RELDIR "/" __FILE__, __LINE__, (p), (n)) |
Definition at line 141 of file defs/gis.h.
| #define G_REALLOC_ATTR G_ATTR_ALLOC_SIZE1(4) G_ATTR_RET_NONNULL |
Definition at line 126 of file defs/gis.h.
| #define RELDIR "?" |
Definition at line 72 of file defs/gis.h.
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 71 of file gis/alloc.c.
References _, Cell_head::cols, file, G_fatal_error(), G_get_window(), G_important_message(), and Cell_head::rows.
Initialize GIS Library and ensures a valid mapset is available.
| version | |
| pgm | program (module) name |
Definition at line 62 of file gisinit.c.
References _, G_fatal_error(), G_location_path(), G_mapset(), G_mapset_permissions(), G_set_program_name(), G_warning(), GIS_H_VERSION, and GRASS_VERSION_STRING.
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_get_set_window(), G_init_all(), and Rast__init_window().
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 261 of file mapset_msc.c.
References G_make_mapset_dir_object(), and name.
Referenced by I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), Rast__close_null(), and Rast__quant_export().
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 31 of file gis/alloc.c.
References _, Cell_head::cols, file, G_fatal_error(), G_get_window(), G_important_message(), malloc(), and Cell_head::rows.
Initialize GIS Library.
Initializes GIS engine, but does not check for a valid mapset.
Definition at line 116 of file gisinit.c.
References _, G_fatal_error(), G_warning(), GIS_H_VERSION, and GRASS_VERSION_STRING.
Read cell header (for internal use only)
| fd | file descriptor | |
| [out] | cellhd | pointer to Cell_head structure |
Definition at line 56 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 G_get_element_window(), and Rast_get_cellhd().
Read window from NULL terminated array of strings (for internal use only)
| array | array of strings | |
| [out] | cellhd | pointer to Cell_head structure |
Definition at line 96 of file rd_cellhd.c.
References _, Cell_head::bottom, Cell_head::cols, Cell_head::cols3, Cell_head::compressed, Cell_head::depths, Cell_head::east, Cell_head::ew_res, Cell_head::ew_res3, F_BOTTOM, F_COLS, F_COLS3, F_COMP, F_DEPTHS, F_EAST, F_EWRES, F_EWRES3, F_FORMAT, F_NORTH, F_NSRES, F_NSRES3, F_PROJ, F_ROWS, F_ROWS3, F_SOUTH, F_TBRES, F_TOP, F_WEST, F_ZONE, Cell_head::format, G_adjust_Cell_head(), G_debug(), G_fatal_error(), G_scan_easting(), G_scan_northing(), G_scan_resolution(), Cell_head::north, Cell_head::ns_res, Cell_head::ns_res3, Cell_head::proj, Cell_head::rows, Cell_head::rows3, SET, Cell_head::south, Cell_head::tb_res, TEST, Cell_head::top, Cell_head::west, and Cell_head::zone.
Referenced by G__read_Cell_head(), and G_get_window().
Force to read the GISRC environment file.
The GISRC file will be read into memory, ignoring if it was read before. Existing values will be overwritten, new values appended.
Definition at line 112 of file env.c.
References G_VAR_GISRC.
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 _, and G_fatal_error().
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 read before. Existing values will be overwritten, new values appended.
Definition at line 98 of file env.c.
References G_VAR_MAPSET.
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 117 of file gis/alloc.c.
References _, Cell_head::cols, file, G_fatal_error(), G_get_window(), G_important_message(), malloc(), and Cell_head::rows.
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 160 of file tempfile.c.
References G__machine_name(), G_debug(), G_make_mapset_object_group(), G_make_mapset_object_group_tmp(), NULL, and strcpy.
Referenced by G_temp_element(), and Vect__get_path().
Populates element with a path string (internal use only!)
| [out] | element | element name |
| basedir |
Definition at line 185 of file tempfile.c.
References G__machine_name(), G_debug(), G_make_mapset_object_group(), G_make_mapset_object_group_basedir(), NULL, and strcpy.
Referenced by G_tempfile_pid_basedir().
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 27 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().
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 72 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.
Referenced by G_put_element_window().
Add new error handler.
Example
| func | handler to add |
| closure | pointer to closure data |
Definition at line 71 of file gis/handler.c.
Referenced by db_set_error_handler_driver(), and Vect_set_error_handler_io().
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 203 of file mapset_nme.c.
References G_is_mapset_in_search_path().
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::east, Cell_head::ew_res, G_fatal_error(), G_verbose_message(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, PROJECTION_LL, Cell_head::rows, Cell_head::south, and Cell_head::west.
Referenced by G__read_Cell_head_array(), G_set_window(), Rast_align_window(), Rast_set_input_window(), Rast_set_output_window(), and Rast_set_window().
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 163 of file adj_cellhd.c.
References _, Cell_head::bottom, Cell_head::cols, Cell_head::cols3, Cell_head::depths, Cell_head::east, Cell_head::ew_res, Cell_head::ew_res3, G_fatal_error(), G_verbose_message(), 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, Cell_head::tb_res, Cell_head::top, and Cell_head::west.
Referenced by Rast3d_adjust_region(), and Rast3d_adjust_region_res().
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.
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.
References Cell_head::east, Cell_head::proj, and PROJECTION_LL.
Referenced by G_plot_where_en(), G_plot_where_xy(), and Rast_easting_to_col().
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 552 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(), G_verbose_message(), 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 30 of file wind_2_box.c.
References Cell_head::cols, Cell_head::east, Cell_head::ew_res, Cell_head::north, Cell_head::ns_res, Cell_head::rows, Cell_head::south, and Cell_head::west.
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 |
Definition at line 465 of file aprintf.c.
References G_vaprintf().
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().
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 68 of file area_sphere.c.
References G_darea0_on_sphere().
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 86 of file gis/area.c.
References PROJECTION_LL.
Referenced by N_init_geom_data_2d().
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 158 of file gis/area.c.
References G_ellipsoid_polygon_area(), G_planimetric_polygon_area(), PROJECTION_LL, and x.
Referenced by Vect_find_island(), and Vect_get_area_area().
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 30 of file ascii_chk.c.
Referenced by Rast__read_history().
Referenced by db_read_dbmscap(), db_select_CatValArray(), db_select_int(), db_select_value(), G_define_standard_option(), G_get_projsrid(), G_parser(), get_pj_area(), get_pj_type_string(), GPJ__get_datum_params(), GPJ__get_ellipsoid_params(), GPJ_get_datum_transform_by_name(), GPJ_grass_to_osr(), GPJ_init_transform(), GPJ_osr_to_grass(), GPJ_set_csv_loc(), M_define_option(), V2__update_area_pg(), V2_rewrite_line_pg(), Vect__insert_face_pg(), Vect__open_cursor_line_pg(), Vect__open_cursor_next_line_pg(), Vect_default_field_info(), and Vect_get_finfo_layer_name().
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 36 of file basename.c.
References G_strcasecmp().
Referenced by G_parser(), and G_set_program_name().
Begin cell area calculations.
This routine must be called once before any call to G_area_of_cell_at_row(). It perform all initializations 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 45 of file gis/area.c.
References G_begin_zone_area_on_ellipsoid(), G_begin_zone_area_on_sphere(), G_darea0_on_ellipsoid(), G_darea0_on_sphere(), G_database_units_to_meters_factor(), G_get_ellipsoid_parameters(), G_get_set_window(), and PROJECTION_LL.
Referenced by N_init_geom_data_2d().
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.
References G_begin_geodesic_distance(), G_database_units_to_meters_factor(), G_get_ellipsoid_parameters(), G_projection(), and PROJECTION_LL.
Referenced by Gs_distance(), Vect_line_geodesic_distance(), and Vect_line_geodesic_length().
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 65 of file area_poly1.c.
Referenced by G_begin_polygon_area_calculations().
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 |
Definition at line 49 of file geodist.c.
Referenced by G_begin_distance_calculations().
Definition at line 38 of file geodesic.c.
References Radians.
Begin polygon area calculations.
This initializes the polygon area calculation routines. It is used both for planimetric and latitude-longitude projections.
Definition at line 119 of file gis/area.c.
References G_begin_ellipsoid_polygon_area(), G_database_units_to_meters_factor(), G_get_ellipsoid_parameters(), G_projection(), and PROJECTION_LL.
Referenced by Vect_find_island(), and Vect_get_area_area().
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 57 of file rhumbline.c.
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.
References M_PI.
Referenced by G_begin_cell_area_calculations().
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 35 of file area_sphere.c.
Referenced by G_begin_cell_area_calculations().
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.
Definition at line 85 of file cmprbzip.c.
References _, err(), G_bz2_compress_bound(), G_calloc, G_fatal_error(), G_free(), G_warning(), and NULL.
Definition at line 168 of file cmprbzip.c.
References _, err(), G_fatal_error(), G_warning(), and NULL.
Definition at line 140 of file compress.c.
References _, compressor, and G_warning().
Referenced by Rast__open_old().
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 71 of file legal_name.c.
References _, G_fatal_error(), G_FATAL_EXIT, G_FATAL_PRINT, G_find_raster2(), G_legal_filename(), G_mapset(), G_name_is_fully_qualified(), G_warning(), NULL, and output().
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 33 of file overwrite.c.
References G_getenv_nofatal(), and G_setenv_nogisrc().
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 332 of file strings.c.
References t.
Referenced by check_create_export_opts(), check_create_import_opts(), check_mapset_in_layer_name(), dig_read_frmt_ascii(), G_get_projsrid(), G_get_projwkt(), G_parser(), G_str_to_color(), get_key_data(), Rast_parse_color_rule(), read_coor(), S_read(), and Vect_read_ascii().
Definition at line 17 of file clicker.c.
References G_info_format(), G_INFO_FORMAT_SILENT, and G_verbose().
Definition at line 65 of file pager.c.
References G_popen_close().
Close an input/output file returned by G_open_option_file(). If the file pointer is stdin, stdout, or stderr, nothing happens.
| fp | file pointer |
Definition at line 35 of file named_colr.c.
References AMI_STREAM< T >::name(), and NULL.
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 G_malloc, G_realloc, and name.
Referenced by G_define_standard_option().
Get list of color rules for Option->options.
Definition at line 40 of file gis/color_rules.c.
References G_realloc, name, and NULL.
Referenced by G_define_standard_option().
Definition at line 20 of file named_colr.c.
References b, g, AMI_STREAM< T >::name(), name, and r.
| 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 229 of file make_loc.c.
References G_debug(), G_find_key_value(), G_get_ellipsoid_by_name(), G_strcasecmp(), NULL, and TRUE.
Definition at line 218 of file compress.c.
References _, compressor, and G_fatal_error().
Referenced by G_write_compressed().
Definition at line 202 of file compress.c.
References _, compressor, and G_fatal_error().
Referenced by G_write_compressed().
Definition at line 118 of file compress.c.
References compressor, AMI_STREAM< T >::name(), and NULL.
Referenced by Rast__open_old().
Definition at line 100 of file compress.c.
References compressor, G_strcasecmp(), AMI_STREAM< T >::name(), and name.
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 99 of file home.c.
References _, CONFIG_DIR, G_fatal_error(), G_home(), G_initialize_done(), G_is_initialized(), G_mkdir(), G_store(), GPATH_MAX, HOST_DIRSEP, and NULL.
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.
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.
Referenced by db_read_dbmscap().
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 33 of file copy_file.c.
References G_warning(), and NULL.
Referenced by G_rename_file().
Definition at line 46 of file counter.c.
References Counter::value.
Referenced by G_tempfile_pid(), and G_tempfile_pid_basedir().
Set up alternative environment variables.
Definition at line 569 of file env.c.
References b, G_VAR_GISRC, AMI_STREAM< T >::name(), and NULL.
Referenced by G_make_mapset().
Define alternative mapset search path.
Definition at line 106 of file mapset_nme.c.
References UntypedStream::path.
Allocate and initialize Key_Value structure.
Definition at line 23 of file key_value1.c.
References G_malloc, and G_zero().
Referenced by G_fread_key_value(), GPJ_get_ellipsoid_params(), GPJ_osr_to_grass(), Rast3d_write_header(), and Rast_create_gdal_link().
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(), and G_begin_cell_area_calculations().
Calculates integral for area between two latitudes.
| lat | latitude |
Definition at line 47 of file area_sphere.c.
References Radians.
Referenced by G_area_for_zone_on_sphere(), and G_begin_cell_area_calculations().
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 186 of file proj3.c.
References G_get_datumparams_from_projinfo(), G_store(), name, and NULL.
Get ellipsoid name for the current location.
Definition at line 212 of file proj3.c.
References G_get_ellipsoid_parameters(), G_store(), and name.
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 118 of file proj3.c.
References _, G_projection(), G_projection_name(), name, PROJECTION_LL, PROJECTION_UTM, and PROJECTION_XY.
Referenced by Vect_get_proj_name().
Get units id for the current location.
Definition at line 66 of file proj3.c.
References G_projection(), G_projection_units(), name, strcasecmp, U_ACRES, U_DEGREES, U_FEET, U_HECTARES, U_KILOMETERS, U_METERS, U_MILES, U_UNDEFINED, U_UNKNOWN, and U_USFEET.
Referenced by G_database_unit_name().
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_database_units_to_meters_factor(), G_get_units_name(), G_units(), and gsd_scalebar().
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 146 of file proj3.c.
References G_database_unit_name(), and NULL.
Referenced by G_begin_cell_area_calculations(), G_begin_distance_calculations(), G_begin_polygon_area_calculations(), N_init_geom_data_2d(), and N_init_geom_data_3d().
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.
References AMI_STREAM< T >::AMI_STREAM(), G_initialize_done(), G_is_initialized(), and G_store().
Referenced by Rast_short_history(), Vect__init_head(), and Vect_hist_command().
Definition at line 66 of file gis/datum.c.
References G_read_datum_table(), and NULL.
Definition at line 76 of file gis/datum.c.
References G_read_datum_table(), and NULL.
Definition at line 56 of file gis/datum.c.
References G_read_datum_table(), AMI_STREAM< T >::name(), and NULL.
Referenced by add_coor(), add_ipoint(), alloc_statistics(), AS_eqdrt(), c_thresh(), Cairo_begin_raster(), Cairo_Bitmap(), Cairo_Box(), Cairo_Color(), Cairo_end_raster(), Cairo_Erase(), Cairo_Graph_close(), Cairo_Graph_set(), Cairo_Line_width(), Cairo_raster(), cairo_read_image(), Cairo_Set_window(), cairo_write_image(), check_create_import_opts(), close_band_files(), D_open_driver(), D_plot_icon(), db__driver_begin_transaction(), db__driver_commit_transaction(), db_CatValArray_get_value_double(), db_close_database_shutdown_driver(), db_d_init_error(), db_delete_table(), db_driver(), db_get_column(), db_get_login_dump(), db_read_dbmscap(), db_select_CatValArray(), db_select_int(), db_set_default_connection(), db_start_driver(), db_start_driver_open_database(), db_table_exists(), db_table_to_sql(), dig__read_head(), dig__write_head(), dig_add_area(), dig_add_isle(), dig_add_node(), dig_alloc_isles(), dig_angle_next_line(), dig_area_add_isle(), dig_area_alloc_isle(), dig_area_del_isle(), dig_build_area_with_line(), dig_cidx_add_cat(), dig_cidx_add_cat_sorted(), dig_cidx_del_cat(), dig_cidx_free(), dig_cidx_init(), dig_cidx_sort(), dig_del_area(), dig_del_isle(), dig_del_line(), dig_file_load(), dig_find_area_box(), dig_find_isle_box(), dig_find_line_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_isle_alloc_line(), dig_line_add_updated(), dig_line_degenerate(), dig_line_get_area(), dig_load_plus(), dig_node_add_line(), dig_node_add_updated(), dig_node_alloc_line(), dig_node_angle_check(), 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_line(), dig_spidx_add_node(), dig_spidx_del_area(), dig_spidx_del_isle(), dig_spidx_del_line(), 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(), dig_write_frmt_ascii(), find_all_intersections(), free_data_buffs(), free_perimeters(), G__read_Cell_head(), G__read_Cell_head_array(), G__temp_element(), G__temp_element_basedir(), G_compare_projections(), G_find_raster(), G_find_raster2(), G_find_vector(), G_find_vector2(), G_fopen_append(), G_fopen_modify(), G_fopen_new(), G_fopen_old(), G_get_available_mapsets(), G_get_projepsg(), G_get_projsrid(), G_get_projwkt(), G_has_vector_timestamp(), G_math_add_spvector(), G_math_alloc_spmatrix(), G_math_alloc_spvector(), G_math_cholesky_sband_decomposition(), G_option_to_separator(), G_read_vector_timestamp(), G_set_program_name(), G_str_to_color(), G_tempfile_pid(), G_tempfile_pid_basedir(), G_write_vector_timestamp(), get_feature(), get_key_data(), get_pj_area(), get_pj_object(), GK_add_key(), gk_follow_frames(), 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_sitename(), GP_get_style(), GP_get_trans(), GP_get_zmode(), gp_init_site(), GP_load_site(), Gp_load_sites(), GP_new_site(), gp_num_sites(), GP_select_surf(), gp_set_defaults(), GP_set_style(), GP_set_style_thematic(), 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_grass_to_osr(), GPJ_init_transform(), GPJ_osr_to_grass(), GPJ_transform(), Gs_build_256lookup(), gs_calc_normals(), GS_clear(), GS_default_draw_color(), gs_delete_surf(), GS_delete_surface(), GS_done_draw(), GS_draw_flowline_at_xy(), GS_draw_fringe(), GS_draw_surf(), GS_draw_wire(), gs_free_surf(), gs_free_unshared_buffs(), GS_get_aspect(), gs_get_att_src(), gs_get_att_typbuff(), gs_get_att_type(), GS_get_distance_alongsurf(), GS_get_drawres(), GS_get_exag_guess(), GS_get_focus(), GS_get_from(), gs_get_last_surface(), GS_get_longdim(), GS_get_modelposition1(), gs_get_new_surface(), GS_get_nozero(), gs_get_prev_surface(), GS_get_selected_point_on_surface(), gs_get_surf(), GS_get_to(), GS_get_trans(), GS_get_zextents(), GS_get_zrange(), GS_get_zrange_nz(), gs_getall_surfaces(), GS_global_exag(), gs_init_surf(), GS_init_view(), GS_libinit(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), gs_los_intersect(), gs_los_intersect1(), gs_malloc_att_buff(), gs_malloc_lookup(), GS_moveto(), GS_new_surface(), gs_num_datah_reused(), gs_num_surfaces(), Gs_numtype(), GS_ready_draw(), gs_set_att_const(), GS_set_att_defaults(), gs_set_att_src(), gs_set_att_type(), gs_set_defaults(), GS_set_drawmode(), 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_nozero(), GS_set_trans(), GS_set_viewport(), GS_set_wire_color(), GS_surf_exists(), Gs_update_attrange(), gs_update_curmask(), gsd_3darrow(), gsd_arrow_onsurf(), gsd_norm_arrows(), gsd_ortho_wall(), gsd_surf(), gsd_surf_const(), gsd_surf_map_old(), gsd_wire_arrows(), gsd_wire_surf(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsds_alloc_typbuff(), gsds_free_datah(), gv_decimate_lines(), 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_load_vect(), GV_new_vector(), gv_num_vects(), gv_set_defaults(), GV_set_trans(), GV_unset_style_thematic(), GV_vect_exists(), gvd_vect(), gvl_align_data(), 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(), gvl_isosurf_get_att_src(), GVL_isosurf_get_drawres(), GVL_isosurf_get_flags(), gvl_isosurf_get_isosurf(), gvl_isosurf_init(), GVL_isosurf_move_down(), GVL_isosurf_move_up(), GVL_isosurf_num_isosurfs(), gvl_isosurf_set_att_changed(), gvl_isosurf_set_att_const(), GVL_isosurf_set_att_const(), gvl_isosurf_set_att_map(), GVL_isosurf_set_att_map(), gvl_isosurf_set_att_src(), GVL_isosurf_set_drawmode(), GVL_isosurf_set_drawres(), GVL_isosurf_set_flags(), GVL_isosurf_set_maskmode(), GVL_isosurf_unset_att(), GVL_load_vol(), GVL_new_vol(), gvl_num_vols(), GVL_set_draw_wire(), GVL_set_focus_center_map(), GVL_set_trans(), GVL_slice_add(), GVL_slice_del(), gvl_slice_freemem(), GVL_slice_get_drawres(), GVL_slice_get_transp(), gvl_slice_init(), GVL_slice_move_down(), GVL_slice_move_up(), GVL_slice_num_slices(), GVL_slice_set_drawmode(), GVL_slice_set_drawres(), GVL_slice_set_transp(), gvl_slices_calc(), GVL_vol_exists(), gvl_write_char(), gvld_isosurf(), gvld_slices(), gvld_vol(), gvld_wind3_box(), gvld_wire_slices(), gvld_wire_vol(), I_cluster_assign(), I_cluster_exec_allocate(), I_cluster_means(), I_cluster_sum2(), I_compute_scatts(), I_find_signature(), I_find_signature2(), 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(), I_iclass_write_signatures(), I_signatures_copy(), I_signatures_remove(), I_signatures_rename(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_matrix_create_alloc(), IL_vector_input_data_2d(), IL_write_point_2d(), kdtree_optimize(), kdtree_traverse(), M_do_copy(), make_all_statistics(), make_perimeter(), make_statistics(), N_alloc_array_2d(), N_alloc_array_3d(), N_alloc_gradient_field_2d(), N_alloc_gradient_field_3d(), N_alloc_les_param(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_calc_array_2d_stats(), N_calc_array_3d_stats(), N_calc_gradient_field_2d_stats(), N_calc_gradient_field_3d_stats(), N_calc_solute_transport_disptensor_2d(), N_calc_solute_transport_disptensor_3d(), N_calc_solute_transport_transmission_2d(), N_callback_gwflow_2d(), N_callback_gwflow_3d(), N_callback_solute_transport_2d(), N_callback_solute_transport_3d(), N_callback_template_3d(), N_compute_gradient_field_2d(), N_compute_gradient_field_3d(), N_convert_array_2d_null_to_zero(), N_convert_array_3d_null_to_zero(), 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_array_2d(), N_free_array_3d(), N_free_les(), N_get_geom_data_area_of_cell(), N_get_gradient_2d(), N_get_gradient_3d(), N_get_gradient_neighbours_2d(), N_init_geom_data_2d(), N_init_geom_data_3d(), N_is_array_2d_value_null(), N_is_array_3d_value_null(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), N_math_array_2d(), N_math_array_3d(), N_norm_array_2d(), N_norm_array_3d(), N_put_array_2d_value(), N_put_array_2d_value_null(), N_put_array_3d_value(), N_put_array_3d_value_null(), Nviz_change_exag(), Nviz_get_exag(), Nviz_get_exag_height(), Nviz_get_viewpoint_height(), Nviz_get_viewpoint_position(), Nviz_init_light(), Nviz_look_here(), Nviz_resize_window(), Nviz_set_light_ambient(), Nviz_set_light_bright(), Nviz_set_light_color(), Nviz_set_light_position(), Nviz_set_rotation(), Nviz_set_viewpoint_height(), Nviz_set_viewpoint_persp(), Nviz_set_viewpoint_position(), Nviz_set_viewpoint_twist(), open_band_files(), order_intersects(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), perimeter_add_point(), pg_addedge(), pg_create(), PNG_Graph_set(), print_vol_fields(), Rast3d_compute_optimal_tile_dimension(), Rast3d_coord2location(), Rast3d_location2coord_double(), Rast3d_open_new_opt_tile_size(), Rast__create_window_mapping(), Rast_align_window(), Rast_get_cat(), Rast_get_next_marked_d_cat(), Rast_read_color_rule(), Rast_read_fp_range(), Rast_read_rstats(), Rast_sort_cats(), Rast_unset_window(), rbtree_remove(), rbtree_traverse(), rbtree_traverse_backwd(), read_band_row(), read_coor(), recreate_command(), S_read(), S_stroke(), seg_pagein(), seg_setup(), segment_intersection_2d(), segment_intersection_2d_tol(), sort_intersection_list(), stroke_chain(), 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_line_ogr(), V1_read_line_pg(), V1_read_next_line_nat(), V1_read_next_line_pg(), V1_restore_line_nat(), V1_rewind_ogr(), V1_rewind_pg(), V1_rewrite_line_nat(), V1_rewrite_line_ogr(), V1_rewrite_line_pg(), V2__add_line_to_topo_nat(), V2__delete_line_from_topo_nat(), V2_close_ogr(), V2_close_pg(), V2_delete_line_nat(), V2_delete_line_sfa(), V2_open_old_ogr(), V2_open_old_pg(), V2_read_line_nat(), V2_read_line_pg(), V2_read_line_sfa(), V2_read_next_line_nat(), V2_read_next_line_ogr(), V2_read_next_line_pg(), V2_restore_line_nat(), V2_rewind_ogr(), V2_rewind_pg(), V2_rewrite_line_pg(), V2_rewrite_line_sfa(), V2_write_line_nat(), V2_write_line_sfa(), Vect__cache_feature_pg(), Vect__copy_areas(), Vect__define_topo_relation(), Vect__delete(), Vect__execute_get_value_pg(), Vect__execute_pg(), Vect__get_area_points_nat(), Vect__insert_face_pg(), Vect__load_map_lines_pg(), Vect__load_map_nodes_pg(), Vect__load_plus_head(), Vect__load_plus_pg(), Vect__open_cursor_line_pg(), Vect__open_cursor_next_line_pg(), Vect__open_old(), Vect__read_head(), Vect__select_line_pg(), Vect_add_dblink(), Vect_area_buffer2(), Vect_array_to_cat_list(), Vect_attach_centroids(), Vect_attach_isle(), Vect_attach_isles(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_line_area(), Vect_build_nat(), 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_find_next(), Vect_cidx_get_field_index(), Vect_cidx_get_type_count(), Vect_cidx_open(), Vect_cidx_save(), Vect_clean_small_angles_at_nodes(), Vect_close(), Vect_coor_info(), Vect_copy(), Vect_copy_table_by_cats(), Vect_copy_tables(), Vect_default_field_info(), Vect_delete_line(), Vect_find_area(), Vect_find_island(), Vect_find_line_list(), Vect_find_node(), Vect_get_area_area(), Vect_get_area_boundaries(), Vect_get_area_centroid(), Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_area_perimeter(), Vect_get_area_points(), Vect_get_area_points_geos(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), 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_boundaries(), Vect_get_isle_points(), Vect_get_isle_points_geos(), Vect_get_line_cat(), Vect_get_next_line_id(), Vect_get_point_in_area(), Vect_get_point_in_poly(), 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_graph_shortest_path(), Vect_hist_command(), Vect_hist_copy(), Vect_hist_read(), Vect_hist_rewind(), Vect_hist_write(), Vect_isle_find_area(), Vect_line_buffer2(), Vect_line_intersection(), Vect_line_intersection2(), Vect_line_parallel(), Vect_line_parallel2(), Vect_line_segment(), Vect_line_to_geos(), Vect_map_del_dblink(), Vect_merge_lines(), Vect_net_build_graph(), Vect_net_get_line_cost(), Vect_net_get_node_cost(), Vect_net_nearest_nodes(), Vect_net_ttb_build_graph(), Vect_net_ttb_shortest_path(), Vect_open_fidx(), Vect_open_new(), Vect_open_sidx(), Vect_open_tmp_new(), Vect_open_topo(), Vect_overlay_and(), Vect_point_buffer2(), Vect_point_in_area_outer_ring(), Vect_point_in_island(), Vect_point_in_poly(), Vect_point_on_line(), Vect_read_area_geos(), Vect_read_ascii(), Vect_read_dblinks(), Vect_read_line(), Vect_read_line_geos(), Vect_read_next_line(), Vect_remove_duplicates(), Vect_remove_small_areas_ext(), Vect_remove_small_areas_nat(), Vect_rename(), Vect_restore_line(), Vect_rewind(), Vect_rewrite_line(), Vect_save_fidx(), Vect_save_sidx(), Vect_save_topo(), Vect_segment_intersection(), Vect_select_areas_by_box(), Vect_select_areas_by_polygon(), Vect_select_isles_by_box(), Vect_select_lines_by_box(), Vect_select_lines_by_polygon(), Vect_select_nodes_by_box(), Vect_set_thresh(), Vect_set_updated(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_cat_string(), Vect_set_varray_from_db(), Vect_snap_line(), Vect_snap_lines(), Vect_spatial_index_add_item(), Vect_spatial_index_del_item(), Vect_spatial_index_destroy(), Vect_spatial_index_init(), Vect_spatial_index_select(), Vect_str_to_cat_list(), Vect_subst_var(), Vect_tin_get_z(), Vect_topo_check(), Vect_write_ascii(), Vect_write_dblinks(), Vect_write_line(), vector2perimeters(), Vedit_add_vertex(), Vedit_chtype_lines(), Vedit_connect_lines(), Vedit_copy_lines(), Vedit_delete_area(), Vedit_delete_area_centroid(), Vedit_delete_areas_cat(), Vedit_delete_lines(), Vedit_extend_lines(), Vedit_flip_lines(), Vedit_get_min_distance(), Vedit_merge_lines(), Vedit_move_lines(), Vedit_move_vertex(), Vedit_remove_vertex(), Vedit_render_map(), Vedit_select_by_query(), Vedit_snap_line(), Vedit_snap_point(), and Vedit_split_lines().
Definition at line 126 of file compress.c.
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 AMI_STREAM< T >::AMI_STREAM(), G_malloc, G_zero(), NULL, and st.
Referenced by G_define_standard_flag().
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 AMI_STREAM< T >::AMI_STREAM(), G_malloc, G_zero(), NO, and st.
Referenced by G_define_standard_option(), M_define_option(), N_define_standard_option(), and Rast3d_set_window_params().
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 1025 of file parser_standard_options.c.
References _, G_define_flag(), G_FLG_V_TABLE, and G_FLG_V_TOPO.
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 143 of file parser_standard_options.c.
References _, DEFAULT_FG_COLOR, G_asprintf(), G_color_rules_description_type(), G_color_rules_options(), G_define_option(), G_getenv_nofatal(), G_OPT_C, G_OPT_C_FORMAT, 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_FORMAT, 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_SEED, 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_SUFFIX, 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(), GV_KEY_COLUMN, NO, TYPE_DOUBLE, TYPE_INTEGER, TYPE_STRING, and YES.
Referenced by Rast3d_set_standard3d_input_params().
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.
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.
| [in] | e1,n1 | east-north coordinates of first point |
| [in] | 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 G_distance_point_to_line_segment(), Gs_distance(), and Vect_line_geodesic_distance().
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_distance_point_to_line_segment(), 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 117 of file gis/distance.c.
References _, G_distance(), G_intersect_line_segments(), G_warning(), t, and x.
Referenced by G_distance_between_line_segments().
Convert a double to a string substituting the dot with underscore 12.3456 => '12_3456'.
| number | the double number that will be converted to string |
| ndigits | the number of integer digits in the output string |
| ndecimals | the number of decimals in the output string |
Definition at line 76 of file basename.c.
References G_malloc, and GNAME_MAX.
Referenced by G_generate_basename().
Generate a floating-point value in the range [0,1)
Definition at line 161 of file lrand48.c.
References r.
Referenced by f_rand(), and G_math_rand().
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 182 of file get_ellipse.c.
References G_read_ellipsoid_table(), and NULL.
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 132 of file get_ellipse.c.
References G_read_ellipsoid_table(), AMI_STREAM< T >::name(), and NULL.
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 133 of file area_poly1.c.
References M_PI, Radians, and TWOPI.
Referenced by G_area_of_polygon().
Definition at line 233 of file compress.c.
References _, compressor, and G_fatal_error().
Referenced by G_read_compressed().
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 |
Definition at line 485 of file aprintf.c.
References G_vfaprintf().
Referenced by AS_class_apply_algorithm(), AS_class_equiprob(), AS_option_to_algorithm(), Cairo_begin_raster(), Cairo_Bitmap(), Cairo_Graph_set(), cairo_read_bmp(), cairo_read_ppm(), cairo_read_xid(), cairo_write_bmp(), cairo_write_ppm(), cairo_write_xid(), check_create_import_opts(), clean_dir(), D_open_driver(), D_parse_color(), db_d_append_error(), db_set_default_connection(), db_table_exists(), dig__fread_port_O(), dig__fwrite_port_O(), dig__read_head(), dig_angle_next_line(), dig_area_add_isle(), dig_area_del_isle(), dig_del_area(), dig_del_isle(), dig_del_line(), dig_find_line_box(), 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_line(), dig_spidx_del_node(), dig_Wr_spidx_head(), dig_write_frmt_ascii(), font_init(), G__calloc(), G__check_option_rules(), G__describe_option_rules(), G__describe_option_rules_xml(), G__first_required_option_from_rules(), G__gisinit(), G__malloc(), G__no_gisinit(), G__read_Cell_head_array(), G__read_gisrc_path(), G__realloc(), G_adjust_Cell_head(), G_adjust_Cell_head3(), G_adjust_window_ll(), G_bz2_compress(), G_bz2_expand(), G_check_input_output_name(), G_compress(), G_compress_bound(), G_config_path(), G_expand(), G_fseek(), G_get_element_window(), G_get_projsrid(), G_get_projwkt(), G_getenv(), G_getenv2(), G_home(), G_list(), G_location_path(), G_ls2(), G_make_mapset(), G_mapset(), G_mapset_path(), G_math_cholesky_sband_decomposition(), G_math_solver_pcg_sband(), G_mkstemp(), G_open_option_file(), G_option_to_color_format(), G_option_to_separator(), G_owner(), G_parser(), G_read_ellipsoid_table(), G_read_key_value_file(), G_set_omp_num_threads(), G_srand48_auto(), G_vector_norm_euclid(), G_vector_norm_maxval(), G_write_key_value_file(), G_write_projsrid(), G_write_projwkt(), G_write_zeros(), G_zstd_compress(), G_zstd_compress_bound(), G_zstd_expand(), GK_print_keys(), Gp_load_sites(), Gp_load_sites_thematic(), GPJ__get_ellipsoid_params(), GPJ_init_transform(), GPJ_transform(), GPJ_transform_array(), GS_load_att_map(), Gv_load_vect_thematic(), HTML_Graph_set(), I_get_signatures_dir(), I_sort_signatures_by_semantic_label(), I_SortSigSetBySemanticLabel(), IL_create_bitmask(), IL_interp_segments_2d_parallel(), IL_output_2d(), IL_resample_output_2d(), IL_vector_input_data_2d(), IL_write_point_2d(), IL_write_temp_2d(), kdtree_dnn(), kdtree_knn(), line_check_intersection2(), M_do_list(), M_do_remove(), M_read_list(), main(), N_alloc_array_2d(), N_alloc_array_3d(), 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(), N_math_array_2d(), N_math_array_3d(), N_norm_array_2d(), N_norm_array_3d(), N_read_rast3d_to_array_3d(), N_read_rast_to_array_2d(), N_write_array_2d_to_rast(), N_write_array_3d_to_rast3d(), NetA_articulation_points(), NetA_betweenness_closeness(), NetA_compute_bridges(), NetA_eigenvector_centrality(), NetA_find_path(), NetA_flow(), NetA_get_node_costs(), NetA_init_timetable_from_db(), NetA_initialise_varray(), NetA_min_cut(), NetA_spanning_tree(), NetA_split_vertices(), NetA_strongly_connected_components(), NetA_weakly_connected_components(), Nviz_create_render_window(), P_Sparse_Points(), pg_addedge(), pj_get_kv(), pj_get_string(), port_init(), PS_Graph_set(), Rast3d_fatal_error(), Rast3d_fatal_error_noargs(), Rast3d_write_tile(), Rast__check_fp_type(), Rast__check_init(), Rast__check_null_bit(), Rast__close_null(), Rast__null_bitstream_size(), Rast__open_null_write(), Rast__open_old(), Rast__read_null_bits(), Rast__write_null_bits(), Rast_close(), Rast_create_gdal_link(), Rast_get_cellhd(), Rast_get_sample(), Rast_get_vrt(), Rast_get_window(), Rast_make_random_colors(), Rast_map_is_fp(), Rast_map_type(), Rast_option_to_interp_type(), Rast_print_json_colors(), Rast_put_cellhd(), Rast_put_reclass(), Rast_quantize_fp_map(), Rast_read_color_rule(), Rast_read_color_rules(), Rast_read_histogram(), Rast_set_fp_type(), Rast_set_quant_rules(), Rast_unopen(), Rast_window_cols(), Rast_window_rows(), Rast_write_colors(), Rast_write_fp_range(), Rast_write_history(), Rast_write_quant(), Rast_write_range(), Rast_write_rstats(), read_bmp(), read_ellipsoid_table(), read_image(), read_pgm(), read_png(), read_ppm(), RTreeCreateTree(), RTreeReadNode(), RTreeRewriteNode(), RTreeWriteBranch(), RTreeWriteNode(), seg_seek_fast(), seg_seek_slow(), tgis_set_default_connection(), V1_close_nat(), V1_close_pg(), V1_delete_line_pg(), V1_open_new_ogr(), V1_open_new_pg(), V1_open_old_ogr(), V1_open_old_pg(), V1_read_line_pg(), V1_read_next_line_pg(), V1_rewind_pg(), V1_rewrite_line_pg(), V1_write_line_pg(), V2__write_area_sfa(), V2_close_pg(), V2_delete_line_pg(), V2_delete_line_sfa(), V2_open_old_pg(), V2_read_line_pg(), V2_read_next_line_pg(), V2_rewind_pg(), V2_rewrite_line_pg(), V2_write_line_pg(), Vect__build_sfa(), Vect__get_area_points(), Vect__get_path(), Vect__open_old(), Vect__open_topo_pg(), Vect_append_point(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_line_area(), Vect_build_partial(), Vect_build_pg(), Vect_build_sidx(), Vect_cat_set(), Vect_cats_set_constraint(), Vect_check_input_output_name(), Vect_cidx_find_all(), Vect_cidx_get_cat_by_index(), Vect_copy(), Vect_copy_map_lines_field(), Vect_default_field_info(), Vect_get_area_boundaries(), Vect_get_area_centroid(), Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_centroid_area(), Vect_get_isle_area(), Vect_get_isle_boundaries(), Vect_get_isle_points(), Vect_get_line_nodes(), Vect_graph_add_edge(), Vect_graph_build(), Vect_line_delete_point(), Vect_line_get_point(), Vect_line_insert_point(), Vect_line_intersection2(), Vect_net_build_graph(), Vect_net_get_line_cost(), Vect_net_ttb_build_graph(), Vect_net_ttb_shortest_path(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_map_struct(), Vect_open_fidx(), Vect_overlay(), Vect_read_area_geos(), Vect_read_dblinks(), Vect_read_line_geos(), Vect_remove_small_areas_ext(), Vect_remove_small_areas_nat(), Vect_rename(), Vect_save_frmt(), Vect_set_db_updated(), Vect_sfa_get_num_features(), Vect_spatial_index_del_item(), Vect_write_ascii(), Vect_write_colors(), write_bmp(), write_image(), write_pgm(), write_png(), and write_ppm().
Definition at line 66 of file gis/error.c.
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 D_open_driver(), G_get_ellipsoid_parameters(), G_get_projepsg(), G_get_projinfo(), G_get_projsrid(), G_get_projunits(), G_get_projwkt(), G_has_vector_timestamp(), G_make_location(), G_make_location_epsg(), G_make_mapset_dir_object(), G_make_mapset_element(), G_make_mapset_object_group(), G_mapset_permissions(), G_myname(), G_rename(), G_tempfile_pid(), G_write_projsrid(), G_write_projwkt(), I_signatures_copy(), I_signatures_rename(), 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_basedir | ( | char * | path, |
| const char * | element, | ||
| const char * | name, | ||
| const char * | mapset, | ||
| const char * | basedir | ||
| ) |
Builds full path names to GIS data files in temporary directory (for internal use only)
By default the GRASS temporary directory is located at $LOCATION/$MAPSET/.tmp/$HOSTNAME/. If basedir is provided, the temporary directory is located at <basedir>/.tmp/$HOSTNAME/.
| [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 | |
| basedir |
Definition at line 155 of file file_name.c.
Referenced by G_make_mapset_object_group_basedir(), and G_tempfile_pid_basedir().
| 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(), Rast__close_null(), and Rast_put_reclass().
| 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 125 of file file_name.c.
References GPATH_MAX, name, and NULL.
Referenced by G_make_mapset_element_tmp(), G_make_mapset_object_group_tmp(), and Vect__get_element_path().
Check if color rule is defined.
| name | color rule name |
Definition at line 246 of file gis/color_rules.c.
References AMI_STREAM< T >::name(), name, and NULL.
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 62 of file find_etc.c.
References name.
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@mapset) 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 186 of file find_file.c.
Referenced by G_find_raster(), G_find_vector(), I_find_signature(), IL_output_2d(), IL_resample_output_2d(), and S_read().
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 234 of file find_file.c.
Referenced by G_find_raster2(), G_find_vector2(), G_get_3dview(), Gs_load_3dview(), I_find_group(), I_find_group2(), I_find_signature2(), IL_resample_output_2d(), 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 257 of file find_file.c.
References name.
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(), Rast_read_range(), and Rast_read_rstats().
| 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 208 of file find_file.c.
References name.
Referenced by Rast3d_mask_file_exists().
Find given key (case sensitive)
| key | key to be found |
| kv | pointer to Key_value structure |
Definition at line 85 of file key_value1.c.
References Key_Value::key, and NULL.
Referenced by G_compare_projections(), G_get_datumparams_from_projinfo(), G_get_projinfo(), G_get_projsrid(), G_lookup_key_value_from_file(), GPJ__get_datum_params(), GPJ__get_ellipsoid_params(), GPJ_grass_to_osr(), GPJ_grass_to_osr2(), GPJ_osr_to_grass(), pj_get_kv(), Rast3d_key_get_double(), Rast3d_key_get_int(), Rast3d_key_get_string(), Rast3d_key_get_value(), Rast__check_fp_type(), Rast_get_gdal_link(), and Vect_close().
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(), G_find_file(), and name.
Referenced by I_iclass_init_group(), I_insert_patch_to_cat_rast(), Rast_get_cellhd(), Rast_get_vrt(), and Rast_read_colors().
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(), G_find_file2(), and name.
Referenced by G_check_input_output_name(), Gs_build_256lookup(), Gs_get_cat_label(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), Gs_numtype(), Gs_pack_colors(), Gs_pack_colors_float(), gsd_put_legend(), I_compute_scatts(), IL_create_bitmask(), M_do_remove(), M_do_rename(), Rast__check_for_auto_masking(), Rast__check_fp_type(), Rast__open_null_write(), Rast__open_old(), Rast_get_gdal_link(), Rast_get_vrt(), Rast_map_is_fp(), Rast_map_to_img_str(), Rast_map_type(), and Rast_mask_is_present().
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(), and name.
Referenced by Gvl_load_colors_data(), M_do_remove(), M_do_rename(), N_read_rast3d_to_array_3d(), open_g3d_file(), and Rast3d_read_region_map().
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(), GV_DIRECTORY, and name.
Referenced by Vect_read_colors().
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(), GV_DIRECTORY, and name.
Referenced by Gp_load_sites(), Gp_load_sites_thematic(), Gv_load_vect(), Gv_load_vect_thematic(), M_do_remove(), M_do_rename(), Vect__open_old(), Vect_check_input_output_name(), Vect_copy(), and Vect_rename().
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.
References _, err(), fdopen, G_debug(), G_mapset(), G_warning(), name, and NULL.
Definition at line 222 of file open_misc.c.
References _, err(), fdopen, G_mapset(), G_warning(), and name.
Referenced by I_fopen_group_file_append(), and I_fopen_subgroup_file_append().
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 313 of file gis/open.c.
References _, err(), fdopen, G_debug(), G_mapset(), G_warning(), name, and NULL.
Referenced by V1_open_new_nat(), V1_open_old_nat(), and Vect__open_old().
Definition at line 240 of file open_misc.c.
References _, err(), fdopen, G_mapset(), G_warning(), and 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 221 of file gis/open.c.
References fdopen, G_debug(), G_mapset(), and name.
Referenced by G_put_3dview(), G_put_element_window(), G_write_vector_timestamp(), I_put_group(), Rast__quant_export(), Rast_put_cell_title(), Rast_put_cellhd(), Rast_write_colors(), Rast_write_history(), V1_open_new_nat(), Vect__write_head(), Vect_cidx_save(), Vect_save_frmt(), Vect_save_topo(), Vect_write_colors(), and Vect_write_dblinks().
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.
| dir | |
| element | |
| name |
Definition at line 183 of file open_misc.c.
References fdopen, G_mapset(), and name.
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(), Rast_create_gdal_link(), and Rast_write_range().
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.
References fdopen, G_debug(), name, and NULL.
Referenced by G__get_list_of_mapsets(), G_get_3dview(), G_get_element_window(), G_read_vector_timestamp(), I_get_group(), Rast__quant_import(), Rast__read_colors(), Rast_get_cell_title(), Rast_get_cellhd(), Rast_put_cell_title(), Rast_read_history(), S_read(), V1_open_old_nat(), Vect__open_old(), Vect__read_head(), Vect_cidx_open(), Vect_close(), Vect_open_fidx(), Vect_open_sidx(), 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.
| dir | |
| 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__quant_import(), Rast_get_gdal_link(), Rast_get_vrt(), Rast_is_reclassed_to(), Rast_read_histogram(), and Rast_read_range().
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 FALSE, G_lon_format(), PROJECTION_LL, and TRUE.
Referenced by G__write_Cell_head(), and G_get_3dview().
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 FALSE, G_lat_format(), PROJECTION_LL, and TRUE.
Referenced by G__write_Cell_head(), and G_get_3dview().
Resolution to ASCII.
Converts the double representation of the resolution to its ASCII representation (into buf).
| res | 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 FALSE, G_llres_format(), PROJECTION_LL, and TRUE.
Referenced by G__write_Cell_head(), and G__write_Cell_head3().
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 183 of file timestamp.c.
References TimeStamp::count, datetime_format(), TimeStamp::dt, and strcpy.
Referenced by G_write_timestamp().
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.
References G_create_key_value(), G_getl2(), G_set_key_value(), G_strip(), Key_Value::key, NULL, and Key_Value::value.
Referenced by G_read_key_value_file(), Rast_get_gdal_link(), and Vect_close().
Free allocated memory.
| [in,out] | buf | buffer holding original data |
Definition at line 147 of file gis/alloc.c.
References free().
Referenced by AS_class_discont(), AS_class_equiprob(), Cairo_end_raster(), cairo_read_ppm(), Cairo_Text(), Cairo_text_box(), cairo_write_ppm(), check_create_export_opts(), check_create_import_opts(), close_band_files(), COM_Set_encoding(), D_open_driver(), db_CatValArray_free(), db_d_append_error(), db_read_dbmscap(), db_select_CatValArray(), db_select_int(), db_select_value(), destroy_si_struct(), dig__frealloc(), dig_cidx_free(), dig_file_free(), dig_file_load(), 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(), dig_spidx_free_areas(), dig_spidx_free_isles(), dig_spidx_free_lines(), dig_spidx_free_nodes(), dig_spidx_init(), err(), f_median(), f_mode(), f_nmedian(), f_nmode(), fft(), find_all_intersections(), font_init_freetype(), free_datum_list(), free_ellps_list(), free_fontcap(), free_perimeters(), free_slice_buff(), free_vol_buff(), free_volfile_buffs(), G__json(), G__md_print_python_short_version(), G__read_Cell_head(), G__usage_xml(), G__wps_print_process_description(), G_bz2_compress(), G_free_fmatrix(), G_free_fvector(), G_free_ilist(), G_free_imatrix(), G_free_ivector(), G_free_key_value(), G_free_list(), G_free_matrix(), G_free_tokens(), G_free_vector(), G_get_available_mapsets(), G_get_projsrid(), G_get_projwkt(), G_init_ilist(), G_list(), G_ls(), G_ls_regex_filter(), G_lz4_compress(), G_math_egvorder(), G_math_free_spmatrix(), G_math_free_spvector(), G_math_solver_gs(), G_math_solver_jacobi(), G_math_solver_lu(), G_math_solver_sparse_gs(), G_math_solver_sparse_jacobi(), G_matrix_eigen_sort(), G_matrix_free(), G_matrix_LU_solve(), G_plot_area(), G_putenv(), G_rc_path(), G_read_compressed(), G_set_key_value(), G_set_program_name(), G_str_concat(), G_vector_free(), G_write_compressed(), G_zlib_compress(), G_zstd_compress(), get_pj_area(), gk_free_key(), gk_make_framesfromkeys(), gk_make_linear_framesfromkeys(), gp_free_site(), gp_free_sitemem(), Gp_load_sites(), Gp_load_sites_thematic(), GPJ__get_ellipsoid_params(), GPJ_free_datum(), GPJ_free_datum_transform(), GPJ_free_ellps(), GPJ_grass_to_osr(), GPJ_init_transform(), GPJ_osr_to_grass(), GPJ_set_csv_loc(), GPJ_transform_array(), GS_coordpair_repeats(), gs_free_surf(), Gs_get_cat_label(), gs_init_normbuff(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), gs_malloc_lookup(), Gs_pack_colors(), Gs_pack_colors_float(), gs_set_att_src(), GS_write_ppm(), GS_write_tif(), gsd_put_legend(), gsd_wall(), gsds_free_datah(), gv_free_vect(), gv_free_vectmem(), Gv_load_vect(), gvd_vect(), gvl_align_data(), gvl_file_free_datah(), gvl_file_set_mode(), gvl_free_vol(), gvl_isosurf_calc(), GVL_isosurf_del(), gvl_isosurf_freemem(), Gvl_load_colors_data(), GVL_slice_del(), gvl_slice_freemem(), Gvl_unload_colors_data(), gvld_isosurf(), html_polygon(), HTML_Text(), I_alloc_double3(), I_create_cat_rast(), I_free(), I_free_double2(), I_free_double3(), I_free_int2(), I_free_signatures_list(), I_iclass_free_statistics(), I_insert_patch_to_cat_rast(), I_rasterize(), I_sc_free_cats(), I_signatures_copy(), I_sort_signatures_by_semantic_label(), I_SortSigSetBySemanticLabel(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_resample_interp_segments_2d(), kdtree_destroy(), line_check_intersection2(), M_do_copy(), make_perimeter(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_free_array_2d(), N_free_array_3d(), 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_gwflow_data2d(), N_free_gwflow_data3d(), N_free_les(), N_free_solute_transport_data2d(), N_free_solute_transport_data3d(), N_gwflow_2d_calc_water_budget(), N_gwflow_3d_calc_water_budget(), N_init_geom_data_2d(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), N_read_rast_to_array_2d(), N_write_array_2d_to_rast(), NetA_articulation_points(), NetA_betweenness_closeness(), NetA_compute_bridges(), NetA_eigenvector_centrality(), NetA_find_path(), NetA_flow(), NetA_min_cut(), NetA_spanning_tree(), NetA_strongly_connected_components(), NetA_timetable_result_release(), NetA_weakly_connected_components(), Nviz_delete_scalebar(), Nviz_destroy_data(), Nviz_destroy_render_window(), Nviz_draw_all_site(), Nviz_draw_all_surf(), Nviz_draw_all_vol(), Nviz_get_exag(), Nviz_get_exag_height(), Nviz_new_fringe(), Nviz_new_map_obj(), Nviz_set_arrow(), Nviz_set_focus_map(), Nviz_set_fringe(), Nviz_set_scalebar(), path_free(), pg_destroy_struct(), pj_do_transform(), pj_get_kv(), pj_get_string(), PNG_Graph_close(), Rast__check_for_auto_masking(), Rast__close_null(), Rast__color_free_fp_lookup(), Rast__color_free_lookup(), Rast__color_free_rules(), Rast__create_window_mapping(), Rast__open_null_write(), Rast__open_old(), Rast__quant_import(), 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_null_value_row(), Rast_get_reclass(), Rast_get_row_colors(), Rast_get_sample_bilinear(), Rast_get_sample_cubic(), Rast_get_sample_nearest(), Rast_get_vrt_row(), Rast_map_to_img_str(), Rast_put_cell_title(), Rast_put_reclass(), Rast_quant_add_rule(), Rast_quant_free(), Rast_read_color_rules(), Rast_read_fp_range(), Rast_read_range(), Rast_read_rstats(), Rast_set_d_cat(), Rast_set_history(), Rast_sort_cats(), read_pgm(), read_png(), Segment_close(), Segment_release(), set_proj_share(), tgis_free_map_list(), tgis_init_map_list(), tgis_set_default_connection(), V1_close_nat(), V1_close_ogr(), V1_close_pg(), V1_open_old_nat(), V2__update_area_pg(), V2_open_old_ogr(), V2_rewrite_line_pg(), Vect__close_cursor_pg(), Vect__copy_areas(), Vect__free_cache(), Vect__free_offset(), Vect__insert_face_pg(), Vect__read_head(), Vect__write_head(), Vect_add_dblink(), Vect_break_polygons_file(), Vect_build_ogr(), Vect_build_partial(), Vect_build_pg(), Vect_build_sidx_from_topo(), Vect_cat_list_to_array(), Vect_cats_set_constraint(), Vect_cidx_open(), Vect_close(), Vect_copy_map_lines_field(), Vect_copy_table_by_cat_list(), Vect_copy_tables(), Vect_default_field_info(), Vect_destroy_boxlist(), Vect_destroy_cat_list(), Vect_destroy_cats_struct(), Vect_destroy_field_info(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_destroy_map_struct(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_get_finfo_dsn_name(), Vect_get_finfo_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_map_box1(), Vect_line_intersection2(), Vect_new_varray(), Vect_open_fidx(), Vect_read_area_geos(), Vect_read_ascii(), Vect_read_line(), Vect_read_next_line(), Vect_rename(), Vect_set_comment(), Vect_set_date(), Vect_set_map_date(), Vect_set_map_name(), Vect_set_organization(), Vect_set_person(), Vect_set_varray_from_db(), Vect_sfa_get_num_features(), Vect_snap_line(), Vect_subst_var(), Vect_topo_dump(), Vect_write_ascii(), Vedit_move_vertex(), write_pgm(), and write_png().
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().
Referenced by Rast_close_vrt().
Free allocated Key_Value structure.
| [in] | kv | Key_Value structure to be freed |
Definition at line 104 of file key_value1.c.
References G_free().
Referenced by G_get_ellipsoid_parameters(), G_get_projinfo(), G_get_projsrid(), G_lookup_key_value_from_file(), G_update_key_value_file(), GPJ_get_datum_params(), GPJ_get_ellipsoid_params(), GPJ_osr_to_grass(), Rast3d_read_header(), Rast3d_read_window(), Rast3d_write_header(), Rast__check_fp_type(), and Rast_create_gdal_link().
Free list.
| list | char* array to be freed |
Definition at line 249 of file gis/list.c.
References G_free().
Definition at line 267 of file ls_filter.c.
Free memory allocated to tokens.
Note: G_free_tokens() must be called when finished with tokens to release memory.
| [out] | tokens |
Definition at line 197 of file gis/token.c.
References G_free(), and NULL.
Referenced by check_create_export_opts(), check_create_import_opts(), G_get_window(), G_parser(), GPJ_grass_to_osr2(), V1_close_ogr(), and Vect__open_cursor_next_line_pg().
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 _, err(), and G_fatal_error().
Referenced by dfread_header(), dfwrite_header(), dig_file_load(), dig_fseek(), G__read_Cell_head(), G_get_element_window(), IL_output_2d(), IL_resample_output_2d(), IL_write_temp_2d(), new_dspf(), open_stream(), Rast__read_colors(), Rast_put_reclass(), read_cube(), reset_reads(), AMI_STREAM< T >::seek(), AMI_STREAM< T >::stream_len(), Vect__open_old(), Vect_hist_copy(), and Vect_open_fidx().
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(), G_get_element_window(), AMI_STREAM< T >::read_array(), read_cube(), AMI_STREAM< T >::read_item(), AMI_STREAM< T >::stream_len(), Vect_hist_copy(), AMI_STREAM< T >::write_array(), and AMI_STREAM< T >::write_item().
Get fully qualified element name.
Returns a fully qualified name for GIS element name in mapset. Currently this string is in the form name@mapset, 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, GNAME_MAX, and name.
Referenced by Gp_load_sites(), Gp_load_sites_thematic(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), Gs_pack_colors(), Gs_pack_colors_float(), Gv_load_vect(), Gv_load_vect_thematic(), I_signatures_copy(), M_do_copy(), Rast__check_fp_type(), Rast__open_old(), Rast__quant_import(), Rast_map_is_fp(), Rast_mask_name(), Rast_put_reclass(), Rast_quantize_fp_map(), Rast_read_fp_range(), Rast_read_range(), and Rast_read_rstats().
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().
Referenced by G_write_key_value_file(), and Rast_create_gdal_link().
| char * G_generate_basename | ( | const char * | basename, |
| double | number, | ||
| size_t | ndigits, | ||
| size_t | ndecimals | ||
| ) |
Generate the format string.
| basename | String with the basename |
| number | The double number that will be converted to string |
| ndigits | The number of integer digits in the output string |
| ndecimals | The number of decimals in the output string |
Definition at line 163 of file basename.c.
References G_double_to_basename_format(), G_get_basename_separator(), and G_malloc.
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.
| [in] | lon1,lat1 | longitude,latitude of first point |
| [in] | lon2,lat2 | longitude,latitude of second point |
Definition at line 193 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(), and Vect_line_geodesic_length().
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().
| [in] | lon1 | first longitude |
| [in] | lon2 | second longitude |
Definition at line 119 of file geodist.c.
References M_PI, Radians, t, and x.
Referenced by G_geodesic_distance().
Definition at line 78 of file geodesic.c.
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 239 of file view.c.
References _, G_find_file2(), G_fopen_old(), G_format_easting(), G_format_northing(), G_get_3dview_defaults(), G_get_set_window(), G_projection(), G_warning(), NULL, and REQ_KEYS.
Referenced by Gs_load_3dview().
Sets default for v based on w.
| [in,out] | v | |
| [in] | w |
Definition at line 56 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, strcpy, G_3dview::surfonly, G_3dview::twist, G_3dview::vwin, Cell_head::west, and Cell_head::zone.
Referenced by G_get_3dview(), and Gs_save_3dview().
Get list of available mapsets for current location.
List is updated by each call to this function.
Definition at line 147 of file mapset_nme.c.
References AMI_STREAM< T >::AMI_STREAM(), UntypedStream::buf, closedir(), G_calloc, G_debug(), G_free(), G_location_path(), G_realloc, G_stat(), G_store(), GPATH_MAX, NULL, opendir(), and readdir().
Return the environmental basename variable or the default value.
return pointer to basename separator
Definition at line 110 of file basename.c.
References GBASENAME_SEP, and NULL.
Referenced by G_generate_basename(), and G_join_basename_strings().
Definition at line 43 of file gis/datum.c.
References G_read_datum_table(), G_strcasecmp(), AMI_STREAM< T >::name(), and name.
| int G_get_datumparams_from_projinfo | ( | const struct Key_Value * | projinfo, |
| char * | datumname, | ||
| char * | params | ||
| ) |
Definition at line 107 of file gis/datum.c.
References G_find_key_value(), and NULL.
Referenced by G_database_datum_name().
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 99 of file get_window.c.
References G_get_element_window().
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 114 of file get_window.c.
References _, G__read_Cell_head(), G_fatal_error(), G_fopen_old(), G_fseek(), G_ftell(), G_zero(), and name.
Referenced by G_get_default_window(), and G_get_window().
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 104 of file get_ellipse.c.
References G_read_ellipsoid_table(), G_strcasecmp(), AMI_STREAM< T >::name(), and name.
Referenced by G_compare_projections().
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 66 of file get_ellipse.c.
References access, G_file_name(), G_free_key_value(), G_read_key_value_file(), GPATH_MAX, NULL, PERMANENT, and PROJECTION_FILE.
Referenced by G_begin_cell_area_calculations(), G_begin_distance_calculations(), G_begin_polygon_area_calculations(), and G_database_ellipse_name().
Get variable name for index n.
For example:
| n | index of variable |
Definition at line 546 of file env.c.
References G_VAR_GISRC, AMI_STREAM< T >::name(), and NULL.
Get info where variables are stored.
Definition at line 73 of file env.c.
Referenced by db_start_driver().
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(), NULL, and UntypedStream::path.
Referenced by G_list_element(), and I_signatures_list_by_type().
Get number of decimals from a string.
| str | String to analyse |
Definition at line 54 of file basename.c.
References NULL.
Get overwrite value.
Definition at line 959 of file parser.c.
References st.
Referenced by V1_open_new_ogr(), and V1_open_new_pg().
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 access, 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(), G_get_projsrid(), and Rast_create_gdal_link().
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 _, access, 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(), GPJ_get_ellipsoid_params(), and Rast_create_gdal_link().
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():
Definition at line 235 of file get_projinfo.c.
References _, access, EPSG_FILE, G_asprintf(), G_chop(), G_debug(), G_fatal_error(), G_file_name(), G_find_key_value(), G_free(), G_free_key_value(), G_get_projepsg(), G_location(), G_malloc, G_projection(), G_realloc, GPATH_MAX, Key_Value::nalloc, NULL, PROJECTION_XY, and SRID_FILE.
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 _, access, G_file_name(), G_location(), G_projection(), G_read_key_value_file(), G_warning(), GPATH_MAX, NULL, PERMANENT, PROJECTION_XY, and UNIT_FILE.
Referenced by Rast_create_gdal_link().
Get WKT information for the current location.
Definition at line 126 of file get_projinfo.c.
References _, access, G_chop(), G_debug(), G_fatal_error(), G_file_name(), G_free(), G_location(), G_malloc, G_projection(), G_realloc, GPATH_MAX, Key_Value::nalloc, NULL, PROJECTION_XY, and WKT_FILE.
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.
References G__init_window(), and G__::window.
Referenced by D_setup(), G_begin_cell_area_calculations(), G_get_3dview(), G_projection(), G_setup_plot(), G_zone(), get_pj_area(), Gp_load_sites(), GS_get_to_real(), GS_libinit(), GS_set_focus_real(), Gv_load_vect(), I_iclass_analysis(), N_init_geom_data_2d(), N_init_geom_data_3d(), N_read_rast_to_array_2d(), N_write_array_2d_to_rast(), and P_estimate_splinestep().
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 153 of file get_ellipse.c.
References G_read_ellipsoid_table(), G_strcasecmp(), AMI_STREAM< T >::name(), and name.
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 260 of file timestamp.c.
References TimeStamp::count, count, datetime_copy(), and TimeStamp::dt.
Get localized units name.
Units codes (gis.h):
| units | units code |
| plural | plural form if true |
| square | area units if true |
Definition at line 202 of file units.c.
References _, G_database_unit_name(), G_get_units_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(), G_get_units_name(), Rast3d_get_vertical_unit(), and Rast3d_print_header().
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.
References G__read_Cell_head_array(), G_free_tokens(), G_get_element_window(), G_initialize_done(), G_is_initialized(), G_mapset(), G_tokenize(), GNAME_MAX, G__::window, and G__::window_set.
Referenced by G__calloc(), G__init_window(), G__malloc(), G__realloc(), G_point_in_region(), P_set_dim(), P_set_regions(), Rast3d_read_window(), and Vect_write_ascii().
Get environment variable.
G_fatal_error() is called when variable is not found.
| name | variable name |
Definition at line 360 of file env.c.
References _, G_fatal_error(), G_getenv_nofatal(), name, and NULL.
Referenced by db_driver(), G_gisbase(), G_gisdbase(), and G_location().
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 386 of file env.c.
References _, G_fatal_error(), G_getenv_nofatal2(), name, and NULL.
Get environment variable.
| name | variable name |
Definition at line 405 of file env.c.
References G_VAR_GISRC, and name.
Referenced by D_open_driver(), db_start_driver(), dig_angle_next_line(), dig_area_add_isle(), dig_build_area_with_line(), dig_file_load(), G__mapset(), G_check_overwrite(), G_define_standard_option(), G_getenv(), G_init_debug(), G_parser(), Vect_line_intersection(), Vect_line_intersection2(), and Vect_select_areas_by_box().
Get environment variable from specific place.
| name | variable name |
| loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 424 of file env.c.
References name.
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().
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.
| buf | string buffer to receive read data |
| n | maximum number of bytes to read |
| fd | file descriptor structure |
Definition at line 33 of file getl.c.
References G_getl2().
Referenced by G__read_Cell_head(), G_matrix_read(), G_myname(), M_read_list(), Rast__read_history(), Rast_get_cell_title(), and Rast_put_cell_title().
Gets a line of text from a file of any pedigree.
This routine 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 bytes must be allocated for the string buffer.
| buf | string buffer to receive read data, at least n bytes must be allocated |
| n | maximum number of bytes to read |
| fd | file descriptor structure |
Definition at line 60 of file getl.c.
References NULL.
Referenced by dig_read_frmt_ascii(), G_fread_key_value(), G_getl(), G_read_datum_table(), G_read_ellipsoid_table(), GPJ_get_datum_transform_by_name(), I_get_group_title(), Rast_get_vrt(), Rast_put_reclass(), Rast_read_color_rule(), read_coor(), read_datum_table(), read_ellipsoid_table(), S_read(), Vect__read_head(), Vect_hist_read(), Vect_read_ascii(), and Vect_read_ascii_head().
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 39 of file gisbase.c.
References G_getenv().
Referenced by db_read_dbmscap(), G_read_datum_table(), G_read_ellipsoid_table(), GPJ_get_datum_transform_by_name(), GPJ_osr_to_grass(), GPJ_set_csv_loc(), M_read_list(), parse_fontcap(), read_datum_table(), read_ellipsoid_table(), and S_read().
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_location(), G_make_mapset(), G_write_projsrid(), G_write_projwkt(), Vect__open_old(), and Vect_hist_command().
Check if timestamp for 3D raster map exists.
| name | map name |
| mapset | mapset name |
Definition at line 576 of file timestamp.c.
References G_find_file2_misc(), GRID3, and name.
Check if timestamp for raster map exists.
| name | map name |
| mapset | mapset name |
Definition at line 356 of file timestamp.c.
References G_find_file2_misc(), name, and RAST_MISC.
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 422 of file timestamp.c.
References access, G_debug(), G_file_name(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, name, NULL, and R_OK.
Referenced by G_read_vector_timestamp().
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().
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 78 of file ilist.c.
References G_realloc.
Referenced by Rast_get_vrt(), Vect_merge_lines(), Vect_snap_lines(), and Vedit_merge_lines().
Get current message format.
Maybe set to either "standard" or "gui" (normally GRASS takes care)
Definition at line 540 of file gis/error.c.
References G_init_logging().
Referenced by G_clicker(), G_percent(), and G_progress().
Initialize environment.
Definition at line 191 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().
Definition at line 38 of file counter.c.
References Counter::value.
Referenced by G_init_logging(), and G_init_tempfile().
Initiate debugging.
Definition at line 27 of file debug.c.
References G_getenv_nofatal(), G_initialize_done(), G_is_initialized(), and NULL.
Referenced by G_debug(), and G_init_all().
Initialize variables.
Definition at line 83 of file env.c.
References G_VAR_GISRC, and G_VAR_MAPSET.
Referenced by G_init_all().
Init an integer list and free allocated memory.
| list | The pointer to an integer list |
Definition at line 58 of file ilist.c.
References G_free(), and NULL.
Referenced by G_new_ilist(), and RTreeSearch2().
Definition at line 355 of file gis/error.c.
References _, G__home(), G_INFO_FORMAT_GUI, G_INFO_FORMAT_PLAIN, G_INFO_FORMAT_SILENT, G_INFO_FORMAT_STANDARD, G_init_counter(), G_initialize_done(), G_is_initialized(), G_store(), G_strcasecmp(), and GPATH_MAX.
Referenced by G_info_format(), and G_init_all().
Initialize environment for creating tempfiles.
Definition at line 29 of file tempfile.c.
References G_init_counter(), G_initialize_done(), and G_is_initialized().
Referenced by G_init_all(), G_tempfile_pid(), and G_tempfile_pid_basedir().
Initialize timestamp structure.
| ts | pointer to TimeStamp structure |
Definition at line 95 of file timestamp.c.
References TimeStamp::count.
Referenced by G_scan_timestamp().
Definition at line 77 of file counter.c.
Referenced by G__home(), G__init_window(), G__machine_name(), G_config_path(), G_date(), G_get_window(), G_init_debug(), G_init_locale(), G_init_logging(), G_init_tempfile(), G_read_datum_table(), G_read_ellipsoid_table(), G_set_verbose(), G_verbose(), G_whoami(), Rast__init(), Rast__init_window(), Rast_create_gdal_link(), and Rast_init_gdal().
Inserts commas into a number string.
Examples:
Note: Does not work with negative numbers.
| [in,out] | buf | string |
Definition at line 35 of file commas.c.
References G_strlcpy().
| int G_intersect_line_segments | ( | double | ax1, |
| double | ay1, | ||
| double | ax2, | ||
| double | ay2, | ||
| double | bx1, | ||
| double | by1, | ||
| double | bx2, | ||
| double | by2, | ||
| double * | ra, | ||
| double * | rb, | ||
| double * | x, | ||
| double * | y | ||
| ) |
Definition at line 84 of file gis/intersect.c.
References D, D1, D2, SWAP, and x.
Referenced by G_distance_between_line_segments(), and G_distance_point_to_line_segment().
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().
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.
References GRASS_DIRSEP, and HOST_DIRSEP.
Referenced by G_is_absolute_path(), G_parser(), and G_set_program_name().
Definition at line 60 of file counter.c.
Referenced by G__home(), G__init_window(), G__machine_name(), G_config_path(), G_date(), G_get_window(), G_init_debug(), G_init_locale(), G_init_logging(), G_init_tempfile(), G_read_datum_table(), G_read_ellipsoid_table(), G_set_verbose(), G_verbose(), G_whoami(), Rast__init(), Rast__init_window(), Rast_create_gdal_link(), and Rast_init_gdal().
Check if given mapset is in search path.
| mapset | mapset name |
Definition at line 217 of file mapset_nme.c.
References AMI_STREAM< T >::AMI_STREAM(), and UntypedStream::path.
Referenced by G_add_mapset_to_search_path().
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 127 of file basename.c.
References G_get_basename_separator(), G_malloc, and strcpy.
Definition at line 40 of file ll_format.c.
References G_lat_parts().
Referenced by G_adjust_window_ll(), and G_format_northing().
Definition at line 50 of file ll_format.c.
Definition at line 116 of file ll_format.c.
Referenced by G_lat_format(), and G_llres_format().
Definition at line 45 of file ll_scan.c.
References LL_TOLERANCE.
Referenced by G_adjust_window_ll(), and G_scan_northing().
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.
References _, G_warning(), and name.
Referenced by G_check_input_output_name(), G_make_location(), G_make_mapset(), and Rast_legal_semantic_label().
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 32 of file wind_limits.c.
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 68 of file wind_limits.c.
References PROJECTION_LL.
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 96 of file wind_limits.c.
References PROJECTION_LL.
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 51 of file wind_limits.c.
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 173 of file gis/list.c.
References _, closedir(), count, G_calloc, G_ELEMENT_GROUP, G_ELEMENT_RASTER, G_ELEMENT_REGION, G_ELEMENT_VECTOR, G_fatal_error(), G_free(), G_malloc, NULL, opendir(), readdir(), rewinddir(), and strcpy.
Print color rules.
| out | file where to print |
Definition at line 175 of file gis/color_rules.c.
References 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.
References AMI_STREAM< T >::name(), name, and NULL.
| void G_list_element | ( | const char * | element, |
| const char * | desc, | ||
| const char * | mapset, | ||
| int(*)(const char *, const char *, 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 51 of file gis/list.c.
References _, count, G_close_pager(), G_get_mapset_name(), and G_open_pager().
Referenced by M_do_list().
Definition at line 70 of file ll_format.c.
References G_lat_parts().
Referenced by G_adjust_window_ll(), and G_format_resolution().
Definition at line 81 of file ll_format.c.
Definition at line 55 of file ll_scan.c.
Referenced by G_adjust_window_ll(), and G_scan_resolution().
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_projsrid(), G_get_projunits(), G_get_projwkt(), G_make_mapset(), I_location_info(), Vect__open_old(), and Vect_hist_command().
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 _, access, F_OK, G__location_path(), and G_fatal_error().
Referenced by db_set_default_connection(), G__gisinit(), and G_get_available_mapsets().
Definition at line 55 of file ll_format.c.
References G_lon_parts().
Referenced by G_adjust_window_ll(), and G_format_easting().
Definition at line 65 of file ll_format.c.
Definition at line 132 of file ll_format.c.
Referenced by G_lon_format().
Definition at line 50 of file ll_scan.c.
References LL_TOLERANCE.
Referenced by G_adjust_window_ll(), and G_scan_easting().
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.
References file, G_find_key_value(), G_free_key_value(), G_read_key_value_file(), Key_Value::key, and Key_Value::value.
Referenced by GPJ_osr_to_grass().
Generate an integer in the range [0, 2^31)
Definition at line 133 of file lrand48.c.
References r.
Referenced by Rast_make_random_colors().
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().
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 94 of file ls.c.
References _, closedir(), G_fatal_error(), G_realloc, G_store(), NULL, opendir(), and readdir().
Referenced by G_ls(), and list_subgroups().
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 AMI_STREAM< T >::AMI_STREAM(), max, and screen_width.
Referenced by G_ls().
Definition at line 233 of file ls_filter.c.
References G_ls_regex_filter(), init(), and NULL.
Definition at line 173 of file ls_filter.c.
References G_free(), G_malloc, G_set_ls_exclude_filter(), G_set_ls_filter(), and NULL.
Referenced by G_ls_glob_filter().
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 |
| buf | pointer to structure filled with file information |
Definition at line 145 of file paths.c.
Referenced by G_recursive_copy(), G_recursive_remove(), and list_subgroups().
Definition at line 78 of file cmprlz4.c.
References _, err(), G_calloc, G_free(), G_lz4_compress_bound(), G_warning(), LZ4_compress_default(), and NULL.
Definition at line 146 of file cmprlz4.c.
References _, err(), G_warning(), LZ4_decompress_safe(), and NULL.
| 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.
References G_file_name(), G_gisdbase(), G_legal_filename(), G_mkdir(), G_put_element_window(), G_setenv_nogisrc(), G_write_key_value_file(), GPATH_MAX, and NULL.
Referenced by G_make_location_crs(), and G_make_location_epsg().
| 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_srid | Spatial reference ID suitable to write to the PROJ_SRID file, or NULL. |
| proj_wkt | WKT definition suitable to write to the PROJ_WKT file, or NULL. |
Definition at line 183 of file make_loc.c.
References G_make_location(), G_write_projsrid(), G_write_projwkt(), and NULL.
| 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.
References G_file_name(), G_make_location(), G_write_key_value_file(), GPATH_MAX, and NULL.
| 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 _, access, F_OK, 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.
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 109 of file mapset_msc.c.
References G_file_name(), G_make_mapset_object_group(), G_mapset(), GPATH_MAX, name, and NULL.
Referenced by G__make_mapset_element_misc(), Rast3d_make_mapset_map_directory(), and Vect_copy().
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 45 of file mapset_msc.c.
References G_file_name(), G_mapset(), GPATH_MAX, and NULL.
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 132 of file mapset_msc.c.
References G_file_name_tmp(), G_mapset(), GPATH_MAX, and NULL.
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 75 of file mapset_msc.c.
References G_file_name(), G_mapset(), GPATH_MAX, and NULL.
Referenced by db_set_default_connection(), G__temp_element(), G__temp_element_basedir(), G_make_mapset_dir_object(), I_make_signatures_dir(), M_do_copy(), and Rast__quant_export().
Create directory for type of objects in the temporary directory.
See G_file_name_basedir() for details.
| type | object type (e.g., cell) |
Definition at line 176 of file mapset_msc.c.
References G_file_name_basedir(), G_mapset(), GPATH_MAX, and NULL.
Referenced by G__temp_element_basedir().
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 154 of file mapset_msc.c.
References G_file_name_tmp(), G_mapset(), GPATH_MAX, and NULL.
Referenced by G__temp_element().
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(), create_raster(), D_open_driver(), db_set_default_connection(), fopen_group_file_old(), fopen_subgroup_file_old(), G__get_list_of_mapsets(), G__gisinit(), G_check_input_output_name(), G_fopen_append(), G_fopen_append_misc(), G_fopen_modify(), G_fopen_modify_misc(), G_fopen_new(), G_fopen_new_misc(), G_get_window(), G_make_mapset_dir_object(), G_make_mapset_element(), G_make_mapset_element_tmp(), G_make_mapset_object_group(), G_make_mapset_object_group_basedir(), G_make_mapset_object_group_tmp(), G_open_new(), G_open_new_misc(), G_open_update(), G_open_update_misc(), G_read_vector_timestamp(), G_rename(), G_tempfile_pid(), G_tempfile_pid_basedir(), 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(), I_signatures_copy(), I_signatures_remove(), I_signatures_rename(), IL_resample_output_2d(), M__empty(), M_do_copy(), M_do_remove(), M_do_rename(), main(), Rast3d_mask_file_exists(), Rast3d_mask_open_old(), Rast3d_open_cell_new(), Rast3d_write_colors(), Rast__close_null(), Rast__open_null_write(), Rast__quant_export(), Rast__quant_import(), Rast_mask_name(), Rast_put_cell_title(), Rast_put_reclass(), Rast_read_colors(), Rast_remove_colors(), Rast_short_history(), Rast_write_colors(), Rast_write_range(), V1_close_ogr(), Vect__delete(), Vect__open_old(), Vect_check_input_output_name(), Vect_close(), Vect_copy(), Vect_hist_command(), Vect_read_colors(), Vect_remove_colors(), Vect_rename(), Vect_save_fidx(), Vect_set_db_updated(), and Vect_write_colors().
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 _, access, F_OK, G__mapset_path(), and G_fatal_error().
Check for user mapset permission.
| mapset | mapset name |
Definition at line 292 of file mapset_msc.c.
References G_file_name(), G_stat(), GPATH_MAX, and S_ISDIR.
Referenced by G__get_list_of_mapsets(), and G__gisinit().
Check for user mapset permission.
| gisdbase | full path to GISDBASE |
| location | location name |
| mapset | mapset name |
Definition at line 321 of file mapset_msc.c.
References AMI_STREAM< T >::AMI_STREAM(), G_stat(), GPATH_MAX, and S_ISDIR.
Referenced by del2g(), G_done_msg(), G_math_solver_cholesky(), G_math_solver_gauss(), G_math_solver_gs(), G_math_solver_jacobi(), G_math_solver_lu(), G_math_solver_sparse_gs(), G_math_solver_sparse_jacobi(), G_matrix_print(), Gp_load_sites(), Gp_load_sites_thematic(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), Gs_pack_colors(), Gs_pack_colors_float(), Gv_load_vect(), Gv_load_vect_thematic(), GVL_load_vol(), I_compute_georef_equations_tps(), IL_create_bitmask(), IL_interp_segments_2d_parallel(), IL_vector_input_data_2d(), M_do_copy(), M_do_remove(), M_do_rename(), N_gwflow_2d_calc_water_budget(), N_gwflow_3d_calc_water_budget(), N_read_rast3d_to_array_3d(), N_read_rast_to_array_2d(), N_write_array_2d_to_rast(), N_write_array_3d_to_rast3d(), NetA_spanning_tree(), Rast_create_gdal_link(), show_colormode(), Vect__copy_areas(), Vect__open_old(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_nat(), Vect_build_ogr(), Vect_build_partial(), Vect_build_pg(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_remove_small_areas_ext(), Vect_remove_small_areas_nat(), and Vect_topo_check().
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 38 of file units.c.
References U_FEET, U_KILOMETERS, U_METERS, U_MILES, and U_USFEET.
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 88 of file units.c.
References U_ACRES, U_FEET, U_HECTARES, U_KILOMETERS, U_METERS, U_MILES, and U_USFEET.
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_location(), G_make_mapset(), G_recursive_copy(), and V1_close_nat().
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.
References _, G_fatal_error(), and O_ACCMODE.
Referenced by ami_single_temp_name(), and G_mkstemp_fp().
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.
Definition at line 161 of file mkstemp.c.
References fdopen, G_mkstemp(), NULL, and O_ACCMODE.
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).
Definition at line 105 of file mkstemp.c.
References NULL.
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 30 of file myname.c.
References _, G_file_name(), G_getl(), G_store(), GNAME_MAX, GPATH_MAX, name, and strcpy.
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@mapset, 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_check_input_output_name(), G_rename(), G_unqualified_name(), I_signatures_copy(), I_signatures_remove(), I_signatures_rename(), M_do_remove(), Rast3d_read_region_map(), Rast__quant_export(), Rast__quant_import(), Rast_remove_colors(), Rast_write_colors(), Vect__delete(), Vect__open_old(), Vect_check_input_output_name(), Vect_copy(), Vect_remove_colors(), Vect_rename(), and Vect_write_colors().
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, and NULL.
Referenced by Rast_get_vrt().
Definition at line 3 of file nl_to_spaces.c.
Referenced by Rast_set_cats_fmt(), Rast_set_cats_title(), and Rast_set_d_cat().
Definition at line 155 of file compress.c.
References NULL.
Definition at line 176 of file compress.c.
References NULL.
Get number of named colors (RGB triplets)
Definition at line 56 of file color_str.c.
Return number of tokens.
| tokens |
Definition at line 178 of file gis/token.c.
References NULL.
Referenced by G_set_keywords(), GPJ_grass_to_osr2(), and Vect__open_cursor_next_line_pg().
Definition at line 45 of file pager.c.
References G_popen_clear(), G_popen_write(), G_whoami(), and NULL.
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.
References G_mapset(), and 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.
| dir | |
| element | |
| name |
Definition at line 111 of file open_misc.c.
References G_mapset(), and name.
Referenced by Rast_write_fp_range(), and Rast_write_rstats().
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 169 of file gis/open.c.
References name.
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.
| dir | |
| element | |
| name | |
| mapset |
Definition at line 132 of file open_misc.c.
References name.
Referenced by Rast3d_open_cell_old_no_header(), Rast3d_read_range(), Rast__open_old(), Rast_read_fp_range(), and Rast_read_rstats().
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 1922 of file parser.c.
References _, G_fatal_error(), and NULL.
Definition at line 13 of file pager.c.
References G_popen_clear(), G_popen_write(), isatty, NULL, and STDOUT_FILENO.
Referenced by G_list_element().
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 189 of file gis/open.c.
References _, err(), G_mapset(), G_warning(), and 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.
| dir | |
| element | |
| name |
Definition at line 152 of file open_misc.c.
References _, err(), G_mapset(), G_warning(), and name.
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.
The last item of the list must be NULL.
| first | first given option |
Definition at line 380 of file parser_dependencies.c.
References RULE_COLLECTIVE.
Exclude selected options.
If the first option is present, none of the other options may also (should?) be present.
The last item of the list must be NULL.
| first | first given option |
Definition at line 349 of file parser_dependencies.c.
References RULE_EXCLUDES.
Sets the options to be mutually exclusive.
When running the module, at most one option from a set can be provided.
The last item of the list must be NULL.
| first | first given option |
Definition at line 214 of file parser_dependencies.c.
References RULE_EXCLUSIVE.
Sets the options to be required.
At least one option from a set must be given.
The last item of the list must be NULL.
| first | first given option |
Definition at line 242 of file parser_dependencies.c.
References RULE_REQUIRED.
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.
The last item of the list must be NULL.
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 278 of file parser_dependencies.c.
References RULE_REQUIRES.
Define additionally required options for an option.
If the first option is present, all the other options must also be present.
The last item of the list must be NULL.
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 318 of file parser_dependencies.c.
References RULE_REQUIRES_ALL.
Set generic option rule.
Supported rule types:
| type | rule type |
| nopts | number of options in the array |
| opts | array of options |
Definition at line 77 of file parser_dependencies.c.
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 1860 of file parser.c.
References _, G_debug(), G_fatal_error(), G_store(), and NULL.
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.
Referenced by recreate_command().
Get owner id of path.
Returns information about the specified file.
| path | path to check |
Definition at line 164 of file paths.c.
References _, AMI_STREAM< T >::AMI_STREAM(), G_fatal_error(), G_stat(), NULL, and TRUE.
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__check_option_rules(), G__has_required_rule(), G__json(), G__script(), G__usage_html(), G__usage_markdown(), G__usage_rest(), G__usage_text(), G__usage_xml(), G__wps_print_process_description(), G_asprintf(), G_basename(), G_calloc, G_chop(), G_fatal_error(), G_free_tokens(), G_getenv_nofatal(), G_is_dirsep(), G_malloc, G_realloc, G_store(), G_strcasecmp(), G_suppress_warnings(), G_tokenize(), G_usage(), G_verbose(), G_verbose_max(), G_verbose_min(), G_verbose_std(), G_warning(), isatty, NULL, st, strcpy, and TRUE.
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 61 of file percent.c.
References G_info_format(), G_INFO_FORMAT_PLAIN, G_INFO_FORMAT_SILENT, G_INFO_FORMAT_STANDARD, G_verbose(), st, and x.
Referenced by G_math_cholesky_sband_decomposition(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), Gs_pack_colors(), Gs_pack_colors_float(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_resample_interp_segments_2d(), N_gwflow_2d_calc_water_budget(), N_gwflow_3d_calc_water_budget(), N_read_rast3d_to_array_3d(), N_read_rast_to_array_2d(), N_write_array_2d_to_rast(), N_write_array_3d_to_rast3d(), NetA_betweenness_closeness(), NetA_spanning_tree(), P_Aux_to_Raster(), Rast3d_retile(), Vect__copy_areas(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_nat(), Vect_clean_small_angles_at_nodes(), Vect_merge_lines(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_remove_duplicates(), Vect_remove_small_areas_ext(), and Vect_remove_small_areas_nat().
Reset G_percent() to 0%; do not add newline.
Definition at line 117 of file percent.c.
References st.
Referenced by NetA_betweenness_closeness(), and NetA_spanning_tree().
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.
References x.
Referenced by G_area_of_polygon().
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 |
Definition at line 502 of file plot.c.
References G_calloc, G_free(), G_warning(), NO_MEMORY, NULL, OK, OUT_OF_SYNC, POINT, PROJECTION_LL, st, TOO_FEW_EDGES, W, x, X, and Y.
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 780 of file plot.c.
References G_plot_line(), and st.
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 208 of file plot.c.
Referenced by G_plot_fx().
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) |
Plot point.
| east | easting |
| north | northing |
Definition at line 189 of file plot.c.
References G_plot_where_xy(), st, and x.
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 |
Definition at line 372 of file plot.c.
References G_warning(), NO_MEMORY, OK, OUT_OF_SYNC, POINT, PROJECTION_LL, st, TOO_FEW_EDGES, W, x, X, and 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 160 of file plot.c.
References G_adjust_easting(), st, x, X, and Y.
Referenced by G_plot_point().
Returns TRUE if coordinate is within the current region settings.
| easting | |
| northing |
Definition at line 24 of file wind_in.c.
References G_get_window(), and G_point_in_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 46 of file wind_in.c.
References Cell_head::east, FALSE, Cell_head::north, Cell_head::south, TRUE, and Cell_head::west.
Referenced by G_point_in_region().
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.
References x.
Definition at line 56 of file popen.c.
References UntypedStream::fp, NULL, and state.
Referenced by G_open_mail(), and G_open_pager().
Definition at line 72 of file popen.c.
References UntypedStream::fp, G_wait(), and state.
Referenced by G_close_mail(), and G_close_pager().
Definition at line 62 of file popen.c.
References state.
Referenced by G_open_mail(), and G_open_pager().
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.
Referenced by G__json(), G__script(), G__usage_html(), G__usage_markdown(), G__usage_rest(), G__usage_xml(), G__wps_print_process_description(), G_done_msg(), Rast_short_history(), and recreate_command().
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 |
Definition at line 158 of file percent.c.
References G_info_format(), G_INFO_FORMAT_GUI, G_INFO_FORMAT_PLAIN, G_INFO_FORMAT_SILENT, and G_verbose().
Referenced by Vect_build_nat().
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_begin_distance_calculations(), G_begin_polygon_area_calculations(), G_database_projection_name(), G_database_unit(), G_get_3dview(), G_get_projepsg(), G_get_projinfo(), G_get_projsrid(), G_get_projunits(), G_get_projwkt(), G_shortest_way(), Rast__check_for_auto_masking(), Vect__open_old(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_read_ascii(), and Vect_set_constraint_region().
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().
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().
Saves info to a 3d.view file in the current mapset.
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] | View | |
| [in] | Win |
Definition at line 160 of file view.c.
References _, G_fopen_new(), G_warning(), and NULL.
Referenced by Gs_save_3dview().
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.
References G__write_Cell_head3(), G_fopen_new(), and name.
Referenced by G_make_location(), G_make_mapset(), and G_put_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.
References G_put_element_window().
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 288 of file user_config.c.
References AMI_STREAM< T >::AMI_STREAM(), assert, G_free(), G_realloc, NULL, and UntypedStream::path.
Definition at line 244 of file compress.c.
References _, b, err(), G_calloc, G_COMPRESSED_NO, G_COMPRESSED_YES, G_expand(), G_free(), G_warning(), NULL, and read.
Referenced by Rast3d_fpcompress_read_xdr_nums().
Definition at line 141 of file gis/datum.c.
References _, DATUMTABLE, file, G_getl2(), G_gisbase(), G_initialize_done(), G_is_initialized(), G_realloc, G_store(), G_strip(), G_warning(), GPATH_MAX, AMI_STREAM< T >::name(), name, and t.
Referenced by G_datum_description(), G_datum_ellipsoid(), G_datum_name(), G_get_datum_by_name(), and G_init_all().
Read ellipsoid table.
| fatal | non-zero value for G_fatal_error(), otherwise G_warning() is used |
Definition at line 246 of file get_ellipse.c.
References _, err(), file, G_fatal_error(), G_getl2(), G_gisbase(), G_initialize_done(), G_is_initialized(), G_realloc, G_store(), G_strip(), G_strlcat(), G_warning(), GPATH_MAX, n_, name, and NULL.
Referenced by G_ellipsoid_description(), G_ellipsoid_name(), G_get_ellipsoid_by_name(), G_get_spheroid_by_name(), and G_init_all().
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 55 of file key_value3.c.
References _, file, G_fatal_error(), and G_fread_key_value().
Referenced by G_get_ellipsoid_parameters(), G_get_projepsg(), G_get_projinfo(), G_get_projunits(), G_lookup_key_value_from_file(), G_update_key_value_file(), Rast3d_read_header(), Rast3d_read_window(), and Rast__check_fp_type().
Read timestamp from 3D raster map.
| name | map name | |
| mapset | mapset name | |
| [out] | ts | TimeStamp struct to populate |
Definition at line 594 of file timestamp.c.
Read timestamp from raster map.
| name | map name | |
| mapset | mapset the map lives in | |
| [out] | ts | TimeStamp struct to populate |
Definition at line 374 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 458 of file timestamp.c.
References _, G__read_timestamp(), G_debug(), G_fopen_old(), G_has_vector_timestamp(), G_mapset(), G_warning(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, name, and NULL.
Creates command to run non-interactive.
Creates a command-line that runs the current command completely non-interactive.
Definition at line 840 of file parser.c.
References FALSE, and recreate_command().
Referenced by D_open_driver(), Rast_command_history(), and Vect_hist_command().
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 69 of file copy_dir.c.
References AMI_STREAM< T >::AMI_STREAM(), UntypedStream::buf, close, closedir(), G_lstat(), G_mkdir(), G_recursive_copy(), GPATH_MAX, open, opendir(), read, readdir(), S_ISDIR, and write.
Referenced by G_recursive_copy(), I_signatures_copy(), M_do_copy(), and V1_close_nat().
Recursively remove all files in given directory.
Equivalent to rm -rf path.
| path | path to the directory which should be removed |
Definition at line 112 of file remove.c.
References AMI_STREAM< T >::AMI_STREAM(), closedir(), G_lstat(), G_recursive_remove(), GPATH_MAX, NULL, opendir(), readdir(), rmdir, and S_ISDIR.
Referenced by G_recursive_remove(), and V1_close_nat().
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 43 of file remove.c.
Referenced by G_remove_vector_timestamp(), I_signatures_remove(), M_do_copy(), M_do_remove(), M_do_rename(), Rast__quant_export(), Rast_remove_colors(), Rast_write_colors(), and Vect_remove_colors().
Removes commas from number string.
Examples:
| [in,out] | buf | string |
Definition at line 83 of file commas.c.
References b.
Remove existing error handler.
| func | handler to be remove |
| closure | pointer to closure data |
Definition at line 85 of file gis/handler.c.
References NULL.
Referenced by db_unset_error_handler_driver().
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 64 of file remove.c.
References name.
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().
Remove timestamp from 3D raster map.
Only timestamp files in current mapset can be removed.
| name | map name |
Definition at line 627 of file timestamp.c.
References G_remove_misc(), GRID3, and name.
Remove timestamp from raster map.
Only timestamp files in current mapset can be removed.
| name | map name |
Definition at line 407 of file timestamp.c.
References G_remove_misc(), name, and RAST_MISC.
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 553 of file timestamp.c.
References G_remove(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, and name.
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 69 of file rename.c.
References access, 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(), and Vect_rename().
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 31 of file rename.c.
References G_copy_file().
Referenced by G_rename(), I_signatures_rename(), PS_Graph_close(), and PS_Graph_set().
Reset number of mapsets.
Definition at line 135 of file mapset_nme.c.
References UntypedStream::path.
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 33 of file rotate.c.
References D2R.
Referenced by G_rotate_around_point_int(), and stroke_chain().
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 60 of file rotate.c.
References G_rotate_around_point(), and x.
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 |
Definition at line 505 of file aprintf.c.
References G_vsaprintf().
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 G_lon_scan(), and PROJECTION_LL.
Referenced by G__read_Cell_head_array(), and Vect_read_ascii().
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 G_lat_scan(), and PROJECTION_LL.
Referenced by G__read_Cell_head_array(), and Vect_read_ascii().
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] | res | resolution value |
| projection | projection code |
Definition at line 100 of file wind_scan.c.
References G_llres_scan(), and PROJECTION_LL.
Referenced by G__read_Cell_head_array().
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 217 of file timestamp.c.
References datetime_scan(), G_init_timestamp(), G_set_timestamp(), G_set_timestamp_range(), and t.
Referenced by G__read_timestamp().
Definition at line 8 of file gis/line_dist.c.
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 260 of file gis/error.c.
Sets geodesic distance lat1.
Set the first latitude.
Note: Must be called first.
| [in] | lat1 | first latitude |
Definition at line 67 of file geodist.c.
References Radians.
Referenced by G_geodesic_distance().
Sets geodesic distance lat2.
Set the second latitude.
Note: Must be called second.
| [in] | lat2 | second latitude |
Definition at line 81 of file geodist.c.
References Radians.
Referenced by G_geodesic_distance().
Set where to find/store variables.
Modes:
| mode | mode to find/store variables (G_GISRC_MODE_FILE by default) |
Definition at line 63 of file env.c.
Referenced by db_driver().
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 39 of file key_value1.c.
References G_free(), G_realloc, G_store(), Key_Value::key, NULL, and Key_Value::value.
Referenced by G_fread_key_value(), G_get_projinfo(), G_update_key_value_file(), GPJ_osr_to_grass(), Rast3d_key_set_double(), Rast3d_key_set_int(), Rast3d_key_set_string(), Rast3d_key_set_value(), and Rast_create_gdal_link().
Set keywords from the string.
| keywords | keywords separated by commas |
Definition at line 884 of file parser.c.
References G_number_of_tokens(), G_tokenize(), and st.
Referenced by G_ls_regex_filter().
Set the number of threads for OpenMP The intended usage is at the beginning of a C tool when parameters are processed, namely the G_OPT_M_NPROCS standard option.
If nprocs is set to 0, default OpenMP internal logic is used. If nprocs is a positive number, specified number of threads is used. If nprocs is a negative number, then maximum threads - number is used instead (e.g. to keep number of cores free for other use.
| opt | A nprocs Option struct to specify the number of threads |
Definition at line 24 of file omp_threads.c.
References _, G_fatal_error(), G_verbose_message(), G_warning(), n_, and NULL.
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.
References G_basename(), G_debug(), G_free(), G_is_dirsep(), G_store(), and name.
Referenced by G__gisinit().
Referenced by tgis_map_list_insert().
| void G_set_timestamp_range | ( | struct TimeStamp * | , |
| const struct DateTime * | , | ||
| const struct DateTime * | |||
| ) |
Referenced by tgis_map_list_insert().
Set verbosity level.
–q or –quiet flag.–v or –verbose flag.| level | new verbosity level (-1,0,1,2,3) |
Definition at line 125 of file verbose.c.
References G_initialize_done(), G_is_initialized(), MAXLEVEL, MINLEVEL, and st.
Referenced by Vect__open_old().
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.
References G_adjust_Cell_head(), G__::window, and G__::window_set.
Referenced by Rast_set_output_window().
Set environment variable (updates .gisrc)
If value is NULL, becomes an G_unsetenv().
| name | variable name |
| value | variable value |
Definition at line 442 of file env.c.
References G_VAR_GISRC, and name.
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 459 of file env.c.
References name.
Referenced by db_set_connection(), and tgis_set_connection().
Set environment name to value (doesn't update .gisrc)
| name | variable name |
| value | variable value |
Definition at line 472 of file env.c.
References G_VAR_GISRC, and name.
Referenced by db_driver(), G_check_overwrite(), G_make_location(), and G_make_mapset().
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 |
Definition at line 133 of file plot.c.
References st.
| 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 |
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 27 of file short_way.c.
References G_projection(), and PROJECTION_LL.
Definition at line 11 of file sleep.c.
Referenced by dig_falloc(), dig_frealloc(), G__check_gisinit(), and main().
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 242 of file gis/error.c.
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 |
Definition at line 527 of file aprintf.c.
References G_vsnaprintf().
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 |
Definition at line 446 of file strings.c.
Referenced by Rast_get_sample_bilinear(), Rast_get_sample_cubic(), and Rast_get_sample_nearest().
Seed the pseudo-random number generator.
| [in] | seedval | 32-bit integer used to seed the PRNG |
Definition at line 52 of file lrand48.c.
Referenced by G_math_srand(), and G_srand48_auto().
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 70 of file lrand48.c.
References _, AMI_STREAM< T >::AMI_STREAM(), G_fatal_error(), G_srand48(), getpid, gettimeofday(), NULL, and t.
Referenced by G_math_srand_auto(), and Rast_make_random_colors().
Get file status.
Returns information about the specified file.
| file_name | file name |
| buf | 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().
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.
References G_malloc, NULL, and strcpy.
Referenced by cairo_read_ppm(), cairo_write_ppm(), COM_Set_encoding(), 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(), font_get_encoding(), font_init_freetype(), G__home(), G__md_print_python_short_version(), G__read_Cell_head(), G__wps_print_process_description(), G_add_keyword(), G_config_path(), G_database_datum_name(), G_database_ellipse_name(), G_date(), G_define_standard_option(), G_fully_qualified_name(), G_get_available_mapsets(), G_init_logging(), G_ls2(), G_myname(), G_option_to_separator(), G_parser(), G_putenv(), G_read_datum_table(), G_read_ellipsoid_table(), G_set_key_value(), G_set_program_name(), G_store_lower(), G_store_upper(), G_str_concat(), G_str_replace(), G_tempfile_pid(), G_tempfile_pid_basedir(), G_whoami(), get_pj_area(), get_pj_object(), GP_get_sitename(), GP_load_site(), GP_set_style_thematic(), GPJ__get_datum_params(), GPJ__get_ellipsoid_params(), GPJ_get_datum_by_name(), GPJ_get_datum_transform_by_name(), GPJ_get_default_datum_params_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_grass_to_osr(), GPJ_init_transform(), GPJ_osr_to_grass(), gsds_newh(), GV_get_vectname(), GV_load_vector(), GV_set_style_thematic(), gvl_file_newh(), html_polygon(), I_iclass_init_statistics(), I_read_signatures(), I_SetClassTitle(), I_SetSigTitle(), M__add_element(), M_read_list(), parse_fontcap_entry(), pj_get_kv(), pj_get_string(), Rast3d_fill_header(), Rast3d_get_window_params(), Rast3d_init_defaults(), Rast3d_key_get_string(), Rast3d_open_cell_new(), Rast3d_open_cell_old_no_header(), Rast3d_set_unit(), Rast__open_null_write(), Rast__open_old(), Rast__read_history(), Rast_append_history(), Rast_create_gdal_link(), Rast_get_cell_title(), Rast_get_gdal_link(), Rast_get_reclass(), Rast_get_semantic_label_or_name(), Rast_get_vrt(), Rast_mask_info(), Rast_set_cats_fmt(), Rast_set_cats_title(), Rast_set_d_cat(), Rast_set_history(), read_datum_table(), read_ellipsoid_table(), read_pgm(), Segment_open(), tgis_get_database_name(), tgis_get_default_database_name(), tgis_get_driver_name(), tgis_map_list_insert(), V1_open_new_pg(), V1_open_old_pg(), Vect__open_old(), Vect_add_dblink(), Vect_close(), Vect_default_field_info(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_get_dblink(), Vect_get_finfo_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_finfo_topology_info(), Vect_get_proj_name(), Vect_line_to_wkt2(), Vect_maptype_info(), Vect_read_area_to_wkt2(), Vect_set_comment(), Vect_set_date(), Vect_set_map_date(), Vect_set_map_name(), Vect_set_organization(), Vect_set_person(), Vect_sfa_line_geometry_type(), Vect_subst_var(), Vect_write_ascii(), and write_pgm().
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 |
Definition at line 141 of file strings.c.
References G_store(), and G_str_to_lower().
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.
References G_store(), and G_str_to_upper().
Referenced by GPJ_init_transform().
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 |
Definition at line 267 of file strings.c.
References G_free(), G_malloc, G_store(), and NULL.
Referenced by Vect_get_column_names(), Vect_get_column_names_types(), and Vect_get_column_types().
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.
References count, G_malloc, G_store(), N, and NULL.
Referenced by db_read_dbmscap(), Vect_get_finfo_geometry_type(), and Vect_subst_var().
Convert string to lower case.
| [in,out] | str | pointer to string |
Definition at line 383 of file strings.c.
Referenced by G_store_lower(), and Vect_get_finfo_geometry_type().
Convert string to upper case.
| [in,out] | str | pointer to string |
Definition at line 365 of file strings.c.
Referenced by G_store_upper().
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.
References x.
Referenced by AS_option_to_algorithm(), Cairo_Graph_set(), check_mapset_in_layer_name(), clean_dir(), D_open_driver(), db_get_column(), db_table_exists(), dig_file_load(), dig_read_frmt_ascii(), G_basename(), G_compare_projections(), G_compressor_number(), G_get_datum_by_name(), G_get_ellipsoid_by_name(), G_get_spheroid_by_name(), G_init_logging(), G_parser(), G_str_to_color(), GPJ_get_datum_by_name(), GPJ_get_datum_transform_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_grass_to_osr(), 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(), Rast_get_gdal_link(), Rast_parse_color_rule(), read_image(), S_read(), V1_close_nat(), Vect_close(), Vect_legal_filename(), Vect_set_db_updated(), and write_image().
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 477 of file strings.c.
References G_strncasecmp(), and NULL.
Replace all occurrences of character in string bug with new.
| [in,out] | bug | base string |
| character | character to replace | |
| new | new character |
Definition at line 160 of file strings.c.
Referenced by G__md_print_python_short_version().
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.
References b.
Referenced by G_fread_key_value(), G_read_datum_table(), G_read_ellipsoid_table(), GPJ_get_datum_transform_by_name(), I_read_one_signature(), I_read_signatures(), M_read_list(), Rast__read_colors(), Rast_get_cell_title(), Rast_put_cell_title(), Rast_read_color_rule(), Rast_set_cats_fmt(), Rast_set_cats_title(), Rast_set_d_cat(), read_datum_table(), and read_ellipsoid_table().
Size-bounded string concatenation.
Appends string src to the end of dst. It will append at most dstsize - strlen(dst) - 1 characters. It will then NUL-terminate, unless dstsize is 0 or the original dst string was longer than dstsize (in practice this should not happen as it means that either dstsize is incorrect or that dst is not a proper string).
If the src and dst strings overlap, the behavior is undefined. This function is a safer alternative to strncat.
| [out] | dst | Pointer to the destination buffer. Must be a NUL-terminated C string. |
| [in] | src | Pointer to the source string, which will be appended. Must be a NUL-terminated C string. |
| [in] | dsize | The size of the destination buffer. |
Definition at line 57 of file strlcat.c.
Referenced by G_read_ellipsoid_table().
Safe string copy function.
Copy string src to buffer dst of size dsize. At most dsize-1 characters will be copied. Always NUL terminates (unless dsize == 0). This function is a safer alternative to strncpy.
| [out] | dst | Pointer to the destination buffer. |
| [in] | src | Pointer to the source string. Must be a NUL-terminated C string. |
| [in] | dsize | The size of the destination buffer. |
Definition at line 52 of file strlcpy.c.
Referenced by db_table_exists(), dig_read_frmt_ascii(), font_init(), G_insert_commas(), G_matrix_print(), G_str_to_color(), and Vect_read_colors().
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.
References x.
Referenced by check_create_export_opts(), check_create_import_opts(), G__json(), G__md_print_python_long_version(), and G_strcasestr().
Suppress printing a warning message to stderr.
| flag | a warning message will be suppressed if non-zero value is given |
Definition at line 222 of file gis/error.c.
Referenced by G_parser(), I_get_group(), I_get_group_title(), I_get_subgroup(), and I_get_target().
Switch mapset search path.
Definition at line 117 of file mapset_nme.c.
References count, and UntypedStream::path.
Populates element with a path string.
| [out] | element | element name |
Definition at line 148 of file tempfile.c.
References FALSE, and G__temp_element().
Referenced by D_open_driver(), G_tempfile_pid(), and main().
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(), and getpid.
Referenced by dig_spidx_free_areas(), dig_spidx_free_isles(), dig_spidx_free_lines(), dig_spidx_free_nodes(), dig_spidx_init(), G__json(), PS_Graph_set(), Rast3d_open_cell_new(), Rast__open_null_write(), Rast_put_cell_title(), Vect__delete(), and Vect_break_polygons_file().
Returns a temporary file name.
Similar to G_tempfile(), but the temporary file name will include a provided base directory instead of the path to the current mapset.
Definition at line 77 of file tempfile.c.
References G_tempfile_pid_basedir(), and getpid.
Create tempfile from process id.
See G_tempfile().
| pid |
Definition at line 90 of file tempfile.c.
References access, F_OK, G_counter_next(), G_debug(), G_file_name(), G_init_tempfile(), G_mapset(), G_store(), G_temp_element(), getpid, GNAME_MAX, GPATH_MAX, and name.
Referenced by G_tempfile().
Create tempfile from process id in given base directory.
See G_tempfile_basedir().
| pid | |
| basedir |
Definition at line 121 of file tempfile.c.
References access, F_OK, G__temp_element_basedir(), G_counter_next(), G_debug(), G_file_name_basedir(), G_init_tempfile(), G_mapset(), G_store(), getpid, GNAME_MAX, GPATH_MAX, and name.
Referenced by G_tempfile_basedir().
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 47 of file gis/token.c.
References NULL.
Referenced by check_create_export_opts(), check_create_import_opts(), check_mapset_in_layer_name(), G_get_window(), G_parser(), G_set_keywords(), GPJ_grass_to_osr2(), and Vect__open_cursor_next_line_pg().
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 83 of file gis/token.c.
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(), Rast3d_write_cats(), and Vect_write_ascii().
Get units code by name.
Units codes (gis.h):
| units_name | units name (singular or plural form) |
Definition at line 406 of file units.c.
References G_database_unit_name(), G_units(), NULL, strcasecmp, 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(), G_units(), and Rast3d_set_vertical_unit().
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(), name, and strcpy.
Referenced by I_fopen_signature_file_old(), I_fopen_sigset_file_old(), I_signatures_copy(), Rast3d_open_cell_new(), Rast3d_open_cell_old_no_header(), Rast__open_null_write(), and Rast__open_old().
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.
Remove name from environment.
Updates .gisrc
| name | variable name |
Definition at line 499 of file env.c.
References G_VAR_GISRC, and name.
Remove name from environment from specific place.
Updates .gisrc
| name | variable name |
| loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 514 of file env.c.
References name.
Referenced by db_set_connection().
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.
References file, G_free_key_value(), G_read_key_value_file(), G_set_key_value(), G_write_key_value_file(), Key_Value::key, and Key_Value::value.
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.
Referenced by G_parser(), and Rast3d_parse_vallist().
vprintf() version of G_aprintf(). See G_aprintf() for more details.
| [in] | format | string format |
| [in] | ap | variable argument list for the format string |
Definition at line 379 of file aprintf.c.
References NULL.
Referenced by G_aprintf().
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 40 of file asprintf.c.
References count, G_malloc, and G_realloc.
Referenced by G_asprintf(), Rast_append_format_history(), and Rast_format_history().
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 60 of file verbose.c.
References G_initialize_done(), G_is_initialized(), st, and STDLEVEL.
Referenced by G_clicker(), G_fatal_error(), G_important_message(), G_init_all(), G_message(), G_parser(), G_percent(), G_progress(), G_verbose_message(), G_warning(), and Vect__open_old().
Get max verbosity level.
Definition at line 81 of file verbose.c.
References MAXLEVEL.
Referenced by G_parser(), and recreate_command().
Referenced by D_open_driver(), G_adjust_Cell_head(), G_adjust_Cell_head3(), G_adjust_window_ll(), G_set_omp_num_threads(), HTML_Graph_set(), I_signatures_remove(), IL_resample_output_2d(), IL_vector_input_data_2d(), M_do_copy(), M_do_remove(), M_do_rename(), PNG_Graph_set(), PS_Graph_set(), Rast_disable_omp_on_mask(), Segment_open(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_nat(), Vect_build_partial(), Vect_cats_set_constraint(), Vect_clean_small_angles_at_nodes(), Vect_get_map_box1(), Vect_merge_lines(), Vect_remove_duplicates(), and Vect_save_frmt().
Get min verbosity level.
Definition at line 101 of file verbose.c.
References MINLEVEL.
Referenced by G_important_message(), and G_parser().
Get standard verbosity level.
Definition at line 91 of file verbose.c.
References STDLEVEL.
Referenced by G_message(), G_parser(), G_verbose_message(), and recreate_command().
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 |
Definition at line 392 of file aprintf.c.
References NULL.
Referenced by G_faprintf().
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 |
Definition at line 411 of file aprintf.c.
References NULL.
Referenced by G_saprintf().
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 |
Definition at line 432 of file aprintf.c.
References NULL.
Referenced by G_snaprintf().
Referenced by AS_class_equiprob(), clean_dir(), close_g3d_file(), D_close_driver(), D_open_driver(), D_plot_icon(), db_delete_table(), db_get_column(), db_get_table_number_of_rows(), db_legal_tablename(), db_select_CatValArray(), db_select_int(), db_select_value(), db_start_driver_open_database(), db_table_exists(), db_table_to_sql(), dig__read_head(), dig_add_area(), dig_add_isle(), dig_area_add_isle(), dig_cidx_del_cat(), dig_del_area(), dig_file_load(), dig_out_of_memory(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), dig_read_frmt_ascii(), dig_write_plus_file(), err(), fopen_group_file_old(), fopen_subgroup_file_old(), G__check_gisinit(), G__gisinit(), G__matrix_add(), G__no_gisinit(), G__wps_print_process_description(), G_bz2_compress(), G_bz2_expand(), G_check_compressor(), G_check_input_output_name(), G_copy_file(), G_debug(), G_distance_point_to_line_segment(), G_fopen_append(), G_fopen_append_misc(), G_fopen_modify(), G_fopen_modify_misc(), G_get_3dview(), G_get_projinfo(), G_get_projunits(), G_legal_filename(), G_lz4_compress(), G_lz4_expand(), G_math_cholesky_decomposition(), G_math_solver_cholesky(), G_matrix_copy(), G_matrix_init(), G_matrix_inverse(), G_matrix_LU_solve(), G_matrix_product(), G_matrix_read(), G_matrix_scalar_mul(), G_matrix_set(), G_matrix_set_element(), G_matvect_extract_vector(), G_matvect_get_column(), G_matvect_get_row(), G_matvect_product(), G_open_update(), G_open_update_misc(), G_parser(), G_plot_area(), G_plot_polygon(), G_put_3dview(), G_read_compressed(), G_read_datum_table(), G_read_ellipsoid_table(), G_read_vector_timestamp(), G_set_omp_num_threads(), G_vector_copy(), G_vector_init(), G_vector_norm1(), G_vector_product(), G_vector_set(), G_vector_sub(), G_write_compressed(), G_write_uncompressed(), G_write_vector_timestamp(), G_zlib_compress(), G_zlib_expand(), G_zstd_compress(), G_zstd_expand(), get_feature(), get_pj_area(), get_pj_object(), gk_make_framesfromkeys(), gk_make_linear_framesfromkeys(), GK_update_frames(), Gp_load_sites(), Gp_load_sites_thematic(), GP_str_to_marker(), GPJ_get_datum_transform_by_name(), GPJ_grass_to_osr(), GPJ_init_transform(), GPJ_osr_to_grass(), GPJ_transform(), GPJ_transform_array(), Gs_build_256lookup(), gs_err(), Gs_get_cat_label(), Gs_load_3dview(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), gs_malloc_lookup(), Gs_numtype(), Gs_pack_colors(), Gs_pack_colors_float(), gs_put_label(), GS_write_ppm(), GS_write_tif(), GS_write_zoom(), gsd_put_legend(), gsd_rot(), gsd_wall(), gsdrape_set_surface(), Gv_load_vect(), Gv_load_vect_thematic(), Gvl_load_colors_data(), I_cluster_exec(), I_compute_scatts(), 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_iclass_write_signatures(), I_insert_patch_to_cat_rast(), I_put_control_points(), I_rasterize(), I_read_signatures(), I_ReadSigSet(), I_signatures_copy(), I_signatures_remove(), I_signatures_rename(), IL_grid_calc_2d(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_output_2d(), IL_resample_output_2d(), IL_vector_input_data_2d(), kdtree_remove(), line_check_intersection(), line_check_intersection2(), M_do_copy(), M_do_remove(), M_do_rename(), main(), make_perimeter(), make_statistics(), N_gwflow_2d_calc_water_budget(), N_gwflow_3d_calc_water_budget(), NetA_distance_to_points(), NetA_init_distinct(), NetA_init_timetable_from_db(), NetA_initialise_varray(), NetA_strongly_connected_components(), NetA_timetable_shortest_path(), NetA_varray_to_nodes(), NetA_weakly_connected_components(), Nviz_color_from_str(), Nviz_create_render_window(), Nviz_make_current_render_window(), Nviz_new_light(), Nviz_new_map_obj(), Nviz_set_focus_state(), open_g3d_file(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), P_popmatrix(), P_pushmatrix(), parse_fontcap(), pj_do_proj(), pj_do_transform(), pj_get_kv(), pj_get_string(), process_point(), Rast3d_close(), Rast3d_open_cell_new(), Rast3d_read_cats(), Rast3d_read_colors(), Rast3d_read_range(), Rast3d_read_window(), Rast3d_rewrite_header(), Rast3d_write_colors(), Rast__check_for_auto_masking(), Rast__check_fp_type(), Rast__close_null(), Rast__quant_import(), Rast__read_null_row_ptrs(), Rast__read_row_ptrs(), Rast_close_gdal_write_link(), Rast_create_gdal_link(), Rast_get_reclass(), Rast_is_null_value(), Rast_legal_semantic_label(), Rast_put_cell_title(), Rast_put_reclass(), Rast_read_cats(), Rast_read_colors(), Rast_read_fp_range(), Rast_read_histogram(), Rast_read_history(), Rast_read_range(), Rast_read_rstats(), Rast_read_vector_cats(), Rast_set_null_value(), Rast_set_window(), Rast_write_quant(), rbtree_create(), rbtree_debug(), rbtree_traverse_start(), read_coor(), read_datum_table(), read_ellipsoid_table(), Rowio_setup(), S_read(), seg_pagein(), seg_pageout(), seg_setup(), Segment_get_row(), Segment_init(), segment_intersection_2d(), segment_intersection_2d_tol(), Segment_open(), Segment_put(), Segment_put_row(), SimpleErrorMessage(), V1_close_nat(), 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(), V1_read_line_ogr(), V1_read_line_pg(), V1_rewrite_line_ogr(), V1_rewrite_line_pg(), V2__delete_line_from_topo_nat(), V2__update_area_pg(), V2__write_area_sfa(), V2_close_ogr(), V2_close_pg(), V2_delete_line_nat(), V2_delete_line_pg(), V2_delete_line_sfa(), V2_open_old_ogr(), V2_open_old_pg(), V2_read_line_nat(), V2_read_line_pg(), V2_read_line_sfa(), V2_read_next_line_pg(), V2_restore_line_nat(), V2_rewrite_line_nat(), V2_rewrite_line_pg(), V2_rewrite_line_sfa(), V2_write_line_sfa(), Vect__cache_feature_pg(), Vect__close_cursor_pg(), Vect__copy_areas(), Vect__delete(), Vect__execute_get_value_pg(), Vect__execute_pg(), Vect__load_map_lines_pg(), Vect__load_map_nodes_pg(), Vect__load_plus_head(), Vect__load_plus_pg(), Vect__open_cursor_line_pg(), Vect__open_cursor_next_line_pg(), Vect__open_old(), Vect__read_head(), Vect__select_line_pg(), Vect__write_head(), Vect_add_dblink(), Vect_area_alive(), Vect_build_line_area(), Vect_build_nat(), Vect_build_ogr(), Vect_build_partial(), Vect_build_pg(), Vect_build_sidx_from_topo(), Vect_cats_in_constraint(), Vect_cats_set_constraint(), Vect_check_input_output_name(), Vect_cidx_open(), Vect_cidx_save(), Vect_close(), Vect_coor_info(), Vect_copy(), Vect_copy_map_dblinks(), Vect_copy_map_lines_field(), Vect_copy_table_by_cats(), Vect_copy_tables(), Vect_delete_line(), 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_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_isle_box(), Vect_get_isle_points(), Vect_get_line_areas(), Vect_get_line_box(), Vect_get_map_box1(), Vect_get_next_line_id(), Vect_get_node_coor(), Vect_get_point_in_poly(), Vect_get_point_in_poly_isl(), Vect_graph_shortest_path(), Vect_isle_alive(), Vect_isle_find_area(), Vect_legal_filename(), Vect_level(), Vect_line_alive(), Vect_line_segment(), Vect_map_add_dblink(), Vect_map_del_dblink(), Vect_merge_lines(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_net_ttb_shortest_path(), Vect_node_alive(), Vect_open_fidx(), Vect_open_sidx(), Vect_open_topo(), Vect_overlay_and(), Vect_read_ascii(), Vect_read_ascii_head(), Vect_read_colors(), Vect_read_line(), Vect_read_next_line(), Vect_rename(), Vect_restore_line(), Vect_rewrite_line(), Vect_save_fidx(), Vect_save_frmt(), Vect_save_sidx(), Vect_save_topo(), Vect_segment_intersection(), Vect_set_constraint_field(), Vect_set_open_level(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_cat_string(), Vect_set_varray_from_db(), Vect_sfa_get_num_features(), Vect_sfa_line_astext(), Vect_str_to_cat_list(), Vect_topo_check(), Vect_write_ascii(), Vect_write_dblinks(), Vect_write_line(), vector2perimeters(), Vedit_delete_area(), Vedit_delete_area_centroid(), Vedit_delete_lines(), and Vedit_modify_cats().
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 34 of file gis/whoami.c.
References AMI_STREAM< T >::AMI_STREAM(), G_initialize_done(), G_is_initialized(), G_store(), and name.
Referenced by G__script(), G_init_all(), G_open_mail(), Rast_short_history(), Vect__init_head(), and Vect_hist_command().
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 34 of file wind_overlap.c.
References Cell_head::east, N, Cell_head::north, Cell_head::proj, PROJECTION_LL, Cell_head::south, W, and Cell_head::west.
Referenced by V__map_overlap().
| 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 window structure |
| [in] | N | north |
| [in] | S | south |
| [in] | E | east |
| [in] | W | west |
Definition at line 78 of file wind_overlap.c.
References Cell_head::east, H, N, Cell_head::north, Cell_head::proj, PROJECTION_LL, Cell_head::south, W, and Cell_head::west.
Definition at line 323 of file compress.c.
References _, err(), G_calloc, G_compress(), G_compress_bound(), G_COMPRESSED_NO, G_COMPRESSED_YES, G_free(), G_warning(), NULL, and write.
Referenced by Rast3d_fpcompress_write_xdr_nums().
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 _, file, G_fatal_error(), and G_fwrite_key_value().
Referenced by G_make_location(), G_make_location_epsg(), G_update_key_value_file(), and Rast3d_write_header().
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 559 of file make_loc.c.
References _, err(), G_fatal_error(), G_file_name(), G_gisdbase(), GPATH_MAX, and SRID_FILE.
Referenced by G_make_location_crs().
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 508 of file make_loc.c.
References _, err(), G_fatal_error(), G_file_name(), G_gisdbase(), GPATH_MAX, and WKT_FILE.
Referenced by G_make_location_crs().
Write timestamp of 3D raster map.
| name | map name | |
| [out] | ts | TimeStamp struct to populate |
Definition at line 611 of file timestamp.c.
Write timestamp of raster map.
| name | map name | |
| [out] | ts | TimeStamp struct to populate |
Definition at line 391 of file timestamp.c.
References name, and RAST_MISC.
Referenced by IL_output_2d().
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 160 of file timestamp.c.
References G_format_timestamp().
Referenced by G_write_vector_timestamp().
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 507 of file timestamp.c.
References _, G_debug(), G_fopen_new(), G_mapset(), G_warning(), G_write_timestamp(), GNAME_MAX, GPATH_MAX, GV_DIRECTORY, GV_TIMESTAMP_ELEMENT, name, and NULL.
Writes n bytes of zero to file descriptor fd
| [in] | fd | file descriptor |
| [in] | n | number of bytes to write |
Definition at line 29 of file writ_zeros.c.
References _, G_fatal_error(), and write.
Definition at line 89 of file gis/xdr.c.
Referenced by Rast3d_read_doubles(), Rast3d_read_range(), Rast_read_fp_range(), and Rast_read_rstats().
Definition at line 69 of file gis/xdr.c.
Referenced by Rast3d_read_ints().
Definition at line 94 of file gis/xdr.c.
Referenced by Rast3d_write_doubles(), Rast_write_fp_range(), and Rast_write_rstats().
Definition at line 74 of file gis/xdr.c.
Referenced by Rast3d_write_ints().
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_select_value(), db_set_default_connection(), dig_alloc_area(), dig_alloc_isle(), dig_alloc_line(), dig_alloc_node(), dig_file_init(), dig_init_plus(), dig_line_box(), dig_read_frmt_ascii(), G_create_key_value(), G_define_flag(), G_define_module(), G_define_option(), G_get_element_window(), gp_get_new_site(), Gp_load_sites(), Gp_load_sites_thematic(), GP_set_style_thematic(), Gs_build_256lookup(), gv_get_new_vect(), Gv_load_vect_thematic(), GV_set_style_thematic(), gvl_init_vol(), I_compute_scatts(), I_sc_add_cat(), I_sc_init_cats(), I_scd_init_scatt_data(), Rast3d_read_history(), Rast__open_null_write(), Rast__set_null_value(), Rast_init_colors(), Rast_lookup_c_colors(), Rast_lookup_colors(), Rast_lookup_d_colors(), Rast_lookup_f_colors(), Rast_read_history(), Rast_short_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__load_plus_pg(), Vect__open_old(), Vect_build_ogr(), Vect_build_pg(), Vect_default_field_info(), Vect_new_cat_list(), Vect_new_dblinks_struct(), Vect_new_map_struct(), Vect_write_ascii(), and Vedit_move_vertex().
Definition at line 87 of file cmprzlib.c.
References _, G__::compression_level, err(), G_calloc, G_free(), G_warning(), G_zlib_compress_bound(), and NULL.
Definition at line 165 of file cmprzlib.c.
References _, err(), G_warning(), and NULL.
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 23 of file zone.c.
References G_get_set_window(), and Cell_head::zone.
Referenced by Rast__check_for_auto_masking(), Vect__open_old(), and Vect_get_zone().
Definition at line 86 of file cmprzstd.c.
References _, err(), G_calloc, G_fatal_error(), G_free(), G_warning(), G_zstd_compress_bound(), and NULL.
Definition at line 162 of file cmprzstd.c.
References _, err(), G_fatal_error(), G_warning(), and NULL.