|
@@ -69,10 +69,19 @@ int main(int argc, char *argv[])
|
|
G_fatal_error(_("'output' must be given for old version"));
|
|
G_fatal_error(_("'output' must be given for old version"));
|
|
}
|
|
}
|
|
|
|
|
|
- if (Vect_open_old2(&Map, input, "", field_name) < 2) /* topology required for areas */
|
|
|
|
- G_warning(_("Unable to open vector map <%s> at topology level. "
|
|
|
|
- "Areas will not be processed."),
|
|
|
|
- input);
|
|
|
|
|
|
+ /* open with topology only if needed */
|
|
|
|
+ if (format == GV_ASCII_FORMAT_WKT || (format == GV_ASCII_FORMAT_STD &&
|
|
|
|
+ (where || clist))) {
|
|
|
|
+ if (Vect_open_old2(&Map, input, "", field_name) < 2) /* topology required for areas */
|
|
|
|
+ G_warning(_("Unable to open vector map <%s> at topology level. "
|
|
|
|
+ "Areas will not be processed."),
|
|
|
|
+ input);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ Vect_set_open_level(1); /* topology not needed */
|
|
|
|
+ if (Vect_open_old2(&Map, input, "", field_name) < 0)
|
|
|
|
+ G_fatal_error(_("Unable to open vector map <%s>"), input);
|
|
|
|
+ }
|
|
|
|
|
|
field = Vect_get_field_number(&Map, field_name);
|
|
field = Vect_get_field_number(&Map, field_name);
|
|
|
|
|