GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73587
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
read_ogr.c File Reference

Vector library - reading data (OGR format) More...

#include <grass/vector.h>
#include <grass/glocale.h>
#include <ogr_api.h>
Include dependency graph for read_ogr.c:

Go to the source code of this file.

Functions

int V1_read_next_line_ogr (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
 Read next feature from OGR layer. Skip empty features (level 1 without topology). More...
 
int V2_read_next_line_ogr (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
 Read next feature from OGR layer on topological level. More...
 
int V1_read_line_ogr (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, off_t offset)
 Read feature from OGR layer at given offset (level 1 without topology) More...
 

Detailed Description

Vector library - reading data (OGR format)

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2011 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
Martin Landa <landa.martin gmail.com>

Definition in file read_ogr.c.

Function Documentation

int V1_read_line_ogr ( struct Map_info Map,
struct line_pnts line_p,
struct line_cats line_c,
off_t  offset 
)

Read feature from OGR layer at given offset (level 1 without topology)

This function implements random access on level 1.

Parameters
Mappointer to Map_info structure
[out]line_pcontainer used to store line points within (pointer line_pnts struct)
[out]line_ccontainer used to store line categories within (pointer line_cats struct)
offsetgiven offset
Returns
line type
0 dead line
-2 no more features
-1 on failure

Definition at line 179 of file read_ogr.c.

References _, Format_info_offset::array, Format_info_offset::array_num, Format_info_ogr::cache, Format_info_ogr::feature_cache, Format_info_cache::fid, Map_info::fInfo, G_debug(), G_fatal_error(), G_warning(), Format_info_ogr::layer, NULL, Format_info_ogr::offset, Format_info::ogr, Vect_cat_set(), Vect_reset_cats(), and Vect_reset_line().

Referenced by V1_rewrite_line_ogr(), and V2_read_line_sfa().

int V1_read_next_line_ogr ( struct Map_info Map,
struct line_pnts line_p,
struct line_cats line_c 
)

Read next feature from OGR layer. Skip empty features (level 1 without topology).

This function implements sequential access.

The action of this routine can be modified by:

Parameters
Mappointer to Map_info structure
[out]line_pcontainer used to store line points within
[out]line_ccontainer used to store line categories within
Returns
feature type
-2 no more features (EOF)
-1 out of memory

Definition at line 50 of file read_ogr.c.

References _, FALSE, and G_fatal_error().

int V2_read_next_line_ogr ( struct Map_info Map,
struct line_pnts line_p,
struct line_cats line_c 
)

Read next feature from OGR layer on topological level.

This function implements sequential access.

Parameters
Mappointer to Map_info structure
[out]line_pcontainer used to store line points within (pointer to line_pnts struct)
[out]line_ccontainer used to store line categories within (pointer to line_cats struct)
Returns
feature type
-2 no more features (EOF)
-1 on failure

Definition at line 76 of file read_ogr.c.

References _, P_topo_c::area, boxlist::box, Map_info::constraint, dig_init_boxlist(), bound_box::E, G_debug(), G_fatal_error(), GV_CENTROID, boxlist::id, Plus_head::Line, bound_box::N, Plus_head::n_lines, boxlist::n_values, Map_info::next_line, NULL, P_line::offset, Map_info::plus, Map_info::region_flag, P_line::topo, TRUE, Map_info::type, P_line::type, Map_info::type_flag, Vect_append_point(), Vect_box_overlap(), Vect_cat_set(), Vect_get_area_box(), Vect_get_constraint_box(), Vect_line_box(), Vect_reset_cats(), Vect_reset_line(), and Vect_select_lines_by_box().