GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
open_ogr.c File Reference

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>
Include dependency graph for open_ogr.c:

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...
 

Detailed Description

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.

Author
Original author CERL, probably Dave Gerdes or Mike Higgins.
Update to GRASS 5.7 Radim Blazek and David D. Gray.
Update to GRASS 7.0 Martin Landa <landa.martin gmail.com> (2009)

Definition in file open_ogr.c.

Function Documentation

◆ V1_open_new_ogr()

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().

Parameters
[out]Mappointer to Map_info structure
namename of OGR layer to create
with_zWITH_Z for 3D vector data otherwise WITHOUT_Z
Returns
0 success
-1 error

Definition at line 177 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, NULL, and Format_info::ogr.

◆ V1_open_old_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.

Parameters
[in,out]Mappointer to Map_info structure
updateTRUE for write mode, otherwise read-only
Returns
0 success
-1 error

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.

◆ V2_open_old_ogr()

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.

Parameters
[in,out]Mappointer to Map_info structure
Returns
0 success
-1 error

Definition at line 142 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().

◆ Vect_open_fidx()