GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
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.
 
int V2_open_old_ogr (struct Map_info *Map)
 Open existing OGR layer on topological level.
 
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)
 
int Vect_open_fidx (struct Map_info *Map, struct Format_info_offset *offset)
 Open feature index file.
 

Detailed Description

Vector library - Open OGR layer as vector map layer.

Higher level functions for reading/writing/manipulating vectors.

SPDX-FileCopyrightText: 2001-2010 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later

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 167 of file open_ogr.c.

References _, G_debug(), G_fatal_error(), G_get_overwrite(), G_warning(), name, and NULL.

◆ 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 39 of file open_ogr.c.

References _, FALSE, G_debug(), G_fatal_error(), G_warning(), Format_info_ogr::layer, NULL, 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 136 of file open_ogr.c.

References _, G_debug(), G_free(), G_warning(), G_zero(), AMI_STREAM< T >::name(), Vect_get_full_name(), and Vect_open_fidx().

Referenced by Vect__open_old().

◆ Vect_open_fidx()