28 #include <cpl_error.h>
31 #include "local_proto.h"
58 G_debug(1,
"Vect_build_ogr(): dsn='%s' layer='%s', build=%d", ogr_info->
dsn,
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')"),
133 G_debug(4,
"Open fidx: %s", fname);
135 fp.
file = fopen(fname,
"w");
137 G_warning(
_(
"Unable to open fidx file for write <%s>"), fname);
int Vect_build_ogr(struct Map_info *Map, int build)
Build pseudo-topology (simple features) for OGR layer.
int Vect_save_fidx(struct Map_info *Map, struct Format_info_offset *offset)
Save feature index file for vector map.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
const char * G_mapset(void)
Get current mapset name.
void G_message(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect__build_sfa(struct Map_info *, int)
Build pseudo-topology (for simple features) - internal use only.
const char * Vect_get_finfo_format_info(struct Map_info *)
Get format info as string (relevant only for non-native formats)
const char * Vect_get_finfo_geometry_type(struct Map_info *)
Get geometry type as string (relevant only for non-native formats)
#define GV_BUILD_NONE
Topology levels - nothing to build.
#define GV_DIRECTORY
Name of vector directory.
#define GV_BUILD_BASE
Topology levels - basic level (without areas and isles)
#define GV_BUILD_ALL
Topology levels - build everything (currently same as GV_BUILD_CENTROIDS)
#define GV_FIDX_ELEMENT
External format (OGR), feature index.
int dig__byte_order_out(void)
Get byte order.
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
void dig_file_init(struct gvfile *file)
Initialize gvfile structure.
char * mapset
Mapset name.
int support_updated
Support files were updated.
char * name
Map name (for 4.0)
struct Format_info fInfo
Format info for non-native formats.
struct Plus_head plus
Plus info (topology, version, ...)
Basic topology-related info.
int built
Highest level of topology currently available.
FILE * file
File descriptor.
char * Vect__get_element_path(char *file_path, struct Map_info *Map, const char *element)
Get map element full path (internal use only)