GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
Loading...
Searching...
No Matches
build_ogr.c File Reference

Vector library - Building topology for OGR. More...

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <grass/vector.h>
#include <grass/glocale.h>
#include <ogr_api.h>
#include <cpl_error.h>
#include "local_proto.h"
Include dependency graph for build_ogr.c:

Go to the source code of this file.

Functions

int Vect_build_ogr (struct Map_info *Map, int build)
 Build pseudo-topology (simple features) for OGR layer.
 
int Vect_save_fidx (struct Map_info *Map, struct Format_info_offset *offset)
 Save feature index file for vector map.
 

Detailed Description

Vector library - Building topology for OGR.

Higher level functions for reading/writing/manipulating vectors.

Category: FID, not all layer have FID, OGRNullFID is defined (5/2004) as -1, so FID should be only >= 0

(C) 2001-2010, 2012 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
Radim Blazek, Piero Cavalieri
Various updates for GRASS 7 by Martin Landa <landa.martin gmail.com>

Definition in file build_ogr.c.

Function Documentation

◆ Vect_build_ogr()

int Vect_build_ogr ( struct Map_info Map,
int  build 
)

Build pseudo-topology (simple features) for OGR layer.

Build levels:

  • GV_BUILD_NONE
  • GV_BUILD_BASE
  • GV_BUILD_ATTACH_ISLES
  • GV_BUILD_CENTROIDS
  • GV_BUILD_ALL
Parameters
Mappointer to Map_info structure
buildbuild level
Returns
1 on success
0 on error

Definition at line 47 of file build_ogr.c.

References _, Plus_head::built, G_debug(), G_free(), G_message(), G_warning(), G_zero(), GV_BUILD_BASE, GV_BUILD_NONE, Vect__build_sfa(), Vect_get_finfo_format_info(), and Vect_get_finfo_geometry_type().

◆ Vect_save_fidx()

int Vect_save_fidx ( struct Map_info Map,
struct Format_info_offset offset 
)

Save feature index file for vector map.

Parameters
Mappointer to Map_info structure
offsetpointer to Format_info_offset struct (see Format_info_ogr and Format_info_pg struct for implementation issues)
Returns
1 on success
0 on error

Definition at line 109 of file build_ogr.c.

References _, Format_info_offset::array, Format_info_offset::array_num, dig__byte_order_out(), dig__fwrite_port_C(), dig__fwrite_port_I(), dig__fwrite_port_L(), dig_file_init(), dig_init_portable(), dig_set_cur_port(), FALSE, gvfile::file, G_debug(), G_mapset(), G_warning(), GPATH_MAX, GV_BUILD_ALL, GV_DIRECTORY, GV_FIDX_ELEMENT, AMI_STREAM< T >::name(), NULL, and Vect__get_element_path().

Referenced by V2_close_ogr(), and V2_close_pg().