Changeset 52274


Ignore:
Timestamp:
Jul 1, 2012 10:08:54 AM (4 years ago)
Author:
mmetz
Message:

v.in.ogr: destroy OGRDataset; restore -l flag because v.external is not working properly (no attributes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/vector/v.in.ogr/main.c

    r51177 r52274  
    9393    OGRSpatialReferenceH Ogr_projection;
    9494    OGREnvelope oExt;
     95    OGRwkbGeometryType Ogr_geom_type;
    9596
    9697    int OFTIntegerListlength;
     
    216217    flag.list = G_define_flag();
    217218    flag.list->key = 'l';
    218     flag.list->description = _("List available OGR layers in data source and exit");
     219    flag.list->description = _("List available OGR layers including feature types "
     220                                "in data source and exit");
    219221    flag.list->guisection = _("Print");
    220222    flag.list->suppress_required = YES;
     
    333335        Ogr_layer = OGR_DS_GetLayer(Ogr_ds, i);
    334336        Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer);
     337        Ogr_geom_type = OGR_FD_GetGeomType(Ogr_featuredefn);
    335338       
    336339        available_layer_names[i] =
     
    338341
    339342        if (flag.list->answer)
    340             fprintf(stdout, "%s\n", available_layer_names[i]);
     343            fprintf(stdout, "%s (%s)\n", available_layer_names[i],
     344                    OGRGeometryTypeToName(Ogr_geom_type));
    341345    }
    342346    if (flag.list->answer) {
    343347        fflush(stdout);
     348        OGR_DS_Destroy(Ogr_ds);
    344349        exit(EXIT_SUCCESS);
    345350    }
     
    513518        if(flag.no_import->answer)
    514519        {
     520            OGR_DS_Destroy(Ogr_ds);
    515521            exit(EXIT_SUCCESS);
    516522        }
     
    11971203    }
    11981204
    1199     /* needed?
    1200      * OGR_DS_Destroy( Ogr_ds );
    1201      */
     1205    OGR_DS_Destroy(Ogr_ds);
    12021206
    12031207    if (use_tmp_vect) {
Note: See TracChangeset for help on using the changeset viewer.