Ejemplo n.º 1
0
 /// <summary>
 ///マップのインスタンスを生成しないコンストラクタ
 ///<para>DEMデータ情報について整理し、マップを管理する準備を行います。</para>
 /// </summary>
 /// <param name="fileName">ファイル名</param>
 /// <param name="info">マップ情報</param>
 /// <param name="parentFileName">親ファイル名<para>元ファイルが圧縮ファイル等であった場合に利用してください。</para></param>
 public DemSet(string fileName, Info info, string parentFileName = "")
     : base()
 {
     this.FileName = fileName;
     this.info = info;
     this.map = null;                        // メモリ空間を始めは食わせたくないので、マップのサイズはセットしない。
     this.ErrorMsg = "";
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 渡されたマップを用いて初期化する
 /// <para>呼び出すのは一回きりにしてください</para>
 /// </summary>
 /// <param name="info">マップの情報</param>
 private void Init(Info info)
 {
     if (this.dict.Count == 0)
     {
         this.mapSize = info.Field.Size;
         this.amountOfMeshInMap = info.Size;
         this.meshSize = new Blh(this.mapSize.B / (double)this.amountOfMeshInMap.y, this.mapSize.L / (double)this.amountOfMeshInMap.x);
         this.offset = this.GetMapOffset(info);
     }
     return;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// マップのオフセットを計算して返す
 /// <para>マップを世界中に敷き詰めたとしたとき、原点(緯度経度0度)を含むマップの南西にあるコーナー座標と原点との差をオフセットと定義しています。</para>
 /// </summary>
 /// <param name="info">マップの情報</param>
 /// <returns>オフセット量</returns>
 private Blh GetMapOffset(Info info)
 {
     Blh underLeft = info.Field.UpperLeft;
     underLeft.Unit = AngleUnit.Degree;                                      // 単位を度に統一する
     underLeft.DatumKind = Datum.WGS84;                   // 測地系も統一
     Blh size = info.Field.Size;
     size.Unit = AngleUnit.Degree;                                           // 単位を度に統一する
     size.DatumKind = Datum.WGS84;                        // 測地系も統一
     double remainderLat = underLeft.B % size.B;
     double remainderLon = underLeft.L % size.L;
     if (this.CheckNearlyZero(remainderLat)) remainderLat = 0.0;
     if (this.CheckNearlyZero(remainderLon)) remainderLon = 0.0;
     if (remainderLat != 0.0 && underLeft.B > 0.0) remainderLat -= size.B;   // 0なら一致している
     if (remainderLon != 0.0 && underLeft.L > 0.0) remainderLon -= size.L;
     if (this.CheckNearlyZero(remainderLat)) remainderLat = 0.0;
     if (this.CheckNearlyZero(remainderLon)) remainderLon = 0.0;
     if (this.CheckNearlyZero(remainderLat + size.B)) remainderLat = 0.0;    // 足したら0に近くなるようなら0と丸める
     if (this.CheckNearlyZero(remainderLon + size.L)) remainderLat = 0.0;
     return new Blh(remainderLat, remainderLon, 0.0, AngleUnit.Degree, Datum.WGS84);
 }