41 G_warning(
_(
"GRASS is not compiled with OGR support"));
47 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
52 G_debug(1,
"Native vector format detected for <%s>",
80 G_warning(
_(
"GRASS is not compiled with OGR support"));
86 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
92 G_debug(1,
"Native vector format detected for <%s>",
112 G_warning(
_(
"GRASS is not compiled with OGR support"));
117 return OGR_Dr_GetName(OGR_DS_GetDriver(Map->
fInfo.
ogr.
ds));
122 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
146 char *ftype, *ftype_tmp;
148 ftype_tmp = ftype =
NULL;
151 G_warning(
_(
"GRASS is not compiled with OGR support"));
153 OGRwkbGeometryType Ogr_geom_type;
154 OGRFeatureDefnH Ogr_feature_defn;
162 Ogr_geom_type = wkbFlatten(OGR_FD_GetGeomType(Ogr_feature_defn));
164 ftype_tmp =
G_store(OGRGeometryTypeToName(Ogr_geom_type));
168 #ifndef HAVE_POSTGRES
169 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
179 "SELECT type,coord_dimension FROM geometry_columns "
180 "WHERE f_table_schema = '%s' AND f_table_name = '%s'",
184 res = PQexec(pg_info->
conn, stmt);
185 if (!
res || PQresultStatus(
res) != PGRES_TUPLES_OK ||
186 PQntuples(
res) != 1) {
187 G_debug(1,
"Unable to get feature type: %s",
188 PQresultErrorMessage(
res));
192 dim = atoi(PQgetvalue(
res, 0, 1));
207 ftype_tmp = (
char *)
G_malloc(3 + strlen(ftype) + 1);
208 sprintf(ftype_tmp,
"3D %s", ftype);
230 return &(Map->
fInfo);
248 char **topogeom,
int *topo_geo_only)
252 G_warning(
_(
"GRASS is not compiled with OGR support"));
void G_free(void *)
Free allocated memory.
void G_warning(const char *,...) __attribute__((format(printf
char * G_str_replace(const char *, const char *, const char *)
Replace all occurrences of old_str in buffer with new_str.
int G_asprintf(char **, const char *,...) __attribute__((format(printf
void G_str_to_lower(char *)
Convert string to lower case.
int G_debug(int, const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.
const char * Vect_get_full_name(struct Map_info *)
Get fully qualified name of vector map.
#define GV_FORMAT_POSTGIS
PostGIS format.
#define GV_TOPO_POSTGIS
PostGIS topology - external PostGIS format.
#define GV_TOPO_NATIVE
GRASS topology - native format.
#define GV_FORMAT_OGR_DIRECT
OGR format (direct access)
#define GV_FORMAT_OGR
OGR format.
#define GV_TOPO_PSEUDO
Pseudo-topology - external simple features (OGR/PostGIS) format.
int format
Map format (native, ogr, postgis)
struct Format_info fInfo
Format info for non-native formats.