ogr/ogr_fromepsg.cpp
static int 
EPSGGetPMInfo( int nPMCode, char ** ppszName, double *pdfOffset )

{
    char        szSearchKey[24];
    int         nUOMAngle;

#define PM_FILENAME CSVFilename("prime_meridian.csv")

/* -------------------------------------------------------------------- */
/*      Use a special short cut for Greenwich, since it is so common.   */
/* -------------------------------------------------------------------- */
    if( nPMCode == 7022 /* PM_Greenwich */ )
    {
        if( pdfOffset != NULL )
            *pdfOffset = 0.0;
        if( ppszName != NULL )
            *ppszName = CPLStrdup( "Greenwich" );
        return TRUE;
    }

/* -------------------------------------------------------------------- */
/*      Search the database for the corresponding datum code.           */
/* -------------------------------------------------------------------- */
    sprintf( szSearchKey, "%d", nPMCode );

    nUOMAngle =
        atoi(CSVGetField( PM_FILENAME,
                          "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
                          "UOM_CODE" ) );
    if( nUOMAngle < 1 )
        return FALSE;

/* -------------------------------------------------------------------- */
/*      Get the PM offset.                                              */
/* -------------------------------------------------------------------- */
    if( pdfOffset != NULL )
    {
        *pdfOffset =
            EPSGAngleStringToDD(
                CSVGetField( PM_FILENAME,
                             "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
                             "GREENWICH_LONGITUDE" ),
                nUOMAngle );
    }
    
/* -------------------------------------------------------------------- */
/*      Get the name, if requested.                                     */
/* -------------------------------------------------------------------- */
    if( ppszName != NULL )
        *ppszName =
            CPLStrdup(
                CSVGetField( PM_FILENAME, 
                             "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
                             "PRIME_MERIDIAN_NAME" ));
    
    return( TRUE );
}
/************************************************************************/
/*                           EPSGGetPMInfo()                            */
/*                                                                      */
/*      Get the offset between a given prime meridian and Greenwich     */
/*      in degrees.                                                     */
/************************************************************************/
EPSGGetPMInfo()
Get the offset between a given prime meridian and Greenwich
in degrees.
EPSGGetPMInfo () Get the offset between a given prime meridian and Greenwich in degrees .
static int 
EPSGGetPMInfo( int nPMCode, char ** ppszName, double *pdfOffset )
{
    char        szSearchKey[24];
    int         nUOMAngle;
#define PM_FILENAME CSVFilename("prime_meridian.csv")
    if( nPMCode == 7022  )
    {
        if( pdfOffset != NULL )
            *pdfOffset = 0.0;
        if( ppszName != NULL )
            *ppszName = CPLStrdup( "Greenwich" );
        return TRUE;
    }
    sprintf( szSearchKey, "%d", nPMCode );
    nUOMAngle =
        atoi(CSVGetField( PM_FILENAME,
                          "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
                          "UOM_CODE" ) );
    if( nUOMAngle < 1 )
        return FALSE;
    if( pdfOffset != NULL )
    {
        *pdfOffset =
            EPSGAngleStringToDD(
                CSVGetField( PM_FILENAME,
                             "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
                             "GREENWICH_LONGITUDE" ),
                nUOMAngle );
    }
    if( ppszName != NULL )
        *ppszName =
            CPLStrdup(
                CSVGetField( PM_FILENAME, 
                             "PRIME_MERIDIAN_CODE", szSearchKey, CC_Integer,
                             "PRIME_MERIDIAN_NAME" ));
    return( TRUE );
}
static int EPSGGetPMInfo ( int nPMCode , char * * ppszName , double * pdfOffset ) { char szSearchKey [ 24 ] ; int nUOMAngle ; #define PM_FILENAME  CSVFilename("prime_meridian.csv") if ( nPMCode == 7022 ) { if ( pdfOffset != NULL ) * pdfOffset = 0.0 ; if ( ppszName != NULL ) * ppszName = CPLStrdup ( " " ) ; return TRUE ; } sprintf ( szSearchKey , " " , nPMCode ) ; nUOMAngle = atoi ( CSVGetField ( PM_FILENAME , " " , szSearchKey , CC_Integer , " " ) ) ; if ( nUOMAngle < 1 ) return FALSE ; if ( pdfOffset != NULL ) { * pdfOffset = EPSGAngleStringToDD ( CSVGetField ( PM_FILENAME , " " , szSearchKey , CC_Integer , " " ) , nUOMAngle ) ; } if ( ppszName != NULL ) * ppszName = CPLStrdup ( CSVGetField ( PM_FILENAME , " " , szSearchKey , CC_Integer , " " ) ) ; return ( TRUE ) ; }
EPSGGetPMInfo()
Get the offset between a given prime meridian and Greenwich
in degrees.
EPSGGetPMInfo () Get the offset between a given prime meridian and Greenwich in degrees .
/* -------------------------------------------------------------------- */ /*      Use a special short cut for Greenwich, since it is so common.   */ /* -------------------------------------------------------------------- */ /* PM_Greenwich */ /* -------------------------------------------------------------------- */ /*      Search the database for the corresponding datum code.           */ /* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */ /*      Get the PM offset.                                              */ /* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */ /*      Get the name, if requested.                                     */ /* -------------------------------------------------------------------- */