2016-11-13 10 views
0

現在、整数latitudelongitudeを10進数(度)に変換しようとしています。私がデータを取得した場所の仕様は以下の通りです:整数緯度と経度を小数点に変換します(GoogleマップAPIを使用)

| Latitude |位置緯度|整数、1/10秒の数|

|経度|位置経度|整数、1/10秒の数|ここで

サンプル数である:

  • 緯度:1914383
  • 経度:

    • 緯度:371352

    私は必要なものは、この形式のものです:51.39796

  • 経度:14.62539

がどのように私はこれらの形式を変換することができますか?

私はC#でいくつかの実装を見たことがありますが、実際には使えないものはありませんでした。私が試したもの:

Converting GPS coordinates (latitude and longitude) to decimalConverting latitude and longitude to decimal values

どうもありがとう

+1

1/10秒で与えられるので、それを36000で割ってください。APIドキュメントでは、どのようにサインが形成されているか確認してください。 –

答えて

1

をここフォーマット間の変換のための一例です。

private void ConvertSampleFunction() 
    { 
     //let N 40264600 be a GPS coordinate. Then 
     //Format in degrees minutes seconds: 40° 26′ 46″ N 
     double Degs=40.0; 
     double Mins=26.0; 
     double Secs=46.00; 
     //Then in degrees - decimal minutes Format will be 
     double Ddegs=Degs; 
     double Dmins=Mins; 
     double Dsecs=Secs/60.0; 
     //This will give Ddegs and Dmins.Dsecs e.g. 40 degrees and 26.767' 
     //and In Decimal format DDD.DDD... it will be 
     double DecDegs=Degs+Mins/60.0+Secs/3600.0; 
     //which will give the value 40.446.. 
    } 

これらのヘルプが必要です。

関連する問題