args.c 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #include <grass/gis.h>
  2. #include <grass/glocale.h>
  3. #include "local_proto.h"
  4. void define_options(struct params *params, struct flags *flags)
  5. {
  6. params->input = G_define_standard_option(G_OPT_V_INPUT);
  7. params->input->description = NULL;
  8. params->type = G_define_standard_option(G_OPT_V3_TYPE);
  9. params->type->options =
  10. "point,line,boundary,centroid,area,face,kernel,auto";
  11. params->type->answer = "auto";
  12. params->type->guisection = _("Selection");
  13. params->layer = G_define_standard_option(G_OPT_V_FIELD);
  14. params->layer->description = NULL;
  15. params->layer->guisection = _("Selection");
  16. params->dsn = G_define_option();
  17. params->dsn->key = "output";
  18. params->dsn->type = TYPE_STRING;
  19. params->dsn->required = YES;
  20. params->dsn->label = _("Name for output PostGIS datasource");
  21. params->dsn->description =
  22. _("Starts with 'PG' prefix, eg. 'PG:dbname=grass'");
  23. params->olayer = G_define_option();
  24. params->olayer->key = "output_layer";
  25. params->olayer->type = TYPE_STRING;
  26. params->olayer->required = NO;
  27. params->olayer->key_desc = "name";
  28. params->olayer->label =
  29. _("Name for output PostGIS layer");
  30. params->olayer->description =
  31. _("If not specified, input name is used");
  32. params->olayer->guisection = _("Creation");
  33. params->olink = G_define_standard_option(G_OPT_V_OUTPUT);
  34. params->olink->key = "output_link";
  35. params->olink->required = NO;
  36. params->olink->label =
  37. _("Name for output vector map defined as a link to the PostGIS feature table");
  38. params->olink->description =
  39. _("If not specified, the vector link is not created. "
  40. "The link can be also manually created by 'v.external' module.");
  41. params->olink->guisection = _("Creation");
  42. params->opts = G_define_option();
  43. params->opts->key = "options";
  44. params->opts->label = _("Creation options");
  45. params->opts->description = _("Examples:\n"
  46. "\t\t'FID=cat': define feature id column 'cat'\n"
  47. "\t\t'GEOMETRY_NAME=wkb_geometry': define geometry column 'wkb_geometry'\n"
  48. "\t\t'SPATIAL_INDEX=NO': do not create spatial index on geometry column");
  49. params->opts->required = NO;
  50. params->opts->multiple = YES;
  51. params->opts->type = TYPE_STRING;
  52. params->opts->key_desc = "key=value";
  53. params->opts->guisection = _("Creation");
  54. flags->table = G_define_flag();
  55. flags->table->key = 't';
  56. flags->table->description =
  57. _("Do not export attribute table");
  58. flags->table->guisection = _("Creation");
  59. flags->topo = G_define_flag();
  60. flags->topo->key = 'l';
  61. flags->topo->description =
  62. _("Export PostGIS topology instead of simple features");
  63. flags->topo->guisection = _("Creation");
  64. flags->force2d = G_define_flag();
  65. flags->force2d->key = '2';
  66. flags->force2d->label = _("Force 2D output even if input is 3D ");
  67. flags->force2d->description = _("Useful if input is 3D but all z coordinates are identical");
  68. flags->force2d->guisection = _("Creation");
  69. }