EASE-Grid经纬度与行列号转换公式 以 25KM的HDF数据为例

 

/// <summary>
/// 把经纬度转换成行列号
/// </summary>
/// <param name="pLng"></param>
/// <param name="pLat"></param>
/// <returns></returns>
private int[] ConvertLngLatToFY3ColumRow(double pLng, double pLat)
{
    int[] myCRIndexArray = new int[2];
    double myR0 = 360;
    double myS0 = 360;
    double myR = 6371.228;
    double myC = 25;

    double myLng = pLng * Math.PI / 180;
    double myLat = pLat * Math.PI / 180;
    double myColumnIndex = 2 * myR / myC * Math.Sin(myLng) * Math.Sin(Math.PI / 4 - myLat / 2) + myR0;
    double myRowIndex = 2 * myR / myC * Math.Cos(myLng) * Math.Sin(Math.PI / 4 - myLat / 2) + myS0;
    myCRIndexArray[0] = (int)myColumnIndex;
    myCRIndexArray[1] = (int)myRowIndex;
    return myCRIndexArray;
}

 

posted @ 2022-03-24 09:34  mytudousi  阅读(598)  评论(0编辑  收藏  举报