タイトルですでに述べたように、ミラー図法で緯度/経度をx/y座標に変換するのに助けが必要です。私は現在、都市リストを入力として取得し、YahooPlacefinderから各都市の緯度/経度を取得するアプリ(Java)を作成しています。私は自分のコードでこれらの式を使用しました。これが私が得たものの例です。(画像は参照用であり、私が使用しているものではありません)。X位置がわずか数ピクセル(2〜3)ずれていることがわかるように、これは、このマップの本初子午線シフト(CENTRAL_MERIDIAN_OFFSET)の計算で問題になる可能性があります。しかし、主な問題はY座標が正しくないことです。
これが私のコードです(更新-赤道オフセットの34px補正):
public final double W = 6343;
public final double H = 4767 - 34;
protected Point toMillerXY(double lon, double lat)
{
double x, y;
lon = Utils.degToRad(lon);
lat = Utils.degToRad(lat);
x = lon - CENTRAL_MERIDIAN_OFFSET;
y = 1.25 * Math.log( Math.tan( 0.25 * Math.PI + 0.4 * lat ) );
x = ( W / 2 ) + ( W / (2 * Math.PI) ) * x;
y = ( H / 2 ) - ( H / ( 2 * 2.303412543 ) ) * y;
y += 34;
return new Point(x, y);
}
Output:
Fetching data with: http://where.yahooapis.com/geocode?location=Buenos+Aires,Argentina
Latitude: -34.608521, longitude: -58.373539
---
Fetching data with: http://where.yahooapis.com/geocode?location=Tokyo,Japan
Latitude: 35.670479, longitude: 139.740921
---
Fetching data with: http://where.yahooapis.com/geocode?location=Cape+Town,CAR
Latitude: -33.919060, longitude: 18.421961
---
Fetching data with: http://where.yahooapis.com/geocode?location=Rome,Italy
Latitude: 41.903110, longitude: 12.495760
---
Total cities: 4
Result for Buenos Aires: 1964.598428, 3046.740995
Result for Tokyo: 5455.265150, 1732.669551
Result for Cape Town: 3317.692474, 3032.814395
Result for Rome: 3213.276105, 1602.176163
明らかに、Y座標の計算に問題があります。5.6が本当に正しい値であるかどうかはわかりませんが、ミラー図法の垂直範囲は、私が読んだ参考文献の1つで-2.3 .. + 2.3と言われていたので、それを使用しました。