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

Vector library - open vector map (native format) - level 1. More...

#include <inttypes.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grass/vector.h>
#include <grass/glocale.h>
#include "local_proto.h"
Include dependency graph for open_nat.c:

Go to the source code of this file.

Functions

int V1_open_old_nat (struct Map_info *Map, int update)
 Open existing vector map (level 1)
 
int V1_open_new_nat (struct Map_info *Map, const char *name, int with_z)
 Create new vector map (level 1)
 

Detailed Description

Vector library - open vector map (native format) - level 1.

Higher level functions for reading/writing/manipulating vectors.

SPDX-FileCopyrightText: 2001-2009 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.

Definition in file open_nat.c.

Function Documentation

◆ V1_open_new_nat()

int V1_open_new_nat ( struct Map_info Map,
const char name,
int  with_z 
)

Create new vector map (level 1)

Parameters
[out]Mappointer to Map_info structure
namevector map name to be created
with_z2D or 3D (unused?)
Returns
0 success
-1 error

Definition at line 95 of file open_nat.c.

References access, dig__byte_order_out(), dig__write_head(), dig_file_init(), dig_init_portable(), F_OK, G_debug(), G_fopen_modify(), G_fopen_new(), GPATH_MAX, GV_COOR_EARLIEST_MAJOR, GV_COOR_EARLIEST_MINOR, GV_COOR_ELEMENT, GV_COOR_VER_MAJOR, GV_COOR_VER_MINOR, GV_TOPO_ELEMENT, name, NULL, unlink, Vect__get_element_path(), and Vect__get_path().

◆ V1_open_old_nat()

int V1_open_old_nat ( struct Map_info Map,
int  update 
)

Open existing vector map (level 1)

Map->name and Map->mapset must be set before.

Parameters
Mappointer to Map_info structure
updatenon-zero for write mode, otherwise read-only
Returns
0 success
-1 error

Definition at line 38 of file open_nat.c.

References _, dig__read_head(), dig_file_init(), dig_file_load(), dig_init_portable(), G_debug(), G_fopen_modify(), G_fopen_old(), G_free(), G_warning(), GPATH_MAX, GV_COOR_ELEMENT, AMI_STREAM< T >::name(), NULL, Vect__get_path(), Vect_coor_info(), and Vect_get_full_name().