Changeset 23331


Ignore:
Timestamp:
Nov 5, 2011 2:45:15 PM (5 years ago)
Author:
rouault
Message:

PCIDSK: in read-only, if .pix is raster (resp. vector) only, then make sure that OGR (resp. GDAL) cannot open it

Location:
trunk/gdal
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gdal/frmts/pcidsk/pcidskdataset2.cpp

    r22331 r23331  
    17341734        }
    17351735
     1736        /* Check if this is a vector-only PCIDSK file */
     1737        if( poFile->GetChannels() == 0 &&
     1738            poFile->GetSegment( PCIDSK::SEG_VEC, "" ) != NULL )
     1739        {
     1740            return NULL;
     1741        }
     1742
    17361743        return LLOpen( poOpenInfo->pszFilename, poFile, poOpenInfo->eAccess );
    17371744    }
  • trunk/gdal/ogr/ogrsf_frmts/pcidsk/ogrpcidskdatasource.cpp

    r21684 r23331  
    128128            apoLayers.push_back( new OGRPCIDSKLayer( segobj, bUpdate ) );
    129129        }
     130
     131        /* Check if this is a raster-only PCIDSK file */
     132        if ( !bUpdate && apoLayers.size() == 0 && poFile->GetChannels() != 0 )
     133            return FALSE;
    130134    }
    131135
     
    146150    }
    147151
    148 /* -------------------------------------------------------------------- */
    149 /*      We presume that this is indeed intended to be a PCIDSK          */
    150 /*      datasource if over half the files were .csv files.              */
    151 /* -------------------------------------------------------------------- */
    152152    return TRUE;
    153153}
Note: See TracChangeset for help on using the changeset viewer.