24static int get_line_type(
struct Map_info *,
long);
75 G_debug(3,
"V2_read_next_line_ogr()");
77 if (
Map->constraint.region_flag)
81 line =
Map->next_line;
83 if (
Map->next_line >
Map->plus.n_lines)
87 Line =
Map->plus.Line[line];
92 if (
Map->constraint.type_flag) {
94 if (!(Line->
type &
Map->constraint.type))
114 for (i = 0; i <
list.n_values; i++) {
115 if (
list.id[i] == line) {
137 if (
line_p &&
Map->constraint.region_flag) {
177 G_debug(3,
"V1_read_line_ogr(): offset = %lu offset_num = %lu",
195 G_debug(4,
"Read feature (fid = %ld) to cache", fid);
201 G_warning(
_(
"Unable to get feature geometry, fid %ld"), fid);
209 G_warning(
_(
"Unable to get feature geometry, fid %ld"), fid);
216 type = get_line_type(
Map, fid);
243 int line, i, np,
ng,
tp;
256 if (line ==
ogr_info->cache.lines_alloc) {
264 ogr_info->cache.lines_alloc *
sizeof(
int));
287 for (i = 0; i < np; i++) {
308 G_debug(4,
"%d geoms -> next level",
ng);
315 for (i = 0; i <
ng; i++) {
323 G_warning(
_(
"OGR feature type %d not supported"), type);
339 G_debug(3,
"V1_read_next_line_ogr()");
361 G_warning(
_(
"Feature without geometry. Skipped."));
388 if (!(
itype &
Map->constraint.type)) {
468 for (i = 0; i <
nPoints; i++) {
494 G_warning(
_(
"OGR feature type '%s' not supported"),
522 G_debug(4,
"get_line_type() fid = %ld", fid);
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_reset_cats(struct line_cats *)
Reset category structure to make sure cats structure is clean to be re-used.
void Vect_line_box(const struct line_pnts *, struct bound_box *)
Get bounding box of line.
int Vect_cat_set(struct line_cats *, int, int)
Add new field/cat to category structure if doesn't exist yet.
int Vect_get_constraint_box(struct Map_info *, struct bound_box *)
Get constraint box.
int Vect_box_overlap(const struct bound_box *, const struct bound_box *)
Tests for overlap of two boxes.
int Vect_get_area_box(struct Map_info *, int, struct bound_box *)
Get bounding box of area.
int Vect_select_lines_by_box(struct Map_info *, const struct bound_box *, int, struct boxlist *)
Select lines with bounding boxes by box.
void Vect_reset_line(struct line_pnts *)
Reset line.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
int Vect_append_points(struct line_pnts *, const struct line_pnts *, int)
Appends points to the end of a line.
#define GV_POINT
Feature types used in memory on run time (may change)
#define GV_FORWARD
Line direction indicator forward/backward.
int dig_init_boxlist(struct boxlist *, int)
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)
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).
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.
off_t offset
Offset in coor file for line.
void * topo
Topology info.
plus_t area
Area number, negative for duplicate centroid.
List of bounding boxes with id.
Feature geometry info - coordinates.