ogr/ogr_fromepsg.cpp
static double
EPSGAngleStringToDD( const char * pszAngle, int nUOMAngle )

{
    double      dfAngle;
    
    if( nUOMAngle == 9110 )             /* DDD.MMSSsss */
    {
        char    *pszDecimal;
        
        dfAngle = ABS(atoi(pszAngle));
        pszDecimal = (char *) strchr(pszAngle,'.');
        if( pszDecimal != NULL && strlen(pszDecimal) > 1 )
        {
            char        szMinutes[3];
            char        szSeconds[64];

            szMinutes[0] = pszDecimal[1];
            if( pszDecimal[2] >= '0' && pszDecimal[2] <= '9' )
                szMinutes[1] = pszDecimal[2];
            else
                szMinutes[1] = '0';
            
            szMinutes[2] = '\0';
            dfAngle += atoi(szMinutes) / 60.0;

            if( strlen(pszDecimal) > 3 )
            {
                szSeconds[0] = pszDecimal[3];
                if( pszDecimal[4] >= '0' && pszDecimal[4] <= '9' )
                {
                    szSeconds[1] = pszDecimal[4];
                    szSeconds[2] = '.';
                    strcpy( szSeconds+3, pszDecimal + 5 );
                }
                else
                {
                    szSeconds[1] = '0';
                    szSeconds[2] = '\0';
                }
                dfAngle += atof(szSeconds) / 3600.0;
            }
        }

        if( pszAngle[0] == '-' )
            dfAngle *= -1;
    }
    else if( nUOMAngle == 9105 || nUOMAngle == 9106 )   /* grad */
    {
        dfAngle = 180 * (atof(pszAngle ) / 200);
    }
    else if( nUOMAngle == 9101 )                        /* radians */
    {
        dfAngle = 180 * (atof(pszAngle ) / PI);
    }
    else if( nUOMAngle == 9103 )                        /* arc-minute */
    {
        dfAngle = atof(pszAngle) / 60;
    }
    else if( nUOMAngle == 9104 )                        /* arc-second */
    {
        dfAngle = atof(pszAngle) / 3600;
    }
    else /* decimal degrees ... some cases missing but seeminly never used */
    {
        CPLAssert( nUOMAngle == 9102 || nUOMAngle == 0 );
        
        dfAngle = atof(pszAngle );
    }

    return( dfAngle );
}
/************************************************************************/
/*                        EPSGAngleStringToDD()                         */
/*                                                                      */
/*      Convert an angle in the specified units to decimal degrees.     */
/************************************************************************/
EPSGAngleStringToDD()
Convert an angle in the specified units to decimal degrees.
EPSGAngleStringToDD () Convert an angle in the specified units to decimal degrees .
static double
EPSGAngleStringToDD( const char * pszAngle, int nUOMAngle )
{
    double      dfAngle;
    if( nUOMAngle == 9110 )             
    {
        char    *pszDecimal;
        dfAngle = ABS(atoi(pszAngle));
        pszDecimal = (char *) strchr(pszAngle,'.');
        if( pszDecimal != NULL && strlen(pszDecimal) > 1 )
        {
            char        szMinutes[3];
            char        szSeconds[64];
            szMinutes[0] = pszDecimal[1];
            if( pszDecimal[2] >= '0' && pszDecimal[2] <= '9' )
                szMinutes[1] = pszDecimal[2];
            else
                szMinutes[1] = '0';
            szMinutes[2] = '\0';
            dfAngle += atoi(szMinutes) / 60.0;
            if( strlen(pszDecimal) > 3 )
            {
                szSeconds[0] = pszDecimal[3];
                if( pszDecimal[4] >= '0' && pszDecimal[4] <= '9' )
                {
                    szSeconds[1] = pszDecimal[4];
                    szSeconds[2] = '.';
                    strcpy( szSeconds+3, pszDecimal + 5 );
                }
                else
                {
                    szSeconds[1] = '0';
                    szSeconds[2] = '\0';
                }
                dfAngle += atof(szSeconds) / 3600.0;
            }
        }
        if( pszAngle[0] == '-' )
            dfAngle *= -1;
    }
    else if( nUOMAngle == 9105 || nUOMAngle == 9106 )   
    {
        dfAngle = 180 * (atof(pszAngle ) / 200);
    }
    else if( nUOMAngle == 9101 )                        
    {
        dfAngle = 180 * (atof(pszAngle ) / PI);
    }
    else if( nUOMAngle == 9103 )                        
    {
        dfAngle = atof(pszAngle) / 60;
    }
    else if( nUOMAngle == 9104 )                        
    {
        dfAngle = atof(pszAngle) / 3600;
    }
    else 
    {
        CPLAssert( nUOMAngle == 9102 || nUOMAngle == 0 );
        dfAngle = atof(pszAngle );
    }
    return( dfAngle );
}
static double EPSGAngleStringToDD ( const char * pszAngle , int nUOMAngle ) { double dfAngle ; if ( nUOMAngle == 9110 ) { char * pszDecimal ; dfAngle = ABS ( atoi ( pszAngle ) ) ; pszDecimal = ( char * ) strchr ( pszAngle , ' ' ) ; if ( pszDecimal != NULL && strlen ( pszDecimal ) > 1 ) { char szMinutes [ 3 ] ; char szSeconds [ 64 ] ; szMinutes [ 0 ] = pszDecimal [ 1 ] ; if ( pszDecimal [ 2 ] >= ' ' && pszDecimal [ 2 ] <= ' ' ) szMinutes [ 1 ] = pszDecimal [ 2 ] ; else szMinutes [ 1 ] = ' ' ; szMinutes [ 2 ] = ' \0 ' ; dfAngle += atoi ( szMinutes ) / 60.0 ; if ( strlen ( pszDecimal ) > 3 ) { szSeconds [ 0 ] = pszDecimal [ 3 ] ; if ( pszDecimal [ 4 ] >= ' ' && pszDecimal [ 4 ] <= ' ' ) { szSeconds [ 1 ] = pszDecimal [ 4 ] ; szSeconds [ 2 ] = ' ' ; strcpy ( szSeconds + 3 , pszDecimal + 5 ) ; } else { szSeconds [ 1 ] = ' ' ; szSeconds [ 2 ] = ' \0 ' ; } dfAngle += atof ( szSeconds ) / 3600.0 ; } } if ( pszAngle [ 0 ] == ' ' ) dfAngle *= -1 ; } else if ( nUOMAngle == 9105 || nUOMAngle == 9106 ) { dfAngle = 180 * ( atof ( pszAngle ) / 200 ) ; } else if ( nUOMAngle == 9101 ) { dfAngle = 180 * ( atof ( pszAngle ) / PI ) ; } else if ( nUOMAngle == 9103 ) { dfAngle = atof ( pszAngle ) / 60 ; } else if ( nUOMAngle == 9104 ) { dfAngle = atof ( pszAngle ) / 3600 ; } else { CPLAssert ( nUOMAngle == 9102 || nUOMAngle == 0 ) ; dfAngle = atof ( pszAngle ) ; } return ( dfAngle ) ; }
EPSGAngleStringToDD()
Convert an angle in the specified units to decimal degrees.
EPSGAngleStringToDD () Convert an angle in the specified units to decimal degrees .
/* DDD.MMSSsss */ /* grad */ /* radians */ /* arc-minute */ /* arc-second */ /* decimal degrees ... some cases missing but seeminly never used */