亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cpl_conv.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
          case 'r': case 'R':
            if (nl) {
                return 0.0;
            }
            ++s;
            v = tv;
            goto skip;
          default:
            v += tv * vm[nl];
          skip: n = 4;
            continue;
        }
        if (n < nl) {
            return 0.0;
        }
        v += tv * vm[n];
        ++s;
    }
    /* postfix sign */
    if (*s && (p = (char *) strchr(sym, *s))) {
        sign = (p - sym) >= 4 ? '-' : '+';
        ++s;
    }
    if (sign == '-')
        v = -v;

    return v;
}


/************************************************************************/
/*                            CPLDecToDMS()                             */
/*                                                                      */
/*      Translate a decimal degrees value to a DMS string with          */
/*      hemisphere.                                                     */
/************************************************************************/

const char *CPLDecToDMS( double dfAngle, const char * pszAxis,
                         int nPrecision )

{
    int         nDegrees, nMinutes;
    double      dfSeconds, dfABSAngle, dfEpsilon;
    char        szFormat[30];
    static CPL_THREADLOCAL char szBuffer[50];
    const char  *pszHemisphere;
    
    dfEpsilon = (0.5/3600.0) * pow(0.1,nPrecision);

    dfABSAngle = ABS(dfAngle) + dfEpsilon;

    nDegrees = (int) dfABSAngle;
    nMinutes = (int) ((dfABSAngle - nDegrees) * 60);
    dfSeconds = dfABSAngle * 3600 - nDegrees*3600 - nMinutes*60;

    if( dfSeconds > dfEpsilon * 3600.0 )
        dfSeconds -= dfEpsilon * 3600.0;

    if( EQUAL(pszAxis,"Long") && dfAngle < 0.0 )
        pszHemisphere = "W";
    else if( EQUAL(pszAxis,"Long") )
        pszHemisphere = "E";
    else if( dfAngle < 0.0 )
        pszHemisphere = "S";
    else
        pszHemisphere = "N";

    sprintf( szFormat, "%%3dd%%2d\'%%.%df\"%s", nPrecision, pszHemisphere );
    sprintf( szBuffer, szFormat, nDegrees, nMinutes, dfSeconds );

    return( szBuffer );
}

/************************************************************************/
/*                         CPLPackedDMSToDec()                          */
/************************************************************************/

/**
 * Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.
 * 
 * This function converts a packed DMS angle to seconds. The standard
 * packed DMS format is:
 *
 *  degrees * 1000000 + minutes * 1000 + seconds
 *
 * Example:     ang = 120025045.25 yields
 *              deg = 120
 *              min = 25
 *              sec = 45.25
 * 
 * The algorithm used for the conversion is as follows:
 *
 * 1.  The absolute value of the angle is used.
 *
 * 2.  The degrees are separated out:
 *     deg = ang/1000000                    (fractional portion truncated)
 *
 * 3.  The minutes are separated out:
 *     min = (ang - deg * 1000000) / 1000   (fractional portion truncated)
 *
 * 4.  The seconds are then computed:
 *     sec = ang - deg * 1000000 - min * 1000
 *
 * 5.  The total angle in seconds is computed:
 *     sec = deg * 3600.0 + min * 60.0 + sec
 *
 * 6.  The sign of sec is set to that of the input angle.
 *
 * Packed DMS values used by the USGS GCTP package and probably by other
 * software.
 *
 * NOTE: This code does not validate input value. If you give the wrong
 * value, you will get the wrong result.
 *
 * @param dfPacked Angle in packed DMS format.
 *
 * @return Angle in decimal degrees.
 * 
 */

double CPLPackedDMSToDec( double dfPacked )
{
    double  dfDegrees, dfMinutes, dfSeconds, dfSign;

    dfSign = ( dfPacked < 0.0 )? -1 : 1;
        
    dfSeconds = ABS( dfPacked );
    dfDegrees = floor(dfSeconds / 1000000.0);
    dfSeconds = dfSeconds - dfDegrees * 1000000.0;
    dfMinutes = floor(dfSeconds / 1000.0);
    dfSeconds = dfSeconds - dfMinutes * 1000.0;
    dfSeconds = dfSign * ( dfDegrees * 3600.0 + dfMinutes * 60.0 + dfSeconds);
    dfDegrees = dfSeconds / 3600.0;

    return dfDegrees;
}

