41 G_warning(
_(
"GRASS is not compiled with OGR support"));
47 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
53 G_debug(1,
"Native vector format detected for <%s>", mname);
81 G_warning(
_(
"GRASS is not compiled with OGR support"));
87 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
94 G_debug(1,
"Native vector format detected for <%s>", mname);
114 G_warning(
_(
"GRASS is not compiled with OGR support"));
119 return OGR_Dr_GetName(OGR_DS_GetDriver(Map->
fInfo.
ogr.
ds));
124 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
148 char *ftype, *ftype_tmp;
150 ftype_tmp = ftype =
NULL;
153 G_warning(
_(
"GRASS is not compiled with OGR support"));
155 OGRwkbGeometryType Ogr_geom_type;
156 OGRFeatureDefnH Ogr_feature_defn;
164 Ogr_geom_type = wkbFlatten(OGR_FD_GetGeomType(Ogr_feature_defn));
166 ftype_tmp =
G_store(OGRGeometryTypeToName(Ogr_geom_type));
170 #ifndef HAVE_POSTGRES
171 G_warning(
_(
"GRASS is not compiled with PostgreSQL support"));
181 "SELECT type,coord_dimension FROM geometry_columns "
182 "WHERE f_table_schema = '%s' AND f_table_name = '%s'",
186 res = PQexec(pg_info->
conn, stmt);
187 if (!
res || PQresultStatus(
res) != PGRES_TUPLES_OK ||
188 PQntuples(
res) != 1) {
189 G_debug(1,
"Unable to get feature type: %s",
190 PQresultErrorMessage(
res));
194 dim = atoi(PQgetvalue(
res, 0, 1));
209 ftype_tmp = (
char *)
G_malloc(3 + strlen(ftype) + 1);
210 sprintf(ftype_tmp,
"3D %s", ftype);
232 return &(Map->
fInfo);
250 char **topogeom,
int *topo_geo_only)
254 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.