GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r73111
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 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

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, and V2__write_area_ogr().

Referenced by Vect__copy_areas().

int V2_delete_line_sfa ( struct Map_info Map,
off_t  line 
)
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.

References _, G_debug(), G_fatal_error(), G_warning(), Plus_head::n_lines, NULL, Map_info::plus, V2_delete_line_sfa(), V2_read_line_sfa(), and 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.

References _, Format_info_offset::array, Plus_head::box, Plus_head::built, Plus_head::cidx_up_to_date, dig_add_line(), dig_cidx_add_cat(), dig_line_box(), FALSE, Map_info::fInfo, Map_info::format, G_debug(), G_fatal_error(), G_warning(), GV_BOUNDARY, GV_BUILD_BASE, GV_CENTROID, GV_FORMAT_POSTGIS, Plus_head::n_uplines, Plus_head::n_upnodes, Format_info_pg::offset, Format_info::pg, Map_info::plus, Plus_head::update_cidx, Plus_head::uplist, V1_write_line_ogr(), V1_write_line_pg(), Vect_append_point(), Vect_box_copy(), Vect_box_extend(), Vect_destroy_line_struct(), Vect_get_point_in_poly(), Vect_new_line_struct(), and x.

Referenced by V2_rewrite_line_sfa(), and V2_write_line_pg().