25 #include <sys/types.h>
33 G_warning(
"Vect_write_line() %s",
_(
"for this format/level not supported"));
43 _(
"for this format/level not supported"));
50 _(
"for this format/level not supported"));
58 _(
"for this format/level not supported"));
62 #if !defined HAVE_OGR || !defined HAVE_POSTGRES
65 G_fatal_error(
_(
"Requested format is not compiled in this version"));
72 G_fatal_error(
_(
"Requested format is not compiled in this version"));
80 G_fatal_error(
_(
"Requested format is not compiled in this version"));
88 G_fatal_error(
_(
"Requested format is not compiled in this version"));
93 static off_t (*Vect_write_line_array[][3])(
struct Map_info *, int,
103 {write_dummy, format_l, format_l},
104 {write_dummy, format_l, format_l}
111 {write_dummy, format_l, format_l}
115 static off_t (*Vect_rewrite_line_array[][3])(
struct Map_info *, off_t, int,
125 {rewrite_dummy, format_l2, format_l2},
126 {rewrite_dummy, format_l2, format_l2}
133 {rewrite_dummy, format_l2, format_l2}
137 static int (*Vect_delete_line_array[][3])(
struct Map_info *, off_t) = {
157 static int (*Vect_restore_line_array[][3])(
struct Map_info *, off_t, off_t) = {
161 {restore_dummy, restore_dummy, restore_dummy},
162 {restore_dummy, restore_dummy, restore_dummy}
165 {restore_dummy, format2, format2},
166 {restore_dummy, format2, format2}
170 {restore_dummy, restore_dummy, restore_dummy}
173 {restore_dummy, format2, format2}
177 static int check_map(
struct Map_info *);
202 G_debug(3,
"Vect_write_line(): name = %s, format = %d, level = %d",
212 G_warning(
_(
"Unable to write feature in vector map <%s>"),
245 "Vect_rewrite_line(): name = %s, format = %d, level = %d, "
246 "line/offset = %" PRId64,
252 ret = (*Vect_rewrite_line_array[Map->
format][Map->
level])(Map, line,
type,
255 G_warning(
_(
"Unable to rewrite feature/offset %" PRId64
256 " in vector map <%s>"),
279 G_debug(3,
"Vect_delete_line(): name = %s, line/offset = %" PRId64,
285 ret = (*Vect_delete_line_array[Map->
format][Map->
level])(Map, line);
288 G_warning(
_(
"Unable to delete feature/offset %" PRId64
289 " from vector map <%s>"),
314 "Vect_restore_line(): name = %s, level = %d, offset = %" PRId64
322 (*Vect_restore_line_array[Map->
format][Map->
level])(Map, offset, line);
325 G_warning(
_(
"Unable to restore feature/offset %" PRId64
326 " in vector map <%s>"),
340 G_warning(
_(
"Vector map <%s> is not opened in write mode"),
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
off_t V1_rewrite_line_ogr(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at the given offset on level 1 (OGR interface)
off_t V2_write_line_sfa(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on level 2 (OGR/PostGIS interface, pseudo-topological level)
int V1_delete_line_pg(struct Map_info *, off_t)
off_t V1_write_line_nat(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature to 'coor' file at level 1 (internal use only)
off_t V1_write_line_ogr(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on level 1 (OGR interface)
int V2_delete_line_pg(struct Map_info *, off_t)
off_t V2_write_line_pg(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
off_t V2_rewrite_line_sfa(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at the given offset on level 2 (OGR/PostGIS interface, pseudo-topological level)
off_t V2_write_line_nat(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature to 'coor' file at topological level (internal use only)
int V2_delete_line_nat(struct Map_info *, off_t)
Deletes feature at topological level (internal use only)
int V1_restore_line_nat(struct Map_info *, off_t, off_t)
Restores feature at level 1 (internal use only)
int V1_delete_line_ogr(struct Map_info *, off_t)
Deletes feature at the given offset on level 1 (OGR interface)
off_t V2_rewrite_line_nat(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature to 'coor' file at topological level (internal use only)
off_t V1_rewrite_line_nat(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature to 'coor' file at level 1 (internal use only)
const char * Vect_get_name(struct Map_info *)
Get name of vector map.
int V2_restore_line_nat(struct Map_info *, off_t, off_t)
Restores feature at topological level (internal use only)
int V1_delete_line_nat(struct Map_info *, off_t)
Deletes feature at level 1 (internal use only)
off_t V2_rewrite_line_pg(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
int V2_delete_line_sfa(struct Map_info *, off_t)
Deletes feature on level 2 (OGR/PostGIS interface)
off_t V1_write_line_pg(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
off_t V1_rewrite_line_pg(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
#define VECT_OPEN(Map)
Check if vector map is open.
#define GV_MODE_WRITE
Write vector map open mode.
#define GV_MODE_RW
Read-write vector map open mode.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
char * name
Map name (for 4.0)
int type
Feature type constraint.
int format
Map format (native, ogr, postgis)
Feature geometry info - coordinates.
int Vect_delete_line(struct Map_info *Map, off_t line)
Delete existing feature (topological level required)
off_t Vect_write_line(struct Map_info *Map, int type, const struct line_pnts *points, const struct line_cats *cats)
Writes a new feature.
int Vect_restore_line(struct Map_info *Map, off_t offset, off_t line)
Restore previously deleted feature (topological level required)
off_t Vect_rewrite_line(struct Map_info *Map, off_t line, int type, const struct line_pnts *points, const struct line_cats *cats)
Rewrites existing feature (topological level required)