Пример #1
0
int TigerPolygon::SetModule( const char * pszModule )

{
    if( !OpenFile( pszModule, "A" ) )
        return FALSE;

    EstablishFeatureCount();
    
/* -------------------------------------------------------------------- */
/*      Open the RTS file                                               */
/* -------------------------------------------------------------------- */
    if( bUsingRTS )
    {
        if( fpRTS != NULL )
        {
            VSIFCloseL( fpRTS );
            fpRTS = NULL;
        }

        if( pszModule )
        {
            char        *pszFilename;
        
            pszFilename = poDS->BuildFilename( pszModule, "S" );

            fpRTS = VSIFOpenL( pszFilename, "rb" );

            CPLFree( pszFilename );

            nRTSRecLen = EstablishRecordLength( fpRTS );
        }
    }
    
    return TRUE;
}
int TigerPolygonCorrections::SetModule( const char * pszModule )

{
    if( !OpenFile( pszModule, FILE_CODE ) )
        return FALSE;

    EstablishFeatureCount();
    
    return TRUE;
}
Пример #3
0
int TigerZeroCellID::SetModule( const char * pszModule )

{
    if( !OpenFile( pszModule, FILE_CODE ) )
        return FALSE;

    EstablishFeatureCount();
    
    return TRUE;
}
int TigerAreaLandmarks::SetModule( const char * pszModule )

{
    if( !OpenFile( pszModule, FILE_CODE ) )
        return FALSE;

    EstablishFeatureCount();
    
    return TRUE;
}
Пример #5
0
int TigerFileBase::SetModule( const char * pszModuleIn )

{
    if (m_pszFileCode == NULL)
        return FALSE;

    if( !OpenFile( pszModuleIn, m_pszFileCode ) )
        return FALSE;

    EstablishFeatureCount();

    return TRUE;
}
Пример #6
0
int TigerCompleteChain::SetModule( const char * pszModule )

{
    if( !OpenFile( pszModule, "1" ) )
        return FALSE;

    EstablishFeatureCount();

/* -------------------------------------------------------------------- */
/*      Is this a copyright record inserted at the beginning of the     */
/*      RT1 file by the folks at GDT?  If so, setup to ignore the       */
/*      first record.                                                   */
/* -------------------------------------------------------------------- */
    nRT1RecOffset = 0;
    if( pszModule )
    {
        char achHeader[10];
        
        VSIFSeekL( fpPrimary, 0, SEEK_SET );
        VSIFReadL( achHeader, sizeof(achHeader), 1, fpPrimary );
        
        if( EQUALN(achHeader,"Copyright",8) )
        {
            nRT1RecOffset = 1;
            nFeatures--;
        }
    }
        
/* -------------------------------------------------------------------- */
/*      Open the RT3 file                                               */
/* -------------------------------------------------------------------- */
    if( bUsingRT3 )
    {
        if( fpRT3 != NULL )
        {
            VSIFCloseL( fpRT3 );
            fpRT3 = NULL;
        }

        if( pszModule )
        {
            char        *pszFilename;
        
            pszFilename = poDS->BuildFilename( pszModule, "3" );

            fpRT3 = VSIFOpenL( pszFilename, "rb" );

            CPLFree( pszFilename );
        }
    }
    
/* -------------------------------------------------------------------- */
/*      Close the shape point file, if open and free the list of        */
/*      record ids.                                                     */
/* -------------------------------------------------------------------- */
    if( fpShape != NULL )
    {
        VSIFCloseL( fpShape );
        fpShape = NULL;
    }
    
    CPLFree( panShapeRecordId );
    panShapeRecordId = NULL;

/* -------------------------------------------------------------------- */
/*      Try to open the RT2 file corresponding to this RT1 file.        */
/* -------------------------------------------------------------------- */
    if( pszModule != NULL )
    {
        char    *pszFilename;

        pszFilename = poDS->BuildFilename( pszModule, "2" );

        fpShape = VSIFOpenL( pszFilename, "rb" );
        
        if( fpShape == NULL )
        {
            if( nRT1RecOffset == 0 )
                CPLError( CE_Warning, CPLE_OpenFailed,
                          "Failed to open %s, intermediate shape arcs will not be available.\n",
                          pszFilename );
        }
        else
            panShapeRecordId = (int *)CPLCalloc(sizeof(int),GetFeatureCount());
        
        CPLFree( pszFilename );
    }

    return TRUE;
}