GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
Vector library - Open OGR layer as vector map layer. More...
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grass/vector.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
#include <ogr_api.h>
Go to the source code of this file.
Functions | |
int | V1_open_old_ogr (struct Map_info *Map, int update) |
Open existing OGR layer on non-topological level. More... | |
int | V2_open_old_ogr (struct Map_info *Map) |
Open existing OGR layer on topological level. More... | |
int | V1_open_new_ogr (struct Map_info *Map, const char *name, int with_z) |
Prepare OGR datasource for creating new OGR layer (level 1) More... | |
int | Vect_open_fidx (struct Map_info *Map, struct Format_info_offset *offset) |
Open feature index file. More... | |
Vector library - Open OGR layer as vector map layer.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2010 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 open_ogr.c.
int V1_open_new_ogr | ( | struct Map_info * | Map, |
const char * | name, | ||
int | with_z | ||
) |
Prepare OGR datasource for creating new OGR layer (level 1)
New OGR layer is created when writing features by Vect_wrile_line().
[out] | Map | pointer to Map_info structure |
name | name of OGR layer to create | |
with_z | WITH_Z for 3D vector data otherwise WITHOUT_Z |
Definition at line 180 of file open_ogr.c.
References _, Format_info_ogr::driver, Format_info_ogr::driver_name, Format_info_ogr::ds, Format_info_ogr::dsn, Map_info::fInfo, G_debug(), G_fatal_error(), G_get_overwrite(), G_warning(), Format_info_ogr::layer, Format_info_ogr::layer_name, name, NULL, and Format_info::ogr.
int V1_open_old_ogr | ( | struct Map_info * | Map, |
int | update | ||
) |
Open existing OGR layer on non-topological level.
Note: Map->name, Map->mapset, Map->fInfo.ogr.dsn and Map->fInfo.ogr.layer_name must be set before.
[in,out] | Map | pointer to Map_info structure |
update | TRUE for write mode, otherwise read-only |
Definition at line 43 of file open_ogr.c.
References _, Format_info_ogr::cache, Format_info_ogr::ds, Format_info_ogr::dsn, FALSE, Format_info_cache::fid, Map_info::fInfo, G_debug(), G_fatal_error(), G_warning(), Map_info::head, Format_info_ogr::layer, Format_info_ogr::layer_name, NULL, Format_info::ogr, WITH_Z, dig_head::with_z, and WITHOUT_Z.
int V2_open_old_ogr | ( | struct Map_info * | Map | ) |
Open existing OGR layer on topological level.
This functions reads feature index (fidx) file required for pseudo-topology.
[in,out] | Map | pointer to Map_info structure |
Definition at line 145 of file open_ogr.c.
References _, Map_info::fInfo, G_debug(), G_fatal_error(), G_warning(), G_zero(), Map_info::mapset, Map_info::name, Format_info_ogr::next_line, Format_info_ogr::offset, Format_info::ogr, Vect_get_full_name(), and Vect_open_fidx().
int Vect_open_fidx | ( | struct Map_info * | Map, |
struct Format_info_offset * | offset | ||
) |
Open feature index file.
[in,out] | Map | pointer to Map_info struct |
[out] | offset | pointer to Format_info_offset (OGR or PG) |
Definition at line 254 of file open_ogr.c.
References _, Format_info_offset::array, Format_info_offset::array_alloc, Format_info_offset::array_num, Port_info::byte_order, dig__fread_port_C(), dig__fread_port_I(), dig__fread_port_L(), dig_file_init(), dig_init_portable(), dig_set_cur_port(), gvfile::file, Map_info::format, G_debug(), G_fatal_error(), G_fopen_old(), G_fseek(), G_malloc, G_warning(), GPATH_MAX, GV_DIRECTORY, GV_FIDX_ELEMENT, Map_info::mapset, Map_info::name, NULL, and Vect_get_full_name().
Referenced by V2_open_old_ogr(), and V2_open_old_pg().