示例#1
0
static GDALDataset *OGRILI1DriverOpen( GDALOpenInfo* poOpenInfo )

{
    if( poOpenInfo->eAccess == GA_Update ||
        (!poOpenInfo->bStatOK && strchr(poOpenInfo->pszFilename, ',') == NULL) )
        return NULL;

    if( poOpenInfo->fpL != NULL )
    {
        if( strstr((const char*)poOpenInfo->pabyHeader,"SCNT") == NULL )
        {
            return NULL;
        }
    }
    else if( poOpenInfo->bIsDirectory )
        return NULL;

    OGRILI1DataSource *poDS = new OGRILI1DataSource();

    if( !poDS->Open( poOpenInfo->pszFilename, poOpenInfo->papszOpenOptions,
                     TRUE )
        || poDS->GetLayerCount() == 0 )
    {
        delete poDS;
        return NULL;
    }

    return poDS;
}
示例#2
0
OGRDataSource *OGRILI1Driver::CreateDataSource( const char * pszName,
                                               char **papszOptions )

{
    OGRILI1DataSource    *poDS = new OGRILI1DataSource();

    if( !poDS->Create( pszName, papszOptions ) )
    {
        delete poDS;
        return NULL;
    }
    else
        return poDS;
}
示例#3
0
static GDALDataset *OGRILI1DriverCreate( const char * pszName,
                                    int nBands, int nXSize, int nYSize, GDALDataType eDT,
                                    char **papszOptions )

{
    OGRILI1DataSource    *poDS = new OGRILI1DataSource();

    if( !poDS->Create( pszName, papszOptions ) )
    {
        delete poDS;
        return NULL;
    }
    else
        return poDS;
}
示例#4
0
static GDALDataset *OGRILI1DriverCreate( const char * pszName,
                                         int /* nBands */,
                                         int /* nXSize */,
                                         int /* nYSize */,
                                         GDALDataType /* eDT */,
                                         char **papszOptions )
{
    OGRILI1DataSource *poDS = new OGRILI1DataSource();

    if( !poDS->Create( pszName, papszOptions ) )
    {
        delete poDS;
        return NULL;
    }

    return poDS;
}
示例#5
0
OGRDataSource *OGRILI1Driver::Open( const char * pszFilename,
                                   int bUpdate )

{
    OGRILI1DataSource    *poDS;

    if( bUpdate )
        return NULL;

    poDS = new OGRILI1DataSource();

    if( !poDS->Open( pszFilename, TRUE )
        || poDS->GetLayerCount() == 0 )
    {
        delete poDS;
        return NULL;
    }
    else
        return poDS;
}