GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-847944e18e
|
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | G_write_projwkt (const char *location_name, const char *wktstring) |
Write WKT definition to file. More... | |
int | G_write_projsrid (const char *location_name, const char *sridstring) |
Write srid (spatial reference id) to file. More... | |
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_find_key_value(), 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.
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.
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.
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(), G_gisdbase(), GPATH_MAX, and SRID_FILE.
int G_write_projwkt | ( | const char * | location_name, |
const char * | wktstring | ||
) |
Write WKT definition to file.
Any WKT string and version recognized by PROJ is supported.
location_name | name of the location to write the WKT definition |
wktstring | pointer to WKT string |
Definition at line 511 of file make_loc.c.
References _, err(), G_fatal_error(), G_file_name(), G_gisdbase(), GPATH_MAX, and WKT_FILE.