28 #include <cpl_error.h> 31 #include "local_proto.h" 58 G_debug(1,
"Vect_build_ogr(): dsn='%s' layer='%s', build=%d",
61 if (build == plus->
built)
71 if (!ogr_info->
layer) {
72 G_warning(
_(
"Empty OGR layer, nothing to build"));
76 if (OGR_L_TestCapability(ogr_info->
layer, OLCTransactions)) {
77 CPLPushErrorHandler(CPLQuietErrorHandler);
78 if (OGR_L_CommitTransaction(ogr_info->
layer) != OGRERR_NONE)
79 G_debug(1,
"Unable to commit transaction");
80 CPLPushErrorHandler(CPLDefaultErrorHandler);
84 if (!OGR_L_TestCapability(ogr_info->
layer, OLCRandomRead)) {
85 if (strcmp(OGR_Dr_GetName(OGR_DS_GetDriver(Map->
fInfo.
ogr.
ds)),
87 G_warning(
_(
"Feature table <%s> has no primary key defined"),
89 G_warning(
_(
"Random read is not supported by OGR for this layer. " 90 "Unable to build topology."));
95 G_message(
_(
"Using external data format '%s' (feature type '%s')"),
135 G_debug(4,
"Open fidx: %s", fname);
137 fp.
file = fopen(fname,
"w");
139 G_warning(
_(
"Unable to open fidx file for write <%s>"), fname);
char * name
Map name (for 4.0)
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
int built
Highest level of topology currently available.
char * Vect__get_element_path(char *file_path, const struct Map_info *Map, const char *element)
Get map element full path (internal use only)
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
#define GV_DIRECTORY
Name of vector directory.
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
#define GV_BUILD_BASE
Topology levels - basic level (without areas and isles)
int Vect_build_ogr(struct Map_info *Map, int build)
Build pseudo-topology (simple features) for OGR layer.
void G_free(void *)
Free allocated memory.
struct Format_info fInfo
Format info for non-native formats.
#define GV_BUILD_NONE
Topology levels - nothing to build.
void G_message(const char *,...) __attribute__((format(printf
Basic topology-related info.
int Vect_save_fidx(struct Map_info *Map, struct Format_info_offset *offset)
Save feature index file for vector map.
struct Plus_head plus
Plus info (topology, version, ...)
void dig_file_init(struct gvfile *file)
Initialize gvfile strcuture.
int Vect__build_sfa(struct Map_info *, int)
Build pseudo-topology (for simple features) - internal use only.
char * mapset
Mapset name.
int support_updated
Support files were updated.
FILE * file
File descriptor.
int dig__byte_order_out()
Get byte order.
const char * G_mapset(void)
Get current mapset name.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_warning(const char *,...) __attribute__((format(printf
const char * Vect_get_finfo_geometry_type(const struct Map_info *)
Get geometry type as string (relevant only for non-native formats)
const char * Vect_get_finfo_format_info(const struct Map_info *)
Get format info as string (relevant only for non-native formats)
#define GV_BUILD_ALL
Topology levels - build everything (currently same as GV_BUILD_CENTROIDS)
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
#define GV_FIDX_ELEMENT
External format (OGR), feature index.
int G_debug(int, const char *,...) __attribute__((format(printf