[GRASS-SVN] r56361 - grass/trunk/vector/v.out.ogr
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 22 08:50:53 PDT 2013
Author: martinl
Date: 2013-05-22 08:50:53 -0700 (Wed, 22 May 2013)
New Revision: 56361
Modified:
grass/trunk/vector/v.out.ogr/args.c
grass/trunk/vector/v.out.ogr/local_proto.h
grass/trunk/vector/v.out.ogr/main.c
Log:
v.out.ogr: change logic for 3D data (sync with v.in.ogr)
if input is 3D then output is also 3D (currently only Shapefiles supported)
Modified: grass/trunk/vector/v.out.ogr/args.c
===================================================================
--- grass/trunk/vector/v.out.ogr/args.c 2013-05-22 15:45:15 UTC (rev 56360)
+++ grass/trunk/vector/v.out.ogr/args.c 2013-05-22 15:50:53 UTC (rev 56361)
@@ -95,11 +95,12 @@
"(applies to Shapefile output only)");
flags->esristyle->guisection = _("Creation");
- flags->shapez = G_define_flag();
- flags->shapez->key = 'z';
- flags->shapez->description = _("Create 3D output if input is 3D "
- "(applies to Shapefile output only)");
- flags->shapez->guisection = _("Creation");
+ flags->force2d = G_define_flag();
+ flags->force2d->key = '2';
+ flags->force2d->label = _("Force 2D output even if input is 3D "
+ "(applies to Shapefile output only)");
+ flags->force2d->description = _("Useful if input is 3D but all z coordinates are identical");
+ flags->force2d->guisection = _("Creation");
flags->poly = G_define_flag();
flags->poly->key = 'p';
Modified: grass/trunk/vector/v.out.ogr/local_proto.h
===================================================================
--- grass/trunk/vector/v.out.ogr/local_proto.h 2013-05-22 15:45:15 UTC (rev 56360)
+++ grass/trunk/vector/v.out.ogr/local_proto.h 2013-05-22 15:50:53 UTC (rev 56361)
@@ -16,7 +16,7 @@
};
struct Flags {
- struct Flag *cat, *esristyle, *poly, *update, *nocat, *new, *append, *shapez;
+ struct Flag *cat, *esristyle, *poly, *update, *nocat, *new, *append, *force2d;
};
/* args.c */
Modified: grass/trunk/vector/v.out.ogr/main.c
===================================================================
--- grass/trunk/vector/v.out.ogr/main.c 2013-05-22 15:45:15 UTC (rev 56360)
+++ grass/trunk/vector/v.out.ogr/main.c 2013-05-22 15:50:53 UTC (rev 56361)
@@ -462,10 +462,11 @@
flags.append->answer = FALSE;
}
- /* Automatically append driver options for 3D output to
- layer creation options if 'z' is given.*/
- if ((flags.shapez->answer) && (Vect_is_3d(&In)) && (strcmp(options.format->answer,
- "ESRI_Shapefile") == 0)) {
+ /* Automatically append driver options for 3D output to layer
+ creation options if '2' is not given.*/
+ if (!flags.force2d->answer &&
+ Vect_is_3d(&In) &&
+ strcmp(options.format->answer, "ESRI_Shapefile") == 0) {
/* find right option */
char shape_geom[20];
if ((otype & GV_POINTS) || (otype & GV_KERNEL))
More information about the grass-commit
mailing list