/************************************************************************/
/*                         CPLDecToPackedDMS()                          */
/************************************************************************/
/**
 * Convert decimal degrees into packed DMS value (DDDMMMSSS.SS).
 * 
 * This function converts a value, specified in decimal degrees into
 * packed DMS angle. The standard packed DMS format is:
 *
 *  degrees * 1000000 + minutes * 1000 + seconds
 *
 * See also CPLPackedDMSToDec().
 *
 * @param dfDec Angle in decimal degrees.
 *
 * @return Angle in packed DMS format.
 * 
 */

double CPLDecToPackedDMS( double dfDec )
{
    double  dfDegrees, dfMinutes, dfSeconds, dfSign;

    dfSign = ( dfDec < 0.0 )? -1 : 1;

    dfDec = ABS( dfDec );
    dfDegrees = floor( dfDec );
    dfMinutes = floor( ( dfDec - dfDegrees ) * 60.0 );
    dfSeconds = ( dfDec - dfDegrees ) * 3600.0 - dfMinutes * 60.0;

    return dfSign * (dfDegrees * 1000000.0 + dfMinutes * 1000.0 + dfSeconds);
}

/************************************************************************/
/*                         CPLStringToComplex()                         */
/************************************************************************/

void CPL_DLL CPLStringToComplex( const char *pszString, 
                                 double *pdfReal, double *pdfImag )

{
    int  i;
    int  iPlus = -1, iImagEnd = -1;

    while( *pszString == ' ' )
        pszString++;

    *pdfReal = atof(pszString);
    *pdfImag = 0.0;

    for( i = 0; pszString[i] != '\0' && pszString[i] != ' ' && i < 100; i++ )
    {
        if( pszString[i] == '+' && i > 0 )
            iPlus = i;
        if( pszString[i] == '-' && i > 0 )
            iPlus = i;
        if( pszString[i] == 'i' )
            iImagEnd = i;
    }

    if( iPlus > -1 && iImagEnd > -1 && iPlus < iImagEnd )
    {
        *pdfImag = atof(pszString + iPlus);
    }

    return;
}

/************************************************************************/
/*                           CPLOpenShared()                            */
/************************************************************************/

/**
 * Open a shared file handle. 
 *
 * Some operating systems have limits on the number of file handles that can
 * be open at one time.  This function attempts to maintain a registry of
 * already open file handles, and reuse existing ones if the same file
 * is requested by another part of the application. 
 *
 * Note that access is only shared for access types "r", "rb", "r+" and 
 * "rb+".  All others will just result in direct VSIOpen() calls.  Keep in
 * mind that a file is only reused if the file name is exactly the same. 
 * Different names referring to the same file will result in different 
 * handles.  
 *
 * The VSIFOpen() or VSIFOpenL() function is used to actually open the file, 
 * when an existing file handle can't be shared. 
 *
 * @param pszFilename the name of the file to open.
 * @param pszAccess the normal fopen()/VSIFOpen() style access string.
 * @param bLarge If TRUE VSIFOpenL() (for large files) will be used instead of
 * VSIFOpen(). 
 *
 * @return a file handle or NULL if opening fails. 
 */

FILE *CPLOpenShared( const char *pszFilename, const char *pszAccess,
                     int bLarge )

{
    int i;
    int bReuse;
    CPLMutexHolderD( &hSharedFileMutex );

/* -------------------------------------------------------------------- */
/*      Is there an existing file we can use?                           */
/* -------------------------------------------------------------------- */
    bReuse = EQUAL(pszAccess,"rb") || EQUAL(pszAccess, "rb+");

    for( i = 0; bReuse && i < nSharedFileCount; i++ )
    {
        if( strcmp(pasSharedFileList[i].pszFilename,pszFilename) == 0 
            && !bLarge == !pasSharedFileList[i].bLarge
            && EQUAL(pasSharedFileList[i].pszAccess,pszAccess) )
        {
            pasSharedFileList[i].nRefCount++;
            return pasSharedFileList[i].fp;
        }
    }

/* -------------------------------------------------------------------- */
/*      Open the file.                                                  */
/* -------------------------------------------------------------------- */
    FILE *fp;

    if( bLarge )
        fp = VSIFOpenL( pszFilename, pszAccess );
    else
        fp = VSIFOpen( pszFilename, pszAccess );

    if( fp == NULL )
        return NULL;

/* -------------------------------------------------------------------- */
/*      Add an entry to the list.                                       */
/* -------------------------------------------------------------------- */
    nSharedFileCount++;

    pasSharedFileList = (CPLSharedFileInfo *)
        CPLRealloc( (void *) pasSharedFileList, 
                    sizeof(CPLSharedFileInfo) * nSharedFileCount );

    pasSharedFileList[nSharedFileCount-1].fp = fp;
    pasSharedFileList[nSharedFileCount-1].nRefCount = 1;
    pasSharedFileList[nSharedFileCount-1].bLarge = bLarge;
    pasSharedFileList[nSharedFileCount-1].pszFilename =CPLStrdup(pszFilename);
    pasSharedFileList[nSharedFileCount-1].pszAccess = CPLStrdup(pszAccess);

    return fp;
}

/************************************************************************/
/*                           CPLCloseShared()                           */
/************************************************************************/

/**
 * Close shared file.
 *
 * Dereferences the indicated file handle, and closes it if the reference
 * count has dropped to zero.  A CPLError() is issued if the file is not
 * in the shared file list.
 *
 * @param fp file handle from CPLOpenShared() to deaccess.
 */

void CPLCloseShared( FILE * fp )

{
    CPLMutexHolderD( &hSharedFileMutex );
    int i;

/* -------------------------------------------------------------------- */
/*      Search for matching information.                                */
/* -------------------------------------------------------------------- */
    for( i = 0; i < nSharedFileCount && fp != pasSharedFileList[i].fp; i++ ){}

    if( i == nSharedFileCount )
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "Unable to find file handle %p in CPLCloseShared().",
                  fp );
        return;
    }

/* -------------------------------------------------------------------- */
/*      Dereference and return if there are still some references.      */
/* -------------------------------------------------------------------- */
    if( --pasSharedFileList[i].nRefCount > 0 )
        return;

/* -------------------------------------------------------------------- */
/*      Close the file, and remove the information.                     */
/* -------------------------------------------------------------------- */
    if( pasSharedFileList[i].bLarge )
        VSIFCloseL( pasSharedFileList[i].fp );
    else
        VSIFClose( pasSharedFileList[i].fp );

    CPLFree( pasSharedFileList[i].pszFilename );
    CPLFree( pasSharedFileList[i].pszAccess );

//    pasSharedFileList[i] = pasSharedFileList[--nSharedFileCount];
    memcpy( (void *) (pasSharedFileList + i), 
            (void *) (pasSharedFileList + --nSharedFileCount), 
            sizeof(CPLSharedFileInfo) );

    if( nSharedFileCount == 0 )
    {
        CPLFree( (void *) pasSharedFileList );
        pasSharedFileList = NULL;
    }
}

/************************************************************************/
/*                          CPLGetSharedList()                          */
/************************************************************************/

/**
 * Fetch list of open shared files.
 *
 * @param pnCount place to put the count of entries. 
 *
 * @return the pointer to the first in the array of shared file info 
 * structures.
 */

CPLSharedFileInfo *CPLGetSharedList( int *pnCount )

{
    if( pnCount != NULL )
        *pnCount = nSharedFileCount;
        
    return (CPLSharedFileInfo *) pasSharedFileList;
}

/************************************************************************/
/*                         CPLDumpSharedList()                          */
/*****************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品乱码亚洲一区二区不卡| 99久免费精品视频在线观看| 午夜精品免费在线| 亚洲综合色视频| 亚洲成av人片观看| 美女www一区二区| 国产精品白丝jk黑袜喷水| 国产成人精品一区二| 92精品国产成人观看免费 | 日韩美女天天操| 久久久一区二区三区| 中文字幕在线不卡| 一区二区三区在线不卡| 日韩激情一区二区| 成人午夜在线播放| 欧美日韩亚洲综合| 久久久精品tv| 日本怡春院一区二区| 国产精品影视网| 欧美伦理电影网| 国产精品久久久久影院亚瑟| 日韩影视精彩在线| av一区二区三区四区| 亚洲精品在线观看视频| 亚洲超碰精品一区二区| 国产成人a级片| www国产精品av| 蜜桃久久久久久| 欧美丝袜丝交足nylons图片| 国产精品护士白丝一区av| 久久国产精品一区二区| 欧美美女视频在线观看| 国产精品高潮久久久久无| 久久激情五月婷婷| 欧美一区二区在线观看| 三级久久三级久久久| jizzjizzjizz欧美| 成人av电影在线播放| 北岛玲一区二区三区四区| 欧美变态凌虐bdsm| 日韩高清一区在线| 欧美久久高跟鞋激| 国产丝袜在线精品| 欧美国产精品专区| 国产精品一区二区三区乱码| 欧美不卡一区二区三区四区| 日韩二区三区四区| 欧美sm极限捆绑bd| 国产露脸91国语对白| 久久久www成人免费毛片麻豆 | 色婷婷狠狠综合| 一区二区三区不卡视频在线观看 | 亚洲乱码一区二区三区在线观看| 成人丝袜18视频在线观看| 亚洲精品久久嫩草网站秘色| 欧美色窝79yyyycom| 日韩国产一区二| 26uuu国产一区二区三区| 不卡一区二区中文字幕| 五月天激情综合| 国产三区在线成人av| 欧美系列日韩一区| 国产综合色视频| 一区二区激情小说| 久久久亚洲国产美女国产盗摄 | 国产精品不卡在线观看| 欧美日韩精品一区二区三区| 国产乱色国产精品免费视频| 亚洲精品一二三四区| 久久久久久久久久久99999| 色婷婷精品久久二区二区蜜臀av | 亚洲一区二区三区在线看| 欧美精品一区二区三区在线| 色狠狠色狠狠综合| 国产·精品毛片| 韩国视频一区二区| 丝袜美腿高跟呻吟高潮一区| 中文字幕一区二区三区不卡| 2023国产精品| 欧美精品一区二区三区久久久| 在线欧美日韩精品| 91视频com| 在线精品观看国产| 91国偷自产一区二区三区成为亚洲经典| 国产在线精品一区二区不卡了| 日韩电影在线免费观看| 图片区小说区区亚洲影院| 一区二区三区成人在线视频| 亚洲一级在线观看| 五月天视频一区| 麻豆视频一区二区| 国产福利一区在线| 成人va在线观看| 色综合天天天天做夜夜夜夜做| 不卡av免费在线观看| 日本道色综合久久| 欧美裸体bbwbbwbbw| 久久综合九色综合97婷婷女人 | 99这里只有精品| 91麻豆视频网站| 欧美久久久影院| 久久影视一区二区| 亚洲乱码国产乱码精品精小说 | 久久综合久久久久88| 国产精品灌醉下药二区| 香港成人在线视频| 国产精品一二二区| 欧美系列一区二区| 国产无一区二区| 天天操天天干天天综合网| 国内精品视频一区二区三区八戒| 成人美女视频在线看| 欧美日韩中文字幕一区二区| 国产欧美精品一区| 日韩极品在线观看| 欧美少妇一区二区| 国产精品美女www爽爽爽| 日本不卡高清视频| 色哟哟一区二区| 国产欧美精品一区| 国产一区二区三区在线看麻豆| 99久久综合国产精品| 日本一区二区三区在线观看| 午夜国产精品影院在线观看| 成人午夜激情影院| 欧美国产日韩a欧美在线观看| 奇米色一区二区三区四区| 欧美肥妇bbw| 日韩av成人高清| 欧美一级xxx| 免费在线看成人av| 日韩美女主播在线视频一区二区三区| 一区二区免费看| 欧美精品一二三| 日韩精品色哟哟| 精品福利一二区| 国产精品一二二区| 亚洲色图第一区| 91久久精品网| 日韩不卡一二三区| 精品国产精品一区二区夜夜嗨| 美女在线视频一区| 国产免费观看久久| 91天堂素人约啪| 免费观看成人av| 国产女主播一区| 在线亚洲+欧美+日本专区| 亚洲电影一区二区| 久久久亚洲综合| 欧美亚洲国产bt| 国产激情偷乱视频一区二区三区| 久久精品一区二区三区不卡| 日本韩国欧美国产| 国产激情视频一区二区在线观看| 国产精品妹子av| 欧美成人vps| 欧美在线观看一区| 成人av一区二区三区| 亚洲1区2区3区4区| 亚洲欧美日韩国产综合在线| 欧美va亚洲va香蕉在线| 欧美制服丝袜第一页| 成人一区二区三区在线观看| 麻豆视频观看网址久久| 一区二区高清在线| 亚洲欧美电影一区二区| 国产午夜久久久久| 国产调教视频一区| 久久久久免费观看| 日韩欧美国产系列| 日韩午夜av一区| 欧美日韩国产综合草草| 欧美性视频一区二区三区| 成人一级片在线观看| av毛片久久久久**hd| 成人自拍视频在线| 国产成人aaaa| 欧美激情一二三区| 欧美精品aⅴ在线视频| 久久99国产精品麻豆| 激情六月婷婷久久| 久久91精品国产91久久小草| 久久精品国产一区二区三| 美女视频一区二区| 国产专区欧美精品| eeuss影院一区二区三区| 91亚洲午夜精品久久久久久| 色诱视频网站一区| 欧美亚洲动漫精品| 欧美大胆一级视频| 国产女同互慰高潮91漫画| 亚洲人成在线播放网站岛国| 一区二区三区欧美亚洲| 免费在线成人网| 92精品国产成人观看免费| 欧美日韩成人综合天天影院 | 一区二区三区加勒比av| 欧美a一区二区| 91捆绑美女网站| 日韩一区二区三区四区五区六区|