[GRASS-SVN] r51100 - grass/trunk/vector/v.in.ogr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 18 06:03:45 EDT 2012
Author: martinl
Date: 2012-03-18 03:03:45 -0700 (Sun, 18 Mar 2012)
New Revision: 51100
Modified:
grass/trunk/vector/v.in.ogr/main.c
Log:
v.in.ogr: reduce number of flags, remove extra flag for listing feature types (this job does v.external)
Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c 2012-03-17 20:56:32 UTC (rev 51099)
+++ grass/trunk/vector/v.in.ogr/main.c 2012-03-18 10:03:45 UTC (rev 51100)
@@ -54,7 +54,7 @@
struct Option *snap, *type, *outloc, *cnames;
} param;
struct _flag {
- struct Flag *list, *tlist, *no_clean, *z, *notab,
+ struct Flag *list, *no_clean, *z, *notab,
*region;
struct Flag *over, *extend, *formats, *tolower, *no_import;
} flag;
@@ -92,7 +92,6 @@
OGRGeometryH Ogr_geometry, Ogr_oRing, poSpatialFilter;
OGRSpatialReferenceH Ogr_projection;
OGREnvelope oExt;
- OGRwkbGeometryType Ogr_geom_type;
int OFTIntegerListlength;
@@ -208,25 +207,18 @@
"first is used for category column");
param.cnames->guisection = _("Attributes");
+ flag.formats = G_define_flag();
+ flag.formats->key = 'f';
+ flag.formats->description = _("List supported OGR formats and exit");
+ flag.formats->guisection = _("Print");
+ flag.formats->suppress_required = YES;
+
flag.list = G_define_flag();
flag.list->key = 'l';
flag.list->description = _("List available OGR layers in data source and exit");
- flag.list->suppress_required = YES;
flag.list->guisection = _("Print");
+ flag.list->suppress_required = YES;
- flag.tlist = G_define_flag();
- flag.tlist->key = 'a';
- flag.tlist->description = _("List available OGR layers including feature types "
- "in data source and exit");
- flag.tlist->suppress_required = YES;
- flag.tlist->guisection = _("Print");
-
- flag.formats = G_define_flag();
- flag.formats->key = 'f';
- flag.formats->description = _("List supported formats and exit");
- flag.formats->suppress_required = YES;
- flag.formats->guisection = _("Print");
-
/* if using -c, you lose topological information ! */
flag.no_clean = G_define_flag();
flag.no_clean->key = 'c';
@@ -335,25 +327,21 @@
available_layer_names =
(char **)G_malloc(navailable_layers * sizeof(char *));
- if (flag.list->answer || flag.tlist->answer)
+ if (flag.list->answer)
G_message(_("Data source <%s> (format '%s') contains %d layers:"),
param.dsn->answer,
OGR_Dr_GetName(OGR_DS_GetDriver(Ogr_ds)), navailable_layers);
for (i = 0; i < navailable_layers; i++) {
Ogr_layer = OGR_DS_GetLayer(Ogr_ds, i);
Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer);
- Ogr_geom_type = OGR_FD_GetGeomType(Ogr_featuredefn);
available_layer_names[i] =
G_store((char *)OGR_FD_GetName(Ogr_featuredefn));
- if (flag.tlist->answer)
- fprintf(stdout, "%s (%s)\n", available_layer_names[i],
- OGRGeometryTypeToName(Ogr_geom_type));
- else if (flag.list->answer)
+ if (flag.list->answer)
fprintf(stdout, "%s\n", available_layer_names[i]);
}
- if (flag.list->answer || flag.tlist->answer) {
+ if (flag.list->answer) {
fflush(stdout);
exit(EXIT_SUCCESS);
}
More information about the grass-commit
mailing list