printf(_( " -i Use int4 type for all integer dbf fields.\n" ));
printf(_( " -I Create a spatial index on the geocolumn.\n" ));
printf(_( " -S Generate simple geometries instead of MULTI geometries.\n" ));
+ printf(_( " -t <dimensionality> Force geometry to be one of '2D', '3DZ', '3DM', or '4D'\n" ));
printf(_( " -w Output WKT instead of WKB. Note that this can result in\n"
" coordinate drift.\n" ));
printf(_( " -W <encoding> Specify the character encoding of Shape's\n"
set_loader_config_defaults(config);
/* Keep the flag list alphabetic so it's easy to see what's left. */
- while ((c = pgis_getopt(argc, argv, "acdeg:iknps:wDGIN:ST:W:X:")) != EOF)
+ while ((c = pgis_getopt(argc, argv, "acdeg:iknps:t:wDGIN:ST:W:X:")) != EOF)
{
switch (c)
{
}
break;
+ case 't':
+ if ( strcasecmp(pgis_optarg,"2D") == 0 )
+ {
+ config->want_z = config->want_m = 0;
+ }
+ else if ( strcasecmp(pgis_optarg,"3DZ") == 0 )
+ {
+ config->want_z = 1;
+ config->want_m = 0;
+ }
+ else if ( strcasecmp(pgis_optarg,"3DM") == 0 )
+ {
+ config->want_z = 0;
+ config->want_m = 1;
+ }
+ else if ( strcasecmp(pgis_optarg,"4D") == 0 )
+ {
+ config->want_z = config->want_m = 1;
+ }
+ break;
+
case 'T':
config->tablespace = pgis_optarg;
break;
config->forceint4 = 0;
config->createindex = 0;
config->readshape = 1;
+ config->want_m = -1;
+ config->want_z = -1;
config->encoding = strdup(ENCODING_DEFAULT);
config->null_policy = POLICY_NULL_INSERT;
config->sr_id = SRID_UNKNOWN;
break;
}
+
+ /* Force M-handling if configured to do so */
+ if (state->config->want_m != -1)
+ state->has_m = state->config->want_m;
+
+ /* Force Z-handling if configured to do so */
+ if (state->config->want_z != -1)
+ state->has_z = state->config->want_z;
/* If in simple geometry mode, alter names for CREATE TABLE by skipping MULTI */
if (state->config->simple_geometries)