1

わかりました、Google Earth からのこれらのイメージ オーバーレイ データは次のようになります。

North: -7.340917
South: -7.34100
East: 112.751217
West: 112.751167
Rotation: 25.0000

そして、これらの関数を使用して、イメージポイント(x、y)をLat、Lngに正常に変換しました:

static Double DEGREES_PER_RADIAN = 180 / Math.PI;
static Double RADIAN_PER_DEGREES = Math.PI / 180;

public static double Gudermannian(double y)
{
    return Math.atan(Math.sinh(y)) * DEGREES_PER_RADIAN;
}

public static double GudermannianInv(double latitude)
{
    double sign = Math.signum(latitude);
    double sin = Math.sin(latitude * RADIAN_PER_DEGREES * sign);
    return sign * (Math.log((1.0 + sin) / (1.0 - sin)) / 2.0);
}

Double mapLatNorth = -7.340917;
Double mapLatSouth = -7.34100;
Double mapLonWest = 112.751167;
Double mapLonEast = 112.751217;

Double ymax = GudermannianInv(mapLatNorth);
Double ymin = GudermannianInv(mapLatSouth);                 
Float latPoint = (float) Gudermannian(ymax - ( ((double) pointY / imgHeight) * (ymax - ymin) )) ;

Double mapLonDelta = mapLonEast - mapLonWest;
Float lngPoint = (float) (mapLonWest + pointX / imgWidth * mapLonDelta);

私が得る値

latPoint

lngPoint

正しいですが、まだ回転していません。私の質問は、これらの緯度/経度の値を25度回転させる方法ですか?

kml ファイルからグラウンド オーバーレイのコーナーの緯度/経度を計算する での Ewan Todd の回答から緯度/経度の値を取得できませんでした

4

1 に答える 1

1

これは単純な 2D 回転で可能で、次のようになります。

public Float rotateLatitudeAround(Float lat, double angle, Point center) {
    lat = center.lat + (Math.cos(Math.toRadians(angle)) * (lat - center.lat) - Math.sin(Math.toRadians(angle)) * (lon - center.lon));
    return lat;
}

public Float rotateLongitudeAround(Float lon, double angle, Point center) {
    lon = center.lon + (Math.sin(Math.toRadians(angle)) * (lat - center.lat) + Math.cos(Math.toRadians(angle)) * (lon - center.lon));
    return lon;
}

しかし変わる

center.lat 

center.getLatitudeE6()/1E6 

か何か。

編集:これがポイントx、yでのみ機能することを忘れていました。しかし、最初にマップの投影の中心に関連する緯度、経度のポイントを取得し、投影から緯度、経度の値を取得した後、マップを逆にすることができますか?

于 2013-08-31T21:39:50.657 に答える