関数read_latlonDEM_to_3d_multi マニュアル

(The documentation of function read_latlonDEM_to_3d_multi)

Last Update: 2025/12/22


◆機能・用途(Purpose)

緯度・経度に基づく格子点で標高が与えられた数値標高モデルを struct _3d_data型構造体に読み込む。 緯度経度で範囲を指定する。数値標高モデルは複数ファイルにまたがっていても良い。
Read a digital elevation model, composed of the elevations at latitude- and longitude-based grid nodes, into a struct _3d_data-type structure. The data to be read are specified by latitude and longitude ranges, and can be separated in multiple files.

入力ファイル(数値標高モデルのデータ)は GSIdem2latlonDataコマンド から出力されたファイル、またはそれと同じ書式を持つテキストファイルとする。 緯度・経度範囲に応じた複数のファイルに分かれていても良いが 以下の3条件を満たさなければならない。
The file formats of input data (digital elevation model) must be identical to the file format of the output files from GSIdem2latlonData command. The data can be divided as multiple files, as long as they satisfy the following requirements.


◆形式(Format)

##include <3d_data/readwrite.h>
inline struct _3d_data read_latlonDEM_to_3d_multi
(const char ∗inputfile_name_with_pattern,
 const double Nmin,const double Nmax, const double Emin,const double Emax)


◆引数(Arguments)

inputfile_name_with_pattern 入力ファイル名。 数値標高モデルのファイル名であり、以下をパターンとして含んでいて良い。
The name of the input files that contain the data of the digital elevation model. This argument may consist of the following patterns.

  • %mesh1
    1次メッシュコード(4桁)
    The 1st mesh code (4 digits).

  • %mesh2
    2次メッシュコード(2桁)
    The 2nd mesh code (2 digits).

  • %mesh3
    3次メッシュコード(2桁)
    The 3rd mesh code (2 digits).

Nmin 数値標高モデルを読み込みたい緯度範囲の下限(度)。
The lower limit latitude (degrees) of the spatial range to read the digital elevation model.
Nmax 数値標高モデルを読み込みたい緯度範囲の上限(度)。
The upper limit latitude (degrees) of the spatial range to read the digital elevation model.
Emin 数値標高モデルを読み込みたい経度範囲の下限(度)。
The lower limit longitude (degrees) of the spatial range to read the digital elevation model.
Emax 数値標高モデルを読み込みたい経度範囲の上限(度)。
The upper limit longitude (degrees) of the spatial range to read the digital elevation model.


◆戻り値(Return value)

引数Nmin, Nmax, Emin, Emaxで指定した範囲をカバーする数値標高モデル。 [Nmin, Nmax], [Emin, Emax]の範囲ではなく それらを包含するファイルのデータ範囲全体を読み込む。 2次元データ(\(N_z=1\)の3次元データ) であり以下のように与える。
A digital elevation model that covers the spatial range specified by arguments Nmin, Nmax, Emin, and Emax. The output 3-D data is not truncated at Nmin, Nmax, Emin, and Emax but includes the entire data ranges of the corresponding files. This is a 2-D data (3-D data with \(N_z=1\)) and defined as follows.


◆使用例(Example)

struct _3d_data topography=read_latlonDEM_to_3d_multi ("/dat/DEM_GSI/%mesh1/FG-GML-%mesh1-%mesh2-dem10b-20250101.dat",35.12345,36.78901,137.65432,138.90123);

この例では /dat/DEM_GSI/????/FG-GML-????-??-dem10b-20250101.dat (????は1次メッシュコード、 ??は2次メッシュコード) のパターンにマッチするファイルを 北緯35.12345-36.78901度、東経137.65432-138.76543度 の範囲で探索して数値標高モデルを読み込む。 作成する3次元データにおいて、例えば 北緯35度30分36秒の位置は\(y=35\times 3600+30\times 60+36=127836\)、 東経137度54分7.2秒の位置は\(x=137\times 3600+54\times 60+7.2=496447.2\) となる。
In this example, the digital elevation model is read from files that match a pattern of /dat/DEM_GSI/????/FG-GML-????-??-dem10b-20250101.dat, where ???? and ?? are the 1st and 2nd mesh codes, respectively, in a spatial range of 35.12345-36.78901N, 137.65432-138.76543E. The coordinates are converted to \(x\) and \(y\) in the 3-D data as, for example, from 35°30’36”N to \(y=35\times 3600+30\times 60+36=127836\) and from 137°54’7.2” to \(x=137\times 3600+54\times 60+7.2=496447.2\).