GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d37ee165c
write_sfa.c File Reference

Vector library - write vector feature - simple feature access (level 2) More...

#include <grass/vector.h>
#include <grass/glocale.h>
#include "local_proto.h"
#include "pg_local_proto.h"
Include dependency graph for write_sfa.c:

Go to the source code of this file.

Functions

off_t V2_write_line_sfa (struct Map_info *Map, int type, const struct line_pnts *points, const struct line_cats *cats)
 Writes feature on level 2 (OGR/PostGIS interface, pseudo-topological level) More...
 
off_t V2_rewrite_line_sfa (struct Map_info *Map, off_t line, int type, const struct line_pnts *points, const struct line_cats *cats)
 Rewrites feature at the given offset on level 2 (OGR/PostGIS interface, pseudo-topological level) More...
 
int V2_delete_line_sfa (struct Map_info *Map, off_t line)
 Deletes feature on level 2 (OGR/PostGIS interface) More...
 
off_t V2__write_area_sfa (struct Map_info *Map, const struct line_pnts **points, int nparts, const struct line_cats *cats)
 Writes area on topological level (Simple Features interface, internal use only) More...
 

Detailed Description

Vector library - write vector feature - simple feature access (level 2)

Higher level functions for reading/writing/manipulating vectors.

See write_ogr.c (OGR interface) and write_pg.c (PostGIS interface) for imlementation issues.

Todo:

SFA version of V2__delete_area_cats_from_cidx_nat()

function to delete corresponding entry in fidx

SFA version of V2__add_area_cats_to_cidx_nat

SFA version of V2__add_line_to_topo_nat

(C) 2011-2012 by Martin Landa, and 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
Martin Landa <landa.martin gmail.com>

Definition in file write_sfa.c.

Function Documentation

◆ V2__write_area_sfa()

off_t V2__write_area_sfa ( struct Map_info Map,
const struct line_pnts **  points,
int  nparts,
const struct line_cats cats 
)

Writes area on topological level (Simple Features interface, internal use only)

Parameters
Mappointer to Map_info structure
pointsfeature geometry (exterior + interior rings)
npartsnumber of parts including exterior ring
catsfeature categories
Returns
feature offset
-1 on error

Definition at line 290 of file write_sfa.c.

References _, Map_info::format, G_fatal_error(), G_warning(), GV_FORMAT_OGR, GV_FORMAT_POSTGIS, V2__write_area_ogr(), and V2__write_area_pg().

◆ V2_delete_line_sfa()

int V2_delete_line_sfa ( struct Map_info Map,
off_t  line 
)

Deletes feature on level 2 (OGR/PostGIS interface)

Note: Topology must be built at level >= GV_BUILD_BASE

Todo:
Update fidx
Parameters
pointerto Map_info structure
linefeature id to be deleted
Returns
0 on success
-1 on error

Definition at line 191 of file write_sfa.c.

◆ V2_rewrite_line_sfa()

off_t V2_rewrite_line_sfa ( struct Map_info Map,
off_t  line,
int  type,
const struct line_pnts points,
const struct line_cats cats 
)

Rewrites feature at the given offset on level 2 (OGR/PostGIS interface, pseudo-topological level)

Note: Topology must be built at level >= GV_BUILD_BASE

Parameters
Mappointer to Map_info structure
linefeature id to be rewritten
typefeature type (see V1_write_line_ogr() for supported types)
pointspointer to line_pnts structure (feature geometry)
catspointer to line_cats structure feature categories
Returns
feature index in offset array (related to pseudo-topology)
-1 on error

Definition at line 151 of file write_sfa.c.

◆ V2_write_line_sfa()

off_t V2_write_line_sfa ( struct Map_info Map,
int  type,
const struct line_pnts points,
const struct line_cats cats 
)

Writes feature on level 2 (OGR/PostGIS interface, pseudo-topological level)

Parameters
Mappointer to Map_info structure
typefeature type (see V1_write_line_ogr() for list of supported types)
pointspointer to line_pnts structure (feature geometry)
catspointer to line_cats structure (feature categories)
Returns
feature index in offset array (related to pseudo-topology)
-1 on error

Definition at line 49 of file write_sfa.c.