23 #include <sys/types.h> 27 static off_t write_dummy()
30 _(
"for this format/level not supported"));
33 static off_t rewrite_dummy()
36 _(
"for this format/level not supported"));
39 static int delete_dummy()
42 _(
"for this format/level not supported"));
46 static int restore_dummy()
49 _(
"for this format/level not supported"));
53 #if !defined HAVE_OGR || !defined HAVE_POSTGRES 56 G_fatal_error(
_(
"Requested format is not compiled in this version"));
60 static off_t format_l()
62 G_fatal_error(
_(
"Requested format is not compiled in this version"));
67 static off_t (*Vect_write_line_array[][3]) () = {
77 write_dummy, format_l, format_l}
79 write_dummy, format_l, format_l}
86 write_dummy, format_l, format_l}
90 static off_t (*Vect_rewrite_line_array[][3]) () = {
100 rewrite_dummy, format_l, format_l}
102 rewrite_dummy, format_l, format_l}
109 rewrite_dummy, format_l, format_l}
113 static int (*Vect_delete_line_array[][3]) () = {
123 delete_dummy, format, format}
125 delete_dummy, format, format}
132 delete_dummy, format, format}
136 static int (*Vect_restore_line_array[][3]) () = {
141 restore_dummy, restore_dummy, restore_dummy}
143 restore_dummy, restore_dummy, restore_dummy}
146 restore_dummy, format, format}
148 restore_dummy, format, format}
152 restore_dummy, restore_dummy, restore_dummy}
155 restore_dummy, format, format}
159 static int check_map(
const struct Map_info *);
183 G_debug(3,
"Vect_write_line(): name = %s, format = %d, level = %d",
190 (*Vect_write_line_array[Map->
format][Map->
level]) (Map, type,
194 G_warning(
_(
"Unable to write feature in vector map <%s>"),
225 G_debug(3,
"Vect_rewrite_line(): name = %s, format = %d, level = %d, line/offset = %" PRI_OFF_T,
231 ret = (*Vect_rewrite_line_array[Map->
format][Map->
level]) (Map, line, type,
263 ret = (*Vect_delete_line_array[Map->
format][Map->
level]) (Map, line);
296 ret = (*Vect_restore_line_array[Map->
format][Map->
level]) (Map, offset, line);
299 G_warning(
_(
"Unable to restore feature/offset %" PRI_OFF_T
" in vector map <%s>"),
305 int check_map(
const struct Map_info *Map)
313 G_warning(
_(
"Vector map <%s> is not opened in write mode"),
char * name
Map name (for 4.0)
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
int V2_delete_line_pg(struct Map_info *, off_t)
Deletes feature on topological level (PostGIS interface)
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)
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.
off_t V2_rewrite_line_pg(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at topological level (PostGIS interface, internal use only)
int V1_delete_line_pg(struct Map_info *, off_t)
Deletes feature at the given offset (level 1)
int V1_delete_line_ogr(struct Map_info *, off_t)
Deletes feature at the given offset on level 1 (OGR interface)
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)
int V2_restore_line_nat(struct Map_info *, off_t, off_t)
Restores feature at topological level (internal use only)
int Vect_delete_line(struct Map_info *Map, off_t line)
Delete existing feature (topological level required)
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)
#define GV_MODE_RW
Read-write vector map open mode.
off_t V1_write_line_pg(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on level 1 (PostGIS interface)
Feature geometry info - coordinates.
#define VECT_OPEN(Map)
Check if vector map is open.
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_pg(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at the given offset (level 1) (PostGIS interface, internal use only) ...
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 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)
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) ...
int V1_delete_line_nat(struct Map_info *, off_t)
Deletes feature at level 1 (internal use only)
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_restore_line_nat(struct Map_info *, off_t, off_t)
Restores feature at level 1 (internal use only)
int V2_delete_line_nat(struct Map_info *, off_t)
Deletes feature at topological level (internal use only)
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 Vect_restore_line(struct Map_info *Map, off_t offset, off_t line)
Restore previously deleted feature (topological level required)
void G_warning(const char *,...) __attribute__((format(printf
off_t V2_write_line_pg(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on topological level (PostGIS interface)
int format
Map format (native, ogr, postgis)
#define GV_MODE_WRITE
Write vector map open mode.
const char * Vect_get_name(const struct Map_info *)
Get name of vector map.
int G_debug(int, const char *,...) __attribute__((format(printf
int V2_delete_line_sfa(struct Map_info *, off_t)
Deletes feature on level 2 (OGR/PostGIS interface)