Beispiel #1
0
OGRDataSource *OGRS57Driver::CreateDataSource( const char *pszName, 
                                               char **papszOptions )

{
    OGRS57DataSource *poDS = new OGRS57DataSource();

    if( poDS->Create( pszName, papszOptions ) )
        return poDS;
    else
    {
        delete poDS;
        return NULL;
    }
}
Beispiel #2
0
GDALDataset *OGRS57Driver::Create( const char * pszName,
                                   int /* nBands */,
                                   int /* nXSize */,
                                   int /* nYSize */,
                                   GDALDataType /* eDT */,
                                   char **papszOptions )
{
    OGRS57DataSource *poDS = new OGRS57DataSource();

    if( poDS->Create( pszName, papszOptions ) )
        return poDS;

    delete poDS;
    return NULL;
}
Beispiel #3
0
GDALDataset *OGRS57Driver::Create( const char * pszName,
                                   CPL_UNUSED int nBands,
                                   CPL_UNUSED int nXSize,
                                   CPL_UNUSED int nYSize,
                                   CPL_UNUSED GDALDataType eDT,
                                   char **papszOptions )
{
    OGRS57DataSource *poDS = new OGRS57DataSource();

    if( poDS->Create( pszName, papszOptions ) )
        return poDS;
    else
    {
        delete poDS;
        return NULL;
    }
}
Beispiel #4
0
OGRDataSource *OGRS57Driver::Open( const char * pszFilename, int bUpdate )

{
    OGRS57DataSource    *poDS;

    poDS = new OGRS57DataSource;
    if( !poDS->Open( pszFilename, TRUE ) )
    {
        delete poDS;
        poDS = NULL;
    }

    if( poDS && bUpdate )
    {
        delete poDS;
        CPLError( CE_Failure, CPLE_OpenFailed,
                  "S57 Driver doesn't support update." );
        return NULL;
    }

    return poDS;
}
Beispiel #5
0
GDALDataset *OGRS57Driver::Open( GDALOpenInfo* poOpenInfo )

{
    if( !OGRS57DriverIdentify(poOpenInfo) )
        return NULL;

    OGRS57DataSource *poDS = new OGRS57DataSource(poOpenInfo->papszOpenOptions);
    if( !poDS->Open( poOpenInfo->pszFilename ) )
    {
        delete poDS;
        poDS = NULL;
    }

    if( poDS && poOpenInfo->eAccess == GA_Update )
    {
        delete poDS;
        CPLError( CE_Failure, CPLE_OpenFailed,
                  "S57 Driver doesn't support update." );
        return NULL;
    }

    return poDS;
}