GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
|
GIS Library - Functions to create a new location. More...
#include <grass/gis.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <math.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
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. | |
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. | |
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. | |
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. | |
int | G_write_projwkt (const char *location_name, const char *wktstring) |
Write WKT definition to file. | |
int | G_write_projsrid (const char *location_name, const char *sridstring) |
Write srid (spatial reference id) to file. | |
GIS Library - Functions to create a new location.
Creates a new location automatically given a "Cell_head", PROJ_INFO and PROJ_UNITS information.
(C) 2000-2013 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file make_loc.c.
int G_compare_projections | ( | const struct Key_Value * | proj_info1, |
const struct Key_Value * | proj_units1, | ||
const struct Key_Value * | proj_info2, | ||
const struct Key_Value * | proj_units2 ) |
Compare projections including units.
proj_info1 | projection info to compare |
proj_units1 | projection units to compare |
proj_info2 | projection info to compare |
proj_units2 | projection units to compare |
Definition at line 231 of file make_loc.c.
References G_debug(), G_find_key_value(), G_get_ellipsoid_by_name(), G_strcasecmp(), NULL, and TRUE.
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(), 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_epsg | EPSG code suitable to write to the PROJ_EPSG file, or NULL. |
proj_wkt | WKT definition suitable to write to the PROJ_WKT file, or NULL. |
proj_srid | Spatial reference ID suitable to write to the PROJ_SRID file, or NULL. |
Definition at line 185 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 126 of file make_loc.c.
References G_file_name(), G_make_location(), G_write_key_value_file(), and NULL.
int G_write_projsrid | ( | const char * | location_name, |
const char * | sridstring ) |
Write srid (spatial reference id) to file.
A srid consists of an authority name and code and must be known to PROJ.
location_name | name of the location to write the srid |
sridstring | pointer to srid string |
Definition at line 563 of file make_loc.c.
References err(), G_fatal_error(), G_file_name(), and G_gisdbase().
Referenced by G_make_location_crs().
int G_write_projwkt | ( | const char * | location_name, |
const char * | wktstring ) |
Write WKT definition to file.
Any WKT string and version recognized by PROJ is supported.
location_name | name of the location to write the WKT definition |
wktstring | pointer to WKT string |
Definition at line 511 of file make_loc.c.
References err(), G_fatal_error(), G_file_name(), and G_gisdbase().
Referenced by G_make_location_crs().