JP5337995B2 - Watershed extraction program and watershed extraction device - Google Patents
Watershed extraction program and watershed extraction device Download PDFInfo
- Publication number
- JP5337995B2 JP5337995B2 JP2009134067A JP2009134067A JP5337995B2 JP 5337995 B2 JP5337995 B2 JP 5337995B2 JP 2009134067 A JP2009134067 A JP 2009134067A JP 2009134067 A JP2009134067 A JP 2009134067A JP 5337995 B2 JP5337995 B2 JP 5337995B2
- Authority
- JP
- Japan
- Prior art keywords
- basin
- region
- area
- procedure
- cell
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000605 extraction Methods 0.000 title claims description 19
- 238000000034 method Methods 0.000 claims abstract description 158
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims abstract description 71
- 238000011144 upstream manufacturing Methods 0.000 claims abstract description 56
- 230000010365 information processing Effects 0.000 claims description 2
- 238000004590 computer program Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 17
- 238000004458 analytical method Methods 0.000 description 12
- 238000005429 filling process Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 239000000284 extract Substances 0.000 description 5
- 238000003491 array Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000005206 flow analysis Methods 0.000 description 1
- 239000010865 sewage Substances 0.000 description 1
- 238000012876 topography Methods 0.000 description 1
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
本発明は、コンピュータを使って流域を抽出する方法に関する。本発明は特に、1以上の地点の位置を入力データとし、それぞれの地点の流域を数値地形モデル(digital elevation mode, DEM)に基づいて抽出するコンピュータプログラム(流域抽出プログラム)に関する。 The present invention relates to a method for extracting a watershed using a computer. In particular, the present invention relates to a computer program (basin extraction program) that uses the positions of one or more points as input data and extracts a basin at each point based on a digital terrain model (digital elevation mode, DEM).
流域は、河川またはダムなどの水を管理する土木構造物にとって重要な情報である。ある地点の流域とは、その地点に集まってくる水が流れてきた領域である。ダムの建設のためには、そのダムに平均的に入ってくると予想される水量、すなわちダムの流域の平均降雨量が不可欠である。また、ダムの管理のためには、そのダムの水源林、すなわち流域内の森林の状態管理が不可欠である。河川の水位予測のためには、その河川の流域の予想降雨量が不可欠である。都市機能を豪雨から守るための雨水排水設備(下水)の設計には、その設備が対応すべき最大の降雨強度と、流域面積とが不可欠である。 A basin is important information for civil engineering structures that manage water such as rivers or dams. A basin at a certain point is an area where water gathered at that point has flowed. For the construction of a dam, the amount of water expected to enter the dam on average, that is, the average rainfall in the dam basin is indispensable. In order to manage a dam, it is essential to manage the condition of the water source forest of the dam, that is, the forest in the basin. In order to predict the water level of a river, the expected rainfall in the river basin is indispensable. In designing rainwater drainage (sewage) to protect urban functions from torrential rain, the maximum rainfall intensity and basin area that the facility should handle are essential.
流域は、水が流れる方向を逆にたどることによって求めることができる。実際に、この流れの性質を利用して流域を抽出するコンピュータプログラム(流域抽出プログラム)が存在する。主要な流域抽出プログラムの処理手順は、非特許文献1に詳しい。 A basin can be determined by reversing the direction of water flow. Actually, there is a computer program (basin extraction program) for extracting a basin by utilizing the characteristics of this flow. The processing procedure of the main watershed extraction program is detailed in Non-Patent Document 1.
流域抽出プログラムで利用する電子データは、地表面の標高データである。この様な電子データはDEM(Digital Elevation Model)と呼ばれる。DEMでは、ある領域の地表面がセル(cell)と呼ばれる小領域に分割され、それぞれのセルに標高値が与えられる。 The electronic data used in the basin extraction program is the elevation data of the ground surface. Such electronic data is called DEM (Digital Elevation Model). In DEM, the ground surface of a certain area is divided into small areas called cells, and an altitude value is given to each cell.
通常、水が流れる方向はその地点の最も急な下り勾配方向と一致する。この流れの性質を利用した流域抽出方法が、最急勾配法(steepest slope method)と呼ばれる方法である。この方法では、あるセルの流域が、そのセルから最も急な下り勾配の方向を逆にたどった時に通過したセルとなる。あるセルの勾配は、そのセルおよびそのセルの周囲の8セルの標高データから求めることができる。 Usually, the direction of water flow coincides with the steepest downward gradient direction at that point. A basin extraction method using this flow property is called a steepest slope method. In this method, a basin of a certain cell is a cell that has passed when the direction of the steepest downward gradient from the cell is reversed. The slope of a cell can be determined from the elevation data of that cell and the 8 cells surrounding that cell.
最急勾配法では、周囲のセルの標高以下の標高を持つセルの取り扱いが問題となる。このようなセルは、流域抽出プログラムの研究分野で「平地(flat)」または「窪地(sink, depression)」と呼ばれている。平地は周囲の1以上のセルの標高と同じ標高を持つセルであり、窪地は周囲のすべてのセルの標高より小さい標高を持つセルである。このようなセルが存在する場合、最急勾配法を利用すると、正しい流域を抽出することができない。ところが、平地および窪地は通常のDEMに多数存在する。したがって、最急勾配法のみでは、正しい流域が抽出できない。 In the steepest gradient method, handling of cells having an altitude lower than that of surrounding cells becomes a problem. Such cells are called “flat” or “sink, depression” in the research area of watershed extraction programs. A flat land is a cell having the same elevation as that of one or more surrounding cells, and a depression is a cell having an elevation smaller than the elevations of all surrounding cells. When such a cell exists, a correct watershed cannot be extracted by using the steepest gradient method. However, there are many flats and depressions in a normal DEM. Therefore, a correct watershed cannot be extracted only by the steepest gradient method.
図18は、窪地を説明するための図である。グラフ1800は、DEMの鉛直断面図に最急勾配法で決定した水が流れる方向を重ねた図である。セル1801は河口であり、最も標高が低い。セル1804は隣接するセル(1803および1805)よりわずかに標高が低い。最急勾配法で決定した水が流れる方向を矢印で示す。セル1801の流域セルはこの矢印をセル1801から逆にたどった範囲であり、セル1802〜1803となる。しかしこの結果は誤りである。専門家であれば、セル1801の流域セルをセル1802〜1809とするであろう。 FIG. 18 is a diagram for explaining a depression. A graph 1800 is a diagram in which the water flow direction determined by the steepest gradient method is superimposed on the vertical cross-sectional view of the DEM. Cell 1801 is an estuary and has the lowest elevation. Cell 1804 is slightly lower in elevation than adjacent cells (1803 and 1805). The direction of water flow determined by the steepest gradient method is indicated by an arrow. The basin cell of the cell 1801 is a range obtained by tracing this arrow in reverse from the cell 1801 and becomes cells 1802 to 1803. But this result is incorrect. If it is an expert, the basin cell of the cell 1801 will be the cells 1802-1809.
この問題の最も一般的な解決方法は、勾配を無視し、標高の配置に基づいて水の流れる方向を決定する窪地埋め(sink filling)法である。窪地埋め法は、最急勾配法に比べ、より多くのセルの標高データを利用する。窪地埋め法を使う流域抽出プログラムは非特許文献2および非特許文献3に詳しく説明されている。 The most common solution to this problem is the sink filling method, which ignores the gradient and determines the direction of water flow based on the altitude placement. The depression filling method uses altitude data of more cells than the steepest gradient method. Non-Patent Document 2 and Non-Patent Document 3 explain in detail the watershed extraction program that uses the depression filling method.
窪地埋め法では、まず窪地を平地に変える。つまり、窪地の標高を、周囲のセルのうち最小の標高にする。図18では、窪地セル1804の標高をセル1805と同じ標高にする。次に、平地の流出口を決定する。具体的には、平地に隣接する平地よりも低い標高を持つセルを流出口として決定する。流出口が存在しない場合は、平地にするセルを広げる。 In the depression filling method, the depression is first changed to a flat ground. That is, the altitude of the depression is set to the minimum elevation among the surrounding cells. In FIG. 18, the altitude of the depression cell 1804 is set to be the same as that of the cell 1805. Next, the outlet of the flat ground is determined. Specifically, a cell having an altitude lower than that of the flat land adjacent to the flat land is determined as the outlet. If there is no outlet, expand the cell to level.
図18では、セル1804および1805の流出口が存在しない。そこで、平地にするセルをセル1803から1805に広げる。広げた後の状態をグラフ1820に示す。 In FIG. 18, there is no outlet for cells 1804 and 1805. Therefore, the cells to be flattened are expanded from cells 1803 to 1805. A state after the expansion is shown in a graph 1820.
グラフ1820のセル1821〜1829は、それぞれ、グラフ1800のセル1801〜1809に対応する。 Cells 1821-1829 of graph 1820 correspond to cells 1801-1809 of graph 1800, respectively.
グラフ1820を参照すると、セル1823から1825の標高が等しく、これらのセルが平地になっていることがわかる。この場合、流出口はセル1822となる。最後に、平地内の流れが流出口に向かうように平地内の水が流れる方向を決定する。平地セル1823から1825の水が流れる方向は、その流出口であるセル1822に向かうように決定される。セルごとの水が流れる方向を、グラフ1820に矢印で示す。この矢印をセル1821から逆にたどると、セル1829までたどれる。最急勾配法の結果を窪地埋め法により修正すると、セル1821の流域セルはセル1822〜1829である、という正しい結果が得られる。 Referring to graph 1820, it can be seen that the elevations of cells 1823 to 1825 are equal and these cells are flat. In this case, the outlet is the cell 1822. Finally, the direction in which the water in the flatland flows is determined so that the flow in the flatland is directed toward the outlet. The direction in which the water in the flat cells 1823 to 1825 flows is determined so as to go to the cell 1822 that is the outlet. The direction of water flow for each cell is indicated by an arrow in graph 1820. If this arrow is traced back from the cell 1821, the cell 1829 is traced. When the result of the steepest gradient method is corrected by the depression filling method, the correct result that the basin cells of the cell 1821 are the cells 1822 to 1829 is obtained.
窪地埋め法の処理効率を上げる実装方法として、特許文献1に開示された「Method for flow analysis utilizing cell elevation topography」が挙げられる。この方法では、あらかじめ領域の内部を複数のmajor cellに分割し、さらにmajor cellの内部を少なくとも横方向3縦方向3のminor cellに分割する。そして、あるminor cellにおける勾配を算出するときに、そのminor cellを含むmajor cellと、さらにそのmajor cellに隣接するmajor cellについて窪地埋め法を適用する。その後、これらのmajor cellに含まれるminor cellについて勾配を再度算出する。非特許文献1に開示された方法では、処理の対象とする領域全体に窪地埋め法を適用する必要があったが、特許文献1に開示された方法では、処理の対象とする領域を複数に分割し、それぞれ分割された領域ごとに窪地埋め法を適用することが可能になる。 “Method for flow analysis utilizing cell elevation topography” disclosed in Patent Document 1 can be cited as a mounting method for increasing the processing efficiency of the depression filling method. In this method, the interior of the area is divided into a plurality of major cells in advance, and the interior of the major cell is further divided into at least three minor cells in the horizontal direction and the vertical direction. Then, when calculating the gradient in a certain minor cell, the depression filling method is applied to the major cell including the minor cell and the major cell adjacent to the major cell. Thereafter, the gradient is calculated again for the minor cells contained in these major cells. In the method disclosed in Non-Patent Document 1, it is necessary to apply the depression filling method to the entire area to be processed. However, in the method disclosed in Patent Document 1, a plurality of areas to be processed are included. It becomes possible to divide and apply the depression filling method for each divided area.
いずれの方法であっても、次の手順で流域を抽出する。まず、水の流れる方向を勾配のみから決定する(最急勾配法)。次に、水が流れ出ない平地セルおよび窪地セルに対して、そのセルの水の流れる方向を標高の配置に基づいて決定する(窪地埋め法)。最後に、ユーザが指定したセルから水の流れる方向を逆にたどる。そのときに通ったセルが、流域セルである。 Regardless of the method, the watershed is extracted by the following procedure. First, the direction of water flow is determined only from the gradient (the steepest gradient method). Next, with respect to the flat cell and the depression cell from which water does not flow, the direction of the water flow of the cell is determined based on the arrangement of the altitude (the depression filling method). Finally, the direction of water flow is reversed from the cell specified by the user. The cell passed at that time is the basin cell.
従来の流域抽出プログラムでは、水の流れる方向を決定した後に、流域を抽出する。したがって、流域を抽出する前に、水の流れる方向を決定する範囲をプログラムに与える必要がある。もし、水の流れる方向を決定する範囲が流域よりも小さい場合、正しい流域は抽出できない。したがって、正しい流域を抽出するためには、抽出される流域をプログラムのユーザがあらかじめ知っておく必要がある。しかし、流域を知っているユーザは、流域抽出プログラムを使う必要はない。このため、従来の流域抽出プログラムは、限られた用途にしか適用されてこなかった。 In the conventional watershed extraction program, the watershed is extracted after the direction of water flow is determined. Therefore, before extracting the basin, it is necessary to give the program a range that determines the direction of water flow. If the range that determines the direction of water flow is smaller than the basin, the correct basin cannot be extracted. Therefore, in order to extract a correct basin, the user of the program needs to know in advance the basin to be extracted. However, users who know the basin need not use the basin extraction program. For this reason, the conventional watershed extraction program has been applied only for limited purposes.
本発明はこの問題に鑑みてなされたものである。本発明の目的は、あらかじめ流域を知らないユーザであっても流域を抽出できるプログラムコンピュータプログラムを提供することである。 The present invention has been made in view of this problem. The objective of this invention is providing the program computer program which can extract a basin even if it is a user who does not know a basin beforehand.
本願で開示する代表的な発明は、コンピュータを制御する流域抽出プログラムであって、前記コンピュータは、前記流域抽出プログラムが格納されるメモリと、前記メモリに格納された前記流域抽出プログラムを実行するプロセッサと、を備え、地図上の複数の領域の標高を示す標高データを保持し、前記複数の領域は、第1領域を含み、前記流域抽出プログラムは、前記第1領域に流れ込む水の流域を、前記標高データに基づいて上流方向に探索する第1手順と、前記第1手順によって特定された流域が正しいか否かを判定する第2手順と、を前記プロセッサに実行させ、前記第2手順において、前記特定された流域が正しくないと判定された場合、前記第1手順を再び前記プロセッサに実行させることを特徴とする。 A representative invention disclosed in the present application is a basin extraction program for controlling a computer, wherein the computer stores a memory in which the basin extraction program is stored, and a processor that executes the basin extraction program stored in the memory. And holding elevation data indicating elevations of a plurality of areas on a map, the plurality of areas including a first area, and the basin extraction program includes a basin of water flowing into the first area, In the second procedure, the processor executes a first procedure for searching in the upstream direction based on the elevation data and a second procedure for determining whether or not the basin specified by the first procedure is correct. When it is determined that the specified basin is not correct, the processor is caused to execute the first procedure again.
本発明の一実施形態によれば、DEMから流域を抽出するコンピュータプログラムを提供できる。このプログラムによって、あらかじめ流域を知らないユーザであっても、流域を抽出することができる。 According to an embodiment of the present invention, it is possible to provide a computer program for extracting a basin from a DEM. By this program, even a user who does not know the basin in advance can extract the basin.
最初に、本発明の概要を説明する。 First, the outline of the present invention will be described.
本発明は、以下の3つの発見に基づいている。 The present invention is based on the following three discoveries.
1.窪地および平地の面積、体積、形状等はあらかじめわからない。 1. The area, volume, shape, etc. of the depression and flat land are not known in advance.
2.窪地および平地がプログラムで得られた流域に隣接している場合、プログラムで得られたその流域が誤っている可能性がある。 2. If depressions and flats are adjacent to the basin obtained by the program, the basin obtained by the program may be incorrect.
3.流域の最上流は自明ではない一方、流域の最下流は自明である。 3. The most upstream of the basin is not obvious, while the most downstream of the basin is obvious.
発見1および2は、発明者らが先に出願した発明(特願2008−002284,流域推定プログラム)を様々な流域でDEMデータやセルの大きさを様々に変化させて検証する過程で発見した。そこで、特願2008−002284に示した発明の概要を以下に説明する。 Discovery 1 and 2 were discovered in the process of verifying the invention (Japanese Patent Application No. 2008-002284, basin estimation program) previously filed by the inventors by changing DEM data and cell size in various basins. . The outline of the invention shown in Japanese Patent Application No. 2008-002284 will be described below.
特願2008−002284に示した発明は、任意のセルがある面積以下の窪地でないことを証明できる、という発見に基づく。ある面積をもった(すなわちある数のセルからなる)窪地または平地が取り得る最大の長さは、それらのセルを1列に直線上に並べた場合の長さである。あるセルからこの長さよりも近いセルについて窪地埋め法を適用すれば、少なくとも中心にあるセルはある面積以下の窪地または平地ではなくなる。そこで、特願2008−002284に示した発明では「窪地の最大面積」というパラメタを導入し、これ以下の面積の窪地および平地を埋めることにした。この発明はさらに、先に出願した別の発明(特開2007−034373,空間シミュレーションプログラムおよび装置)の「部分領域」という概念を利用する。 The invention shown in Japanese Patent Application No. 2008-002284 is based on the discovery that any cell can be proved not to be a depression below an area. The maximum length that can be taken by a depression or flat land having a certain area (that is, consisting of a certain number of cells) is the length when the cells are arranged in a straight line. If the depression filling method is applied to a cell closer than this length from a certain cell, at least the cell at the center is not a depression or flat area of a certain area or less. Therefore, in the invention shown in Japanese Patent Application No. 2008-002284, a parameter called “maximum area of depressions” is introduced, and depressions and flat areas with areas smaller than this are filled. The present invention further utilizes the concept of “partial region” of another invention (Japanese Patent Laid-Open No. 2007-034373, space simulation program and apparatus) filed earlier.
特願2008−002284に示した発明の実施例は以下の通りである。あらかじめ窪地の最大面積を定義しておく。さらに、あらかじめ隣接する複数のセルから構成される部分領域を定義し、全てのセルを部分領域に対応づけておく。開始セルをユーザが指定すると、プログラムは開始セルを対象セルとする(ステップ1)。つづいて、対象セルを含む部分領域を対象部分領域とする(ステップ2)。対象部分領域からの距離が、最大の窪地が取り得る最大の長さよりも近い部分領域について、窪地埋め処理を行う(ステップ3)。この処理によって、対象部分領域からあらかじめ決めた面積以下の窪地が取り除かれる。つづいて、対象セルに隣接する8セルについて下流方向(すなわち、各セルから流出する水の流向)を算出する(ステップ4)。下流方向は、最も急な下り勾配の方向である。下流方向に対象セルがあるセルを、次の対象セルとする(ステップ5)。次の対象セルが存在する場合、ステップ2に戻る(ステップ6)。 Examples of the invention shown in Japanese Patent Application No. 2008-002284 are as follows. Define the maximum area of the depression beforehand. Further, a partial area composed of a plurality of adjacent cells is defined in advance, and all the cells are associated with the partial areas. When the user designates the start cell, the program sets the start cell as the target cell (step 1). Subsequently, the partial area including the target cell is set as the target partial area (step 2). A depression filling process is performed for a partial area whose distance from the target partial area is closer than the maximum length that the largest depression can take (step 3). By this process, a depression having a predetermined area or less is removed from the target partial region. Subsequently, the downstream direction (that is, the flow direction of water flowing out from each cell) is calculated for the eight cells adjacent to the target cell (step 4). The downstream direction is the steepest downward gradient direction. The cell having the target cell in the downstream direction is set as the next target cell (step 5). If the next target cell exists, the process returns to step 2 (step 6).
一方、本発明は先の発明とは異なる発見を利用する。すなわち、本発明は上述した発見1から3に基づいている。本発明は、先の発明では必要であった「窪地の最大面積」というパラメタを不要にする。発明者らが考案した、本発明の流域抽出プログラムは以下のステップ1およびステップ2からなる。 On the other hand, the present invention utilizes discoveries different from the previous invention. That is, the present invention is based on the discoveries 1 to 3 described above. The present invention eliminates the parameter “maximum area of depression” that was necessary in the previous invention. The basin extraction program of the present invention devised by the inventors comprises the following steps 1 and 2.
ステップ1:ユーザが指定したセルの上流セルを探索する。 Step 1: Search the upstream cell of the cell specified by the user.
水の流れる方向は、最急勾配法、特願2008−002284に示した方法などで決定すればよい。これによって、ユーザが指定したセルを下流端とする流域が抽出される。ところが、ステップ1によって得られた流域は誤っている可能性がある。なぜなら、得られた流域の外側にその流域に隣接する窪地がある場合、得られた流域は誤っている可能性があり(発見2)、そのような窪地が存在しないことを保証できないためである(発見1)。また、最上流は自明ではない(発見3)。つまり、たとえば地図や現場に、最上流を示す印があるわけではないため、ステップ1で得られる流域が正しいことを保証できない。 The direction of water flow may be determined by the steepest gradient method, the method described in Japanese Patent Application No. 2008-002284, or the like. As a result, a basin having a cell designated by the user as a downstream end is extracted. However, the basin obtained by step 1 may be incorrect. This is because if there is a depression adjacent to the basin outside the obtained basin, the obtained basin may be incorrect (Discovery 2) and it cannot be guaranteed that such a depression does not exist. (Discovery 1). The most upstream is not obvious (discovery 3). That is, for example, there is no mark indicating the most upstream on the map or on the site, so it cannot be guaranteed that the basin obtained in step 1 is correct.
ステップ2:ステップ1で抽出された流域の真偽を判定する。 Step 2: Determine the authenticity of the basin extracted in Step 1.
この判定には、流域の定義の対偶を利用する。すなわち、流域でないセルの下流に、流域でないセルしかなければその流域は正しい。発見3によれば、最下流は自明である。つまり、河川の最下流は海である(正確には、最下流は水の流出口がない領域であり、地域によっては、水の流出口がない湖、砂漠などが最下流となる場合もある。以下、水の流出口がない領域を「無効領域」、その領域に含まれるセルを「無効セル」と表記する)。ところが、プログラムでは最下流が無効領域とならない場合がありうる。つまり最下流が窪地となる場合である。そこで、このセル近傍の水の流れる方向を窪地埋め法により決定した後、下流探索をやり直す。こうして、ステップ1で抽出された流域以外のセルを開始セルとし、無効セルまで下流探索する。こうして得られた下流セルにユーザが指定したセルが含まれない場合、ステップ1で抽出された流域は真であると判定する。なお、プログラムの処理においては、標高値などの指標に基づいて下流探索を打ち切ってもよい。 For this determination, a pair of basin definitions is used. That is, if there is a non-basin cell downstream of a non-basin cell, the basin is correct. According to Discovery 3, the most downstream is obvious. In other words, the most downstream of the river is the sea. (To be precise, the most downstream is the area where there is no water outlet, and depending on the region, the lake, desert, etc. where there is no water outlet may be the downstream. Hereinafter, an area where there is no water outlet is referred to as an “invalid area”, and a cell included in the area is referred to as an “invalid cell”). However, in the program, the most downstream area may not be an invalid area. That is, the most downstream is a depression. Therefore, after determining the direction of water flow in the vicinity of the cell by the depression filling method, the downstream search is performed again. In this way, a cell other than the basin extracted in step 1 is set as a start cell, and a downstream search is performed to an invalid cell. If the cell specified by the user is not included in the downstream cells thus obtained, it is determined that the basin extracted in step 1 is true. In the program processing, the downstream search may be terminated based on an index such as an altitude value.
ステップ2の判定の結果が偽であれば、ステップ1に戻る。その場合、ユーザが指定したセルの上流に、ステップ1で抽出された流域以外のセルが存在する。したがって、再び実行されたステップ1で得られる流域は、前回のステップ1で得られた流域とは異なる。 If the result of determination in step 2 is false, the process returns to step 1. In that case, cells other than the basin extracted in step 1 exist upstream of the cell designated by the user. Therefore, the watershed obtained in step 1 executed again is different from the watershed obtained in the previous step 1.
なお、ステップ2において下流探索の開始セルとするセルは、ステップ1で抽出された流域以外のセルであって、かつステップ1で抽出された流域セルに隣接するセルだけに限定してもよい。なぜならばこれらのセルは、流域が偽と判定される場合に必ず下流探索されるためである。 Note that the cells used as the start cells for the downstream search in step 2 may be limited to cells other than the basin extracted in step 1 and adjacent to the basin cell extracted in step 1. This is because these cells are always searched downstream when the basin is determined to be false.
以下、本発明の実施形態を添付図面に基づいて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.
図1は、本発明の実施形態におけるコンピュータシステムの構成を示す概略ブロック図である。 FIG. 1 is a schematic block diagram showing the configuration of a computer system according to an embodiment of the present invention.
本実施形態のコンピュータシステムは、PC(Personal Computer)100によって構成される。PC100は、入出力部110を備える。入出力部110は、キーボード111およびマウス112などからなる入力部と、ディスプレイ113などからなる出力部によって構成される。ユーザは、入力部から命令を入力し、出力部を用いて結果を確認することができる。 The computer system of this embodiment is configured by a PC (Personal Computer) 100. The PC 100 includes an input / output unit 110. The input / output unit 110 includes an input unit including a keyboard 111 and a mouse 112, and an output unit including a display 113. The user can input a command from the input unit and check the result using the output unit.
さらにPC100は、メモリ120及びCPU(Central Processing Unit)130を備える。メモリ120には流域抽出プログラム141が展開される。この流域抽出プログラム141はCPU130への命令によって構成される。CPU130は、流域抽出プログラム141の命令に従い計算、HDD(Hard Disk Drive)190へのアクセス、および入出力部110との情報の交換などを行う。以下の説明において流域抽出プログラム141が実行する処理は、実際には、流域抽出プログラム141に記述された命令に従うCPU130によって実行される。 The PC 100 further includes a memory 120 and a CPU (Central Processing Unit) 130. A basin extraction program 141 is developed in the memory 120. This basin extraction program 141 is configured by an instruction to the CPU 130. The CPU 130 performs calculations according to instructions of the basin extraction program 141, accesses an HDD (Hard Disk Drive) 190, exchanges information with the input / output unit 110, and the like. In the following description, the processing executed by the basin extraction program 141 is actually executed by the CPU 130 according to instructions described in the basin extraction program 141.
HDD190には地図データ191、標高データ192、海域データ193が格納されており、流域抽出プログラムはこれらのデータを読み込むことができる。なお、HDD190は、PC100に内蔵されてもよいし、PC100の外部に接続されてもよいし、PC100からネットワーク経由でアクセスできる別の装置に接続されてもよい。 The HDD 190 stores map data 191, altitude data 192, and sea area data 193, and the basin extraction program can read these data. The HDD 190 may be incorporated in the PC 100, connected to the outside of the PC 100, or connected to another device that can be accessed from the PC 100 via a network.
地図データ191は、ユーザに場所を理解させる情報であればよい。地図データ191として適している情報として、地名、行政界、道路、鉄道、衛星画像、等高線、海岸線などが挙げられる。本実施形態では少なくとも等高線および海岸線が利用される。さらに、谷線、河道流路線、海岸線、湖沼面、海面等、水面の位置を示す情報、流域境界線など分水嶺の位置を示す情報が必要に応じて利用されてもよい。 The map data 191 may be information that allows the user to understand the location. Information suitable as the map data 191 includes place names, administrative boundaries, roads, railways, satellite images, contour lines, coastlines, and the like. In the present embodiment, at least a contour line and a coastline are used. Furthermore, information indicating the position of the water surface, such as a valley line, a river channel line, a coastline, a lake surface, and the sea surface, and information indicating the position of the watershed such as a basin boundary line may be used as necessary.
標高データ192は、一般的にDigital elevation model(DEM)と呼ばれるデータである。すなわち、セルの位置とそのセルにおける地表面の標高を記載した情報である。代表的なDEMは、地表面に等間隔で並べた正方形のセル(square grid)における標高の値である。 The elevation data 192 is data generally called a digital elevation model (DEM). That is, information describing the position of the cell and the altitude of the ground surface in the cell. A typical DEM is an elevation value in square grids arranged at equal intervals on the ground surface.
海域データ193は、流出口がない水域を示すデータである。つまり、海域に加え、閉塞湖沼域(水の流出口がない湖)等が判別できるデータである。多くの場合、このデータは海域を示すデータと同じであり、海域は標高データ192に基づいて判別できる。すなわち、通常の標高データでは、陸域には標高値が、海域には海域を示す値が格納されている。その場合、この海域データ193は不要であり、標高データ192のみで十分である。 The sea area data 193 is data indicating a water area having no outlet. In other words, in addition to the sea area, the data can identify a closed lake area (a lake without a water outlet). In many cases, this data is the same as the data indicating the sea area, and the sea area can be determined based on the altitude data 192. That is, in normal altitude data, an altitude value is stored in the land area, and a value indicating the sea area is stored in the sea area. In that case, this sea area data 193 is unnecessary, and only the altitude data 192 is sufficient.
図2は、本発明の実施形態のPC100によって実行される処理を示すシーケンス図である。 FIG. 2 is a sequence diagram illustrating processing executed by the PC 100 according to the embodiment of this invention.
以下、図2にしたがってシステムの処理シーケンスを説明する。 Hereinafter, the processing sequence of the system will be described with reference to FIG.
PC100で流域抽出プログラム141が起動される。流域抽出プログラム141は、HDD190から地図データ191を読み出す(ステップ201)。データを読み出した流域抽出プログラム141は、ウィンドウ300からなるGUI(Graphical User Interface)をディスプレイ113に出力する(ステップ202)。 The basin extraction program 141 is activated on the PC 100. The basin extraction program 141 reads the map data 191 from the HDD 190 (step 201). The basin extraction program 141 that has read the data outputs a GUI (Graphical User Interface) composed of the window 300 to the display 113 (step 202).
図3は、本発明の実施形態の流域抽出プログラム141が提供するGUIの入力待ちの状態を示す説明図である。 FIG. 3 is an explanatory diagram showing a waiting state for GUI input provided by the basin extraction program 141 according to the embodiment of this invention.
図3のGUIは、ディスプレイ113の所定の領域に表示されるウィンドウ300からなり、キーボード111及びマウス112による入力を受け付ける。ウィンドウ300は、少なくとも地図310を表示する。ユーザは、所定の操作によって、ユーザが必要とする地域の地図310を表示させることができる。地図310の縮尺は、流出現象の空間スケールと同程度であることが望ましい。したがって典型的な流出現象であれば、1/25,000かそれより粗い縮尺が適当である。本実施例の地図310は等高線311および海岸線312の情報を含む。 3 includes a window 300 displayed in a predetermined area of the display 113, and receives input from the keyboard 111 and the mouse 112. The window 300 displays at least a map 310. The user can display a map 310 of an area required by the user by a predetermined operation. The scale of the map 310 is preferably about the same as the spatial scale of the outflow phenomenon. Therefore, for typical spill events, a scale of 1 / 25,000 or coarser is appropriate. The map 310 of the present embodiment includes information on the contour line 311 and the coastline 312.
さらにウィンドウ300は少なくとも、ユーザが1以上の地点を指定するための機能、および、ユーザがその指定を確定するための機能を有する。後述するように、1以上の地点を指定するためにマウスポインタ301が使用され、その指定を確定するために解析ボタン303が使用される。 Further, the window 300 has at least a function for the user to designate one or more points and a function for the user to confirm the designation. As will be described later, the mouse pointer 301 is used to designate one or more points, and the analysis button 303 is used to confirm the designation.
このGUIを用いてユーザは解析対象を指定する(ステップ203)。本実施の形態では、ユーザがマウス112を動かすことによってマウスポインタ301を地図310上で動かし、マウス112をクリックすることによって、任意の地点を下流端として指定する。なお、ユーザの操作結果をユーザにわかりやすく伝えるために、指定した地点にアイコン302を表示することが望ましい。 Using this GUI, the user designates an analysis target (step 203). In the present embodiment, when the user moves the mouse 112, the mouse pointer 301 is moved on the map 310, and by clicking the mouse 112, an arbitrary point is designated as the downstream end. Note that it is desirable to display the icon 302 at a designated point in order to convey the user operation result to the user in an easy-to-understand manner.
図3は、ユーザが河口付近のごく近接した2地点を下流端として指定した状態を示している。この場合、流域抽出プログラム141は、これからこれらの2地点を下流端とし、それらの流域を解析することになる。ユーザは解析対象を入力した後、解析ボタン303をクリックする。解析ボタン303がクリックされると、流域抽出プログラム141は、入力された地点に対応するセルを「開始セル」として指定する。 FIG. 3 shows a state in which the user designates two very close points near the estuary as downstream ends. In this case, the basin extraction program 141 will analyze these basins with these two points as downstream ends. The user clicks the analysis button 303 after inputting the analysis target. When the analysis button 303 is clicked, the basin extraction program 141 designates the cell corresponding to the input point as the “start cell”.
なお、ステップ203で入力する解析対象を地点に限定する必要はない。セルに変換できる情報であるかぎり、どのような情報が入力されてもよい。地点以外の代表的な情報として、線又は面が挙げられる。入力された点、線又は面の情報は、地理情報システムの基本的な公知の技術を用いてセルに変換することができる。このような技術は、たとえば、伊里政夫 監修,腰塚武志 編集(1993),計算機科学と地理情報処理 第2版, 共立出版株式会社, ISBN 4320026365.に記載されている。 Note that it is not necessary to limit the analysis target input in step 203 to a point. Any information may be input as long as the information can be converted into a cell. Typical information other than the point includes a line or a surface. The input point, line or surface information can be converted into cells using the basic known techniques of geographic information systems. Such techniques are described, for example, by Masao Iri, Takeshi Koshizuka (1993), Computer Science and Geographic Information Processing 2nd Edition, Kyoritsu Publishing Co., Ltd., ISBN 4320026365.
線として河道流路線(河心線)を入力した場合、DEMによる表現が難しい細かい水路を考慮した流域抽出が可能になる。線として海岸線を入力した場合、その海岸線の流域を抽出することが可能になるため、たとえば湾の流域を抽出する際に便利である。面として湖沼面を入力した場合、その湖に対する流域を抽出することが可能になる。 When a river channel line (a river center line) is input as a line, it is possible to extract a basin in consideration of a fine water channel that is difficult to express by DEM. When a coastline is input as a line, it is possible to extract the basin of the coastline, which is convenient when extracting the basin of the bay, for example. When a lake surface is input as a surface, it is possible to extract a basin for that lake.
あるいは、これらの情報は、ユーザによって入力されるかわりに、地図データ191から取り込まれてもよい。たとえば、河道流路線、海岸線、湖沼面等は地理情報データとして一般に流通しているため、それらを利用することができる。 Alternatively, these pieces of information may be taken from the map data 191 instead of being input by the user. For example, since river channel lines, coastlines, lake surfaces, etc. are generally distributed as geographic information data, they can be used.
本実施形態では、サブウィンドウ330のラジオボタン332を操作することによって、ユーザが入力方法を選択できる。例えば、ユーザがラジオボタン332の「マウス指定」および「点」を指定した場合、ユーザは、マウス112を使用して下流端の地点を入力することができる。あるいは、ユーザがラジオボタン332の「開く」を指定した場合、ユーザは、地図データ191に含まれる情報(例えば河道流路線等)を入力することができる。 In this embodiment, the user can select an input method by operating the radio button 332 of the sub window 330. For example, when the user designates “mouse designation” and “point” of the radio button 332, the user can input the downstream end point using the mouse 112. Alternatively, when the user designates “open” of the radio button 332, the user can input information included in the map data 191 (for example, a river channel line).
さらに、ステップ203で、ユーザは、流域外の点、線、面等を追加的に入力してもよい。その場合、ユーザは、流域内の点、線、面等に加え、流域外の地点、線、面等を入力した後、解析ボタン303をクリックする。解析ボタン303がクリックされると、流域抽出プログラム141は流域外として入力された点、線、面等に対応するセルを「無効セル」に指定する。したがって、1以上のセルが開始セルとして、それ以外の0以上のセルが無効セルとして指定されることになる。流域外の情報を入力すると、後に説明する下流探索処理(ステップ504)を大幅に短縮することが可能になる。本実施形態では、サブウィンドウ330のラジオボタン331を操作することによって、入力された地点等が流域内または流域外のどちらであるかを選択できる。 Further, in step 203, the user may additionally input points, lines, surfaces, etc. outside the basin. In this case, the user inputs a point, line, surface, etc. outside the basin in addition to points, lines, surfaces, etc. in the basin, and then clicks the analysis button 303. When the analysis button 303 is clicked, the basin extraction program 141 designates a cell corresponding to a point, line, surface, or the like input as outside the basin as an “invalid cell”. Therefore, one or more cells are designated as start cells, and other zero or more cells are designated as invalid cells. When information outside the basin is input, the downstream search process (step 504) described later can be greatly shortened. In the present embodiment, by operating the radio button 331 of the sub window 330, it is possible to select whether the input point or the like is inside or outside the basin.
さらに、203で、ユーザは、標高データに基づく流域外セル(または無効セル)の判定方法を定義してもよい。一般に、ある地点の上流には、その地点よりも標高が高い地点のみが存在する。この知識を利用すれば、開始セルよりも標高の低いセルは流域外セル(または無効セル)と見なせる。したがって、流域抽出プログラム141は、開始セルよりも標高の低いセルを流域外セル(または無効セル)と見なしてもよい。あるいは、流域抽出プログラム141は、標高データに誤りがある場合を考慮し、ある値よりも小さい標高を持つセルを流域外セル(または無効セル)と見なしてもよい。 Further, at 203, the user may define a method for determining out-of-basin cells (or invalid cells) based on elevation data. Generally, only a point having an elevation higher than that point exists upstream of the point. By using this knowledge, a cell whose elevation is lower than that of the start cell can be regarded as an out-of-basin cell (or an invalid cell). Therefore, the basin extraction program 141 may consider a cell whose elevation is lower than that of the start cell as a cell outside the basin (or an invalid cell). Alternatively, the basin extraction program 141 may consider a cell having an altitude smaller than a certain value as a cell outside the basin (or an invalid cell) in consideration of a case where there is an error in the altitude data.
次に流域抽出プログラム141は、流域抽出処理(ステップ204)を繰り返し行う。このステップ204は、標高データおよび海域データ読み込み処理(ステップ205)、および、進捗表示処理(ステップ206)を含む。ステップ205では、流域抽出プログラム141がHDD190から標高データ192を読み込む。ステップ206では、流域抽出プログラム141が進捗を示す記号をウィンドウ300に表示する。ステップ206は必須ではないため省いてもよい。ステップ204の詳細は図5から10を用いて説明する。 Next, the basin extraction program 141 repeatedly performs the basin extraction process (step 204). This step 204 includes altitude data and sea area data reading processing (step 205) and progress display processing (step 206). In step 205, the basin extraction program 141 reads the altitude data 192 from the HDD 190. In step 206, the basin extraction program 141 displays a symbol indicating progress on the window 300. Step 206 is not essential and may be omitted. Details of step 204 will be described with reference to FIGS.
最後に流域抽出プログラム141は処理結果である流域をウィンドウ300に表示する(ステップ207)。 Finally, the basin extraction program 141 displays the basin as a processing result on the window 300 (step 207).
図4は、本発明の実施形態の流域抽出プログラム141が提供するGUIの解析終了の状態を示す説明図である。 FIG. 4 is an explanatory diagram illustrating a state where the analysis of the GUI provided by the basin extraction program 141 according to the embodiment of this invention is completed.
この図4には、流域を示す2種類の記号が表示されている。第1の記号は、水が流れる方向を示す線分401である。水はこの線分に沿って流れ下る。第2の記号は、分水嶺を示す線分402である。この分水嶺の内側にある水は、図3で指定した二つの点302のいずれかに流れ下る。一方で、この分水嶺の外側にある水は、図3で指定した二つの点302のいずれにも流れ下らない。 In FIG. 4, two kinds of symbols indicating the basin are displayed. The first symbol is a line segment 401 indicating the direction in which water flows. Water flows down along this line. The second symbol is a line segment 402 indicating a water divide. The water inside the diversion basin flows down to one of the two points 302 designated in FIG. On the other hand, the water outside the diversion tank does not flow down to any of the two points 302 designated in FIG.
次に、流域抽出処理(ステップ204)の詳細を説明する。 Next, details of the basin extraction process (step 204) will be described.
図5は、本発明の実施形態の流域抽出処理(ステップ204)の詳細を示すフローチャートである。 FIG. 5 is a flowchart showing details of the basin extraction process (step 204) according to the embodiment of the present invention.
ステップ501において、流域抽出プログラム141は、開始セルを「流域セル」とする。具体的には、流域抽出プログラム141は、開始セルのデータに含まれる、セルの種類を示す変数を「流域」に変更する。セルのデータについては後述する(図13参照)。開始セルは、ステップ203において解析対象として入力された点、線または面等に対応するセルである。前述の通り、点−セル、線−セル、または面−セルの変換には、地理情報システムの基本的な技術が用いられる。 In step 501, the basin extraction program 141 sets the start cell as a “basin cell”. Specifically, the basin extraction program 141 changes a variable indicating the cell type included in the data of the start cell to “basin”. The cell data will be described later (see FIG. 13). The start cell is a cell corresponding to the point, line, surface or the like input as an analysis target in step 203. As described above, the basic technology of the geographic information system is used for the point-cell, line-cell, or area-cell conversion.
ステップ502において、流域抽出プログラム141は、開始セルの上流を探索する。ここで、ステップ502で実行される上流探索処理について、図6および図7を参照して説明する。 In step 502, the watershed extraction program 141 searches upstream of the start cell. Here, the upstream search process executed in step 502 will be described with reference to FIGS.
図6は、本発明の実施形態の上流探索処理(ステップ502)の詳細を示すフローチャートである。図6の詳細な説明は後述する。 FIG. 6 is a flowchart showing details of the upstream search processing (step 502) according to the embodiment of this invention. Details of FIG. 6 will be described later.
図7は、本発明の実施形態の流域抽出プログラム141が提供するGUIの上流探索処理(ステップ502)の進捗を示す説明図である。 FIG. 7 is an explanatory diagram showing progress of the GUI upstream search processing (step 502) provided by the basin extraction program 141 according to the embodiment of this invention.
図6のステップ602で対象セルとして指定されたセルが、図7に点701として示されている。上流探索処理の進捗に伴って、対象セルは開始セルから上流方向に向かって1セルずつ進んでいくため、点701は上流方向に向かって1セルずつ進んでいく。また、ステップ603で読み込んだ部分領域が、図7に矩形702として示されている。この矩形も、上流探索処理の進捗に伴って上流方向に追加されていく。図7には4つの矩形が描かれている。これは、すでに4つの部分領域が読み込まれていることを示す。これらの点および矩形の動きによって、ユーザは、現在上流探索処理が実行されていることを知ることができ、さらに、その処理の進捗を直感的に把握することができる。このステップ502の処理によって、開始セルの流域が「流域セル」として抽出される。 The cell designated as the target cell in step 602 of FIG. 6 is shown as a point 701 in FIG. As the upstream search process progresses, the target cell advances from the start cell one cell at a time in the upstream direction, and the point 701 advances one cell at a time in the upstream direction. Further, the partial area read in step 603 is shown as a rectangle 702 in FIG. This rectangle is also added in the upstream direction as the upstream search process progresses. In FIG. 7, four rectangles are drawn. This indicates that four partial areas have already been read. From these points and the movement of the rectangle, the user can know that the upstream search process is currently being executed, and can intuitively grasp the progress of the process. Through the processing in step 502, the basin of the start cell is extracted as a “basin cell”.
ステップ503において、流域抽出プログラム141は、流域外セルを抽出する。この処理によって、ステップ502で抽出された流域セルでなく、かつ流域セルに隣接するセルが抽出される。抽出されたセルを流域外セルと記載する。 In step 503, the basin extraction program 141 extracts out-of-basin cells. By this process, not the basin cell extracted in step 502 but a cell adjacent to the basin cell is extracted. The extracted cell is referred to as an out-basin cell.
図8は、本発明の実施形態の流域抽出プログラム141が提供するGUIの流域外セル抽出処理(ステップ503)の進捗を示す説明図である。 FIG. 8 is an explanatory diagram showing the progress of the GUI outside basin cell extraction process (step 503) provided by the basin extraction program 141 according to the embodiment of this invention.
ステップ503で抽出された流域外セルが、図8に点801として示されている。ステップ504以降に行う流域の真偽判定によって、流域が正しいと判定された場合、これらの点801が分水嶺となる。あらかじめ分水嶺がどこにあるかがわかっているユーザは、これらの点からこれらからなされる真偽判定の結果を予想でき、さらに残りの処理にかかる時間をおおよそ予想することができる。 The out-of-basin cell extracted in step 503 is shown as point 801 in FIG. When it is determined that the basin is correct by the basin authenticity determination performed after step 504, these points 801 become watersheds. A user who knows in advance where the watershed is located can predict the result of true / false judgment made from these points, and can estimate the time required for the remaining processing.
ステップ504において、流域抽出プログラム141は、ステップ503で抽出されたセルの下流を探索する。 In step 504, the basin extraction program 141 searches downstream of the cell extracted in step 503.
図9は、本発明の実施形態の下流探索処理(ステップ504)の詳細を示すフローチャートである。図9の詳細な説明は後述する。 FIG. 9 is a flowchart illustrating details of the downstream search process (step 504) according to the embodiment of this invention. Details of FIG. 9 will be described later.
図10は、本発明の実施形態の流域抽出プログラム141が提供するGUIの下流探索処理(ステップ504)の進捗を示す説明図である。 FIG. 10 is an explanatory diagram showing the progress of the GUI downstream search processing (step 504) provided by the basin extraction program 141 according to the embodiment of this invention.
図9ステップ902で対象セルとして指定されたセルが、図10に点1001として示されている。下流探索処理の進捗に伴って、対象セルはステップ503で抽出した流域外セルから下流方向に向かって1セルずつ進んでいく。このため、点1001の動きによって、ユーザは、現在下流探索処理が実行されていることを知ることができ、さらに、その処理の進捗を直感的に把握することができる。下流探索処理によって、ステップ503で抽出した流域外セルの下流のセルが「流域外セル」として抽出される。 The cell designated as the target cell in step 902 in FIG. 9 is shown as a point 1001 in FIG. As the downstream search process progresses, the target cell advances one cell at a time from the out-basin cell extracted in step 503 toward the downstream direction. For this reason, the movement of the point 1001 allows the user to know that the downstream search process is currently being executed, and to intuitively grasp the progress of the process. Through the downstream search process, a cell downstream of the cell outside the basin extracted in step 503 is extracted as the “cell outside the basin”.
ステップ505において、流域抽出プログラム141は、やり直しフラグ(図9を参照して後述)の値を判定する。やり直しフラグの値が真であると判定された場合、前回のステップ502の上流探索処理(現在までにステップ502から505のループが複数回実行された場合、最後に実行された上流探索処理)によって得られた流域が誤っている。言い換えると、真の流域は、前回の上流探索処理によって得られた流域のさらに外側まで広がっている。この場合、処理はステップ502に戻る。そして、流域抽出プログラム141は、再び開始セルの上流探索を実行する。前回の下流探索処理の際に窪地埋め処理が実行された場合、後述するように、窪地内のセルの下流方向が決定されている。この場合、今回の上流探索処理の結果は、前回の上流探索処理の結果と異なる。 In step 505, the basin extraction program 141 determines the value of the redo flag (described later with reference to FIG. 9). If it is determined that the value of the redo flag is true, the previous upstream search process in step 502 (if the loop from step 502 to 505 has been executed a plurality of times so far, the upstream search process executed last) The obtained basin is incorrect. In other words, the true basin extends further outside the basin obtained by the previous upstream search process. In this case, the process returns to step 502. Then, the basin extraction program 141 executes the upstream search for the start cell again. When the depression filling process is executed in the previous downstream search process, the downstream direction of the cell in the depression is determined as will be described later. In this case, the result of the current upstream search process is different from the result of the previous upstream search process.
ステップ505において、やり直しフラグの値が偽であると判定された場合、前回の上流探索処理によって得られた流域が正しい。このため、流域抽出プログラム141は、流域抽出処理を終了する。 If it is determined in step 505 that the value of the redo flag is false, the basin obtained by the previous upstream search process is correct. Therefore, the basin extraction program 141 ends the basin extraction process.
以上、本実施例の全体的な処理の流れについて説明した。以下、個々の処理およびそれらの処理を実現するデータ構造について詳細に述べる。 The overall processing flow of the present embodiment has been described above. Hereinafter, individual processes and data structures for realizing the processes will be described in detail.
図11は、本発明の実施形態のセルおよび部分領域を示す説明図である。 FIG. 11 is an explanatory diagram showing cells and partial areas according to the embodiment of the present invention.
本実施形態では、空間の東西方向をx軸(1101)、南北方向をy軸(1102)とする2次元直交座標系を利用する。さらにこの空間を、x軸方向にdx(1103)、y軸方向にdy(1104)の間隔で分割してセルを生成する。地点(x,y)にあるセル(i,j)は以下の式(1)で求められる。 In this embodiment, a two-dimensional orthogonal coordinate system is used in which the east-west direction of the space is the x-axis (1101) and the north-south direction is the y-axis (1102). Furthermore, this space is divided at intervals of dx (1103) in the x-axis direction and dy (1104) in the y-axis direction to generate cells. The cell (i, j) at the point (x, y) is obtained by the following equation (1).
i=floor(x/dx), j=floor(y/dy) ......... (1) i = floor (x / dx), j = floor (y / dy) ......... (1)
ただし、floor()は小数部分を切り捨てることによって整数にする関数である。 However, floor () is a function that makes an integer by truncating the decimal part.
部分領域は、複数のセルからなる領域である。部分領域は、x軸方向にsi(1105)、y軸方向にsj(1106)のセルからなるとする。ただし、siおよびsjは2以上の整数である(この図11にはsi=10,sj=10の例を示したが、図7、図8及び図10にはsi=28,sj=28の例を示した)。したがって、1つのセルは1つの部分領域に含まれる。セル(i,j)が含まれる部分領域(bi,bj)は次の式(2)で求められる。 The partial area is an area composed of a plurality of cells. The partial area is assumed to be composed of cells of si (1105) in the x-axis direction and sj (1106) in the y-axis direction. However, si and sj are integers of 2 or more (in FIG. 11, an example of si = 10 and sj = 10 is shown, but in FIGS. 7, 8 and 10, si = 28 and sj = 28. Example). Therefore, one cell is included in one partial area. The partial region (bi, bj) including the cell (i, j) is obtained by the following equation (2).
bi=floor(i/si), bj=floor(j/sj) ......... (2) bi = floor (i / si), bj = floor (j / sj) ......... (2)
図12は、本発明の実施形態の部分領域のデータ構造を示す説明図である。 FIG. 12 is an explanatory diagram illustrating a data structure of a partial area according to the embodiment of this invention.
以下のデータ構造に関する説明では、C++などオブジェクト指向型言語に向いた実装方法を示す。表1200に部分領域型のデータを示す。実装の際には、これらのデータをメンバ変数として持つ、クラス名CellUnitの型とすればよい。 In the following description regarding the data structure, an implementation method suitable for an object-oriented language such as C ++ is shown. Table 1200 shows partial area type data. At the time of implementation, the type of the class name CellUnit having these data as member variables may be used.
CellUnitは、Id、Cells、Targetsの3つのメンバ変数を持つクラスである。 CellUnit is a class having three member variables: Id, Cells, and Targets.
Idは整数型であり、上記式(2)に示したbi,bjから一意に生成した値を保持する(行1201)。Idは、たとえばbi,bjをそれぞれ32ビット整数、Idを64ビット整数とし、0から31ビットまでにbiの値を、32から63ビットまでにbjの値を格納することによって作成されてもよい。 Id is an integer type, and holds a value uniquely generated from bi and bj shown in the above formula (2) (line 1201). Id may be created, for example, by setting bi and bj as 32-bit integers and Id as 64-bit integers, storing the value of bi from 0 to 31 bits and the value of bj from 32 to 63 bits, respectively. .
Cellsは図13で説明するセル型を格納する固定長配列である(行1202)。配列の長さは、1つの部分領域に含まれるセルの数、すなわち、si*sjである。 Cells is a fixed-length array that stores the cell types described in FIG. 13 (line 1202). The length of the array is the number of cells included in one partial area, that is, si * sj.
Targetsは、セル型を格納する可変長配列である(行1203)。この変数の初期値はempty、すなわち格納された要素がない配列である。 Targets is a variable length array that stores cell types (row 1203). The initial value of this variable is empty, that is, an array with no stored elements.
図13は、本発明の実施形態のセルのデータ構造を示す説明図である。 FIG. 13 is an explanatory diagram illustrating a data structure of a cell according to the embodiment of this invention.
表1300にセル型のデータを示す。セル型(クラス名Cell)は、Glev、Kind、DownDirの3つのメンバ変数を持つクラスである。 Table 1300 shows cell type data. The cell type (class name Cell) is a class having three member variables Glev, Kind, and DownDir.
Glevは実数型であり、標高を保持する(行1301)。 Glev is a real type and holds the altitude (line 1301).
Kindは列挙型であり、未定(0)、流域(1)、流域外(2)または無効(3)の別を示すフラグである(行1302)。未定(0)は、セルが有効セルであるが、流域セルまたは流域外セルのいずれであるかがまだ定まっていないことを示す。流域(1)は、セルが有効セルであり、かつ、流域セルであることを示す。流域外(2)は、セルが有効セルであり、かつ、流域外セルである(言い換えると他の流域に属する流域セルである)ことを示す。無効(3)は、セルが無効セルであることを示す。Kindの初期値は、未定(0)である。 Kind is an enumerated type and is a flag indicating whether it is undecided (0), basin (1), out of basin (2), or invalid (3) (line 1302). Undecided (0) indicates that the cell is a valid cell, but it is not yet determined whether it is a basin cell or an out-of-basin cell. The basin (1) indicates that the cell is an effective cell and is a basin cell. Outside the basin (2) indicates that the cell is an effective cell and is a cell outside the basin (in other words, a basin cell belonging to another basin). Invalid (3) indicates that the cell is an invalid cell. The initial value of Kind is undecided (0).
DownDirは列挙型であり、水が流れる方向(すなわち隣接下流セルの方向)を示すフラグである(行1303)。DownDirの具体的な値については図14及び図15を参照して説明する。DownDirの初期値は、隣接下流セルが存在しないことを示す値0である。水が流れる方向を求めるためには、セル勾配を求める必要がある。 DownDir is an enumerated type, and is a flag indicating the direction in which water flows (that is, the direction of an adjacent downstream cell) (line 1303). A specific value of DownDir will be described with reference to FIGS. The initial value of DownDir is 0 indicating that there is no adjacent downstream cell. In order to determine the direction in which water flows, it is necessary to determine the cell gradient.
図14は、本発明の実施形態のセル勾配についての説明図である。 FIG. 14 is an explanatory diagram of the cell gradient according to the embodiment of this invention.
図14には、セル1400を中心にi軸方向に3セル、j軸方向に3セルを示した。セル(i,j)における勾配は、セル(i,j)の標高値と、その格子に隣接するセルにおける標高値との差をセル間の距離で割った値である。1セルには8セルが隣接する。したがって、セル(i,j)における8方向の勾配が算出される。勾配の方向をそれぞれ矢印1401から矢印1408で示す。矢印1401から矢印1408に対応する勾配をそれぞれGrad1からGrad8と命名する。変数Grad1からGrad8の値を求める式は以下の通りである。 FIG. 14 shows three cells in the i-axis direction and three cells in the j-axis direction centering on the cell 1400. The gradient in the cell (i, j) is a value obtained by dividing the difference between the elevation value of the cell (i, j) and the elevation value in the cell adjacent to the grid by the distance between the cells. Eight cells are adjacent to one cell. Accordingly, gradients in eight directions in the cell (i, j) are calculated. The direction of the gradient is indicated by arrows 1401 to 1408, respectively. The gradients corresponding to the arrows 1401 to 1408 are named Grad1 to Grad8, respectively. The formula for obtaining the values of the variables Grad1 to Grad8 is as follows.
Grad1=(Glev[i,j]-Glev[i-1,j+1])/hypot(dx,dy) ......... (3-1)
Grad2=(Glev[i,j]-Glev[i,j+1])/dy ......... (3-2)
Grad3=(Glev[i,j]-Glev[i+1,j+1])/hypot(dx,dy) ......... (3-3)
Grad4=(Glev[i,j]-Glev[i-1,j])/dx ......... (3-4)
Grad5=(Glev[i,j]-Glev[i+1,j])/dx ......... (3-5)
Grad6=(Glev[i,j]-Glev[i-1,j-1])/hypot(dx,dy) ......... (3-6)
Grad7=(Glev[i,j]-Glev[i,j-1])/dy ......... (3-7)
Grad8=(Glev[i,j]-Glev[i+1,j-1])/hypot(dx,dy) ......... (3-8)
Grad1 = (Glev [i, j] -Glev [i-1, j + 1]) / hypot (dx, dy) ......... (3-1)
Grad2 = (Glev [i, j] -Glev [i, j + 1]) / dy ......... (3-2)
Grad3 = (Glev [i, j] -Glev [i + 1, j + 1]) / hypot (dx, dy) ......... (3-3)
Grad4 = (Glev [i, j] -Glev [i-1, j]) / dx ......... (3-4)
Grad5 = (Glev [i, j] -Glev [i + 1, j]) / dx ......... (3-5)
Grad6 = (Glev [i, j] -Glev [i-1, j-1]) / hypot (dx, dy) ......... (3-6)
Grad7 = (Glev [i, j] -Glev [i, j-1]) / dy ......... (3-7)
Grad8 = (Glev [i, j] -Glev [i + 1, j-1]) / hypot (dx, dy) ......... (3-8)
ただし、Glev[i,j]はセル(i,j)における標高、hypot(x,y)は原点(0,0)と点(x,y)との距離を返す関数である。なお、本実施例では隣接するセルとして8近傍(すなわち隣接する8個のセル)を利用した。これは、隣接セルが増えるほど精度のよい結果が期待できるためである。ただし、隣接するセルとして8近傍ではなく4近傍(すなわち隣接する4個のセル)を使用してもよい。その場合は、上記8方向の勾配のうちGrad2、Grad4、Grad5、Grad7のみを利用すればよい。 However, Glev [i, j] is a function that returns the altitude in cell (i, j), and hypot (x, y) is a function that returns the distance between the origin (0,0) and point (x, y). In this embodiment, 8 neighbors (that is, 8 adjacent cells) are used as adjacent cells. This is because more accurate results can be expected as the number of adjacent cells increases. However, as the adjacent cells, not four neighbors but four neighbors (that is, four neighboring cells) may be used. In that case, it is sufficient to use only Grad2, Grad4, Grad5, and Grad7 among the gradients in the above eight directions.
あるセル(i,j)の隣接下流セルは、そのセル(i,j)の勾配Grad1からGrad8から求められる。具体的には、あるセル(i,j)の隣接下流セルは、そのセルの最も急な下り勾配方向にある隣接セルである。最も急な下り勾配とは、勾配Grad1からGrad8の最大値であり、最も急な下り勾配方向とは、勾配Grad1からGrad8の最大値の方向である。この最も急な下り勾配方向は、以下(a)から(c)の3ケースに分類できる。 An adjacent downstream cell of a cell (i, j) is obtained from the gradients Grad1 to Grad8 of the cell (i, j). Specifically, an adjacent downstream cell of a certain cell (i, j) is an adjacent cell in the steepest downward gradient direction of the cell. The steepest downward gradient is the maximum value of the gradients Grad1 to Grad8, and the steepest downward gradient direction is the direction of the maximum value of the gradients Grad1 to Grad8. This steepest downward gradient direction can be classified into the following three cases (a) to (c).
(a)最も急な下り勾配が0より大、かつ1方向の場合。この場合、最も急な下り勾配方向を水が流れる方向とする。 (A) The steepest downward slope is greater than 0 and is in one direction. In this case, the steepest downward gradient direction is the direction in which water flows.
(b)最も急な下り勾配が0より大、かつ2方向以上の場合。この場合、最も急な下り勾配方向から、あらかじめ決めた方向優先度に従って1方向を選択する。本実施形態では、下記の式(4)の順に優先度の高さが設定される。 (B) When the steepest descending slope is greater than 0 and more than one direction. In this case, one direction is selected according to a predetermined direction priority from the steepest downward gradient direction. In the present embodiment, the priority is set in the order of the following formula (4).
Grad2 > Grad5 > Grad7 > Grad4 > Grad1 > Grad3 > Grad8 > Grad6......... (4) Grad2> Grad5> Grad7> Grad4> Grad1> Grad3> Grad8> Grad6 ......... (4)
例えば、Grad2とGrad3の値が同じであり、かつ、これらが最も急な下り勾配方向である場合、Grad2の優先度がGrad3より高いため、Grad2に対応する方向1402のセル(i,j+1)が隣接下流セルである。 For example, if the values of Grad2 and Grad3 are the same, and these are the steepest downward gradient directions, the priority of Grad2 is higher than that of Grad3, so the cell (i, j + 1) in the direction 1402 corresponding to Grad2 ) Is an adjacent downstream cell.
(c)最も急な下り勾配が0以下の場合。この場合、水が流れる方向は存在せず、隣接下流セルは存在しないと判定される。本実施形態では後に説明するように無効セルの標高を負の無限大として扱っているため、最も急な下り勾配方向が0以下であると判定されたセルは窪地または平地である。 (C) When the steepest descending slope is 0 or less. In this case, there is no direction in which water flows, and it is determined that there is no adjacent downstream cell. In this embodiment, since the altitude of the invalid cell is treated as negative infinity as will be described later, the cell in which the steepest downward gradient direction is determined to be 0 or less is a depression or a flat ground.
図15は、本発明の実施形態において水が流れる方向と、それに対応するフラグの値を説明するための図である。 FIG. 15 is a diagram for explaining the direction in which water flows and the flag values corresponding thereto in the embodiment of the present invention.
実装では、セル型Cellのメンバ変数DownDirが、図15に示す値を保持する。最も急な下り勾配方向が上記(a)または(b)の場合、DownDirは1,2,4,8,16,32,64,128のいずれかの値になる。たとえばセル(i,j)の水が流れる方向が図14の方向1405である(すなわち、セル(i,j)の隣接下流セルがセル(i+1,j)である)場合、DownDirの値は1となる。最も急な下り勾配方向が上記(c)の場合(すなわち隣接下流セルが存在しない場合)、DownDirは未定を表す値0になる。 In the implementation, the member variable DownDir of the cell type Cell holds the value shown in FIG. When the steepest downward gradient direction is (a) or (b), DownDir has a value of 1, 2, 4, 8, 16, 32, 64, or 128. For example, if the direction in which the water in the cell (i, j) flows is the direction 1405 in FIG. 14 (that is, the adjacent downstream cell of the cell (i, j) is the cell (i + 1, j)), the value of DownDir Becomes 1. When the steepest downward gradient direction is (c) (that is, when there is no adjacent downstream cell), DownDir has a value 0 indicating undetermined.
次に、図6を用いて上流探索処理(ステップ502)の詳細を説明する。 Next, details of the upstream search process (step 502) will be described with reference to FIG.
流域抽出プログラム141は、それぞれの流域セルについてステップ601からステップ612までの処理を繰り返す。図6の説明において、このループの処理対象のセルをcell1と記載する。実装では、ステップ501で部分領域クラスCellUnitのメンバ変数Targetsに開始セルを格納し、Targetsのそれぞれの要素についてこのループを実行する。 The basin extraction program 141 repeats the processing from step 601 to step 612 for each basin cell. In the description of FIG. 6, the processing target cell of this loop is referred to as cell1. In the implementation, in step 501, the start cell is stored in the member variable Targets of the partial region class CellUnit, and this loop is executed for each element of Targets.
ステップ602において、流域抽出プログラム141は、cell1を「対象セル」として指定する。 In step 602, the basin extraction program 141 designates cell1 as the “target cell”.
ステップ603において、流域抽出プログラム141は、対象セル(cell1)を含む部分領域を読み込む。これによって、標高データ192および海域データ193が読み込まれる。流域抽出プログラム141は、海域データ193に基づいて海域と判別されたセルを、無効セルに指定する。さらに、ステップ203で無効セルまたは流域外セルが指定されている場合、流域抽出プログラム141は、そのセルを無効セルまたは流域外セルに指定する。そして、流域抽出プログラム141は、無効セルの標高を負の無限大にする。 In step 603, the basin extraction program 141 reads a partial region including the target cell (cell1). Thereby, the altitude data 192 and the sea area data 193 are read. The basin extraction program 141 designates a cell determined as a sea area based on the sea area data 193 as an invalid cell. Furthermore, when an invalid cell or a non-basin cell is designated in step 203, the basin extraction program 141 designates the cell as an invalid cell or a non-basin cell. Then, the basin extraction program 141 makes the altitude of the invalid cell negative infinity.
実装では、例えば、下記の手順が実行される。まず、流域抽出プログラム141は、メモリ120に部分領域クラスCellUnitのインスタンスを生成する。部分領域クラスCellUnitのインスタンスは、変数Idにbi,bjから生成したIDを格納し、変数CellsにセルクラスCellのインスタンスをsi*sj個保持する。セルクラスCellのメンバ変数Kind及びDownDirは表1300に示した初期値に初期化される。 In the implementation, for example, the following procedure is executed. First, the basin extraction program 141 generates an instance of the partial region class CellUnit in the memory 120. The instance of the partial region class CellUnit stores the ID generated from bi and bj in the variable Id, and holds si * sj instances of the cell class Cell in the variable Cells. The member variables Kind and DownDir of the cell class Cell are initialized to the initial values shown in Table 1300.
メンバ変数GlevおよびKindには、次のような値が格納される。海域データ193、または、ステップ203における指定に基づいて、セルが無効セルであると判定された場合、メンバ変数Glevには標高値として負の無限大が格納され、メンバ変数Kindには無効(3)が格納される。セルが有効セルであると判定された場合、メンバ変数Glevには標高値としてHDD191から読み込まれた標高データ192が格納され、メンバ変数Kindには未定(0)が格納される。ただし、セルが流域外セルであると判定された場合、メンバ変数Kindには流域外(2)が格納される。 The following values are stored in the member variables Glev and Kind. When it is determined that the cell is an invalid cell based on the sea area data 193 or the designation in step 203, negative infinity is stored in the member variable Glev as an elevation value, and invalid (3 ) Is stored. When it is determined that the cell is a valid cell, the altitude data 192 read from the HDD 191 is stored as the altitude value in the member variable Glev, and undetermined (0) is stored in the member variable Kind. However, when it is determined that the cell is a cell outside the basin, the outside of the basin (2) is stored in the member variable Kind.
次に、流域抽出プログラム141は、対象セル(cell1)のそれぞれの隣接セルについてステップ604からステップ611までの処理を繰り返す。図6の説明において、このループの処理対象のセル(すなわち、cell1に隣接する複数のセルの各々)をcell2と記載する。 Next, the basin extraction program 141 repeats the processing from step 604 to step 611 for each adjacent cell of the target cell (cell1). In the description of FIG. 6, a cell to be processed in this loop (that is, each of a plurality of cells adjacent to cell1) is referred to as cell2.
ステップ605において、流域抽出プログラム141は、cell2の隣接下流セルが対象セル(cell1)であるか否かを判定する。この判定の結果が真である場合、処理はステップ606に、偽である場合、処理はステップ611に進む。 In step 605, the basin extraction program 141 determines whether the adjacent downstream cell of cell2 is the target cell (cell1). If the result of this determination is true, the process proceeds to step 606, and if it is false, the process proceeds to step 611.
cell2の隣接下流セルは、図14を参照して説明したように、最急勾配法によって求められる。ただし、後述するように、窪地埋め処理によってcell2の下流方向が決定された場合、その下流方向に基づいてcell2の隣接下流セルが求められる。 The adjacent downstream cell of cell2 is obtained by the steepest gradient method as described with reference to FIG. However, as described later, when the downstream direction of cell2 is determined by the depression filling process, the adjacent downstream cell of cell2 is obtained based on the downstream direction.
実装では、このステップによってcell2のメンバ変数DownDirに水が流れる方向を示す値が格納される。 In the implementation, a value indicating the direction in which water flows is stored in the member variable DownDir of cell2 by this step.
ステップ606において、流域抽出プログラム141は、cell2の種類を判定する。具体的には、流域抽出プログラム141は、cell2に関するセルクラスCellのメンバ変数Kindの値を参照して、cell2が流域セル、流域外セル、無効セルまたは未定セルのいずれであるかを判定する。 In step 606, the basin extraction program 141 determines the type of cell2. Specifically, the basin extraction program 141 refers to the value of the member variable Kind of the cell class Cell relating to cell2, and determines whether cell2 is a basin cell, a non-basin cell, an invalid cell, or an undetermined cell.
流域の定義によれば、cell2が有効セルであり、cell2の隣接下流セルがcell1であり、かつ、cell1が流域セルである場合、cell2は必ず流域セルである。このことに合致するように、流域抽出プログラム141は、cell2に関するセルクラスCellのメンバ変数Kindの値を更新する(ステップ607〜ステップ610)。 According to the definition of the basin, if cell2 is a valid cell, the cell adjacent to cell2 is cell1, and cell1 is a basin cell, cell2 is necessarily a basin cell. In order to match this, the basin extraction program 141 updates the value of the member variable Kind of the cell class Cell relating to cell2 (steps 607 to 610).
cell2に関するセルクラスCellのメンバ変数Kindの値が流域(1)である場合、cell2は既に流域セルとして扱われている。この場合、メンバ変数Kindの値を更新する必要がないため、流域抽出プログラム141は、メンバ変数Kindの値を更新せずに(ステップ607)、ステップ611に進む。 If the value of the member variable Kind of the cell class Cell relating to cell2 is the basin (1), cell2 is already handled as a basin cell. In this case, since it is not necessary to update the value of the member variable Kind, the basin extraction program 141 proceeds to step 611 without updating the value of the member variable Kind (step 607).
メンバ変数Kindの値が流域外(2)である場合、cell2は流域外セルである。このことは、cell2が既に他の流域に属する流域セルであると判定されていることを意味する。この場合、流域抽出プログラム141は、メンバ変数Kindの値を更新せずに(ステップ608)、ステップ611に進む。ただし、流域の定義によれば、ステップ606においてcell2が有効セルであると判定された場合、cell2は必ず流域セルである。このため、上流探索が正常に実行されている限り、ステップ606においてcell2が流域外セルであると判定されることはあり得ない。 If the value of the member variable Kind is outside the basin (2), cell2 is a basin outside cell. This means that cell2 has already been determined to be a basin cell belonging to another basin. In this case, the basin extraction program 141 proceeds to step 611 without updating the value of the member variable Kind (step 608). However, according to the definition of the basin, if it is determined in step 606 that cell2 is a valid cell, cell2 is necessarily a basin cell. For this reason, as long as the upstream search is normally executed, it is impossible to determine that cell2 is a cell outside the basin in step 606.
メンバ変数Kindの値が無効(3)である場合、cell2は無効セルである。この場合、cell2は流域セルになり得ないため、流域抽出プログラム141は、メンバ変数Kindの値を更新せずに(ステップ609)、ステップ611に進む。 If the value of the member variable Kind is invalid (3), cell2 is an invalid cell. In this case, since cell2 cannot be a basin cell, the basin extraction program 141 proceeds to step 611 without updating the value of the member variable Kind (step 609).
メンバ変数Kindの値が未定(0)である場合、cell2は未定セルである。上記のように、流域の定義によれば、ステップ606においてcell2が有効セルであると判定された場合、cell2は必ず流域セルである。このため、流域抽出プログラム141は、cell2を流域セルに変更して(ステップ610)、ステップ611に進む。具体的には、流域抽出プログラム141は、cell2に関するセルクラスCellのメンバ変数Kindの値を流域(1)に更新する。さらに、流域抽出プログラム141は、部分領域クラスCellUnitのメンバ変数Targetsにcell2を追加する。これによって、cell2は新たな対象セルとなる。 When the value of the member variable Kind is undetermined (0), cell2 is an undetermined cell. As described above, according to the definition of the basin, if it is determined in step 606 that cell2 is a valid cell, cell2 is necessarily a basin cell. Therefore, the basin extraction program 141 changes cell2 to a basin cell (step 610), and proceeds to step 611. Specifically, the basin extraction program 141 updates the value of the member variable Kind of the cell class Cell relating to cell2 to the basin (1). Furthermore, the basin extraction program 141 adds cell2 to the member variable Targets of the partial region class CellUnit. As a result, cell2 becomes a new target cell.
ステップ611では、ステップ604のループに戻る。cell1に隣接する全てのcell2についてステップ604〜611のループが終了するまで、このループが繰り返し実行される。 In step 611, the process returns to the loop in step 604. This loop is repeatedly executed until the loop of steps 604 to 611 is completed for all cell2 adjacent to cell1.
ステップ612では、ステップ601のループに戻る。全ての対象セルについてステップ601〜612のループが終了するまで、このループが繰り返し実行される。 In step 612, the process returns to the loop of step 601. This loop is repeatedly executed until the loop of steps 601 to 612 is completed for all the target cells.
次に、図9を用いて下流探索処理(ステップ504)の詳細を説明する。 Next, details of the downstream search process (step 504) will be described with reference to FIG.
流域抽出プログラム141は、それぞれの流域外セルについて、ステップ901からステップ912までの処理を繰り返す。図9の説明において、このループの処理対象のセルをcell1と記載する。実装では、ステップ503で部分領域クラスCellUnitのメンバ変数Targetsに流域外セルを格納し、Targetsのそれぞれの要素についてこのループを実行する。 The basin extraction program 141 repeats the processing from step 901 to step 912 for each cell outside the basin. In the description of FIG. 9, the processing target cell of this loop is referred to as cell1. In the implementation, in step 503, cells outside the basin are stored in the member variable Targets of the partial region class CellUnit, and this loop is executed for each element of Targets.
例えば、ステップ502が終了した時点で図8に示す複数のセル801が流域外セルである場合、これらの全てのセル801がメンバ変数Targetsに格納される。そして、全ての流域外セルについて処理が終了するまで、各流域外セルを対象として図9のループが繰り返される。 For example, when the plurality of cells 801 shown in FIG. 8 are out-basin cells when step 502 is completed, all these cells 801 are stored in the member variable Targets. Then, the loop of FIG. 9 is repeated for each out-basin cell until the processing is completed for all out-basin cells.
なお、図9の説明において、「流域セル」とは、開始セル(図3の例ではアイコン302に対応するセル)が属する流域に属するセルを、「他の流域」とは、開始セルが属する流域と異なる流域を、流域外セルとは、他の流域に属するセル(すなわち、開始セルの上流にないセル)を、それぞれ意味する。 In the description of FIG. 9, “basin cell” refers to a cell belonging to the basin to which the start cell (cell corresponding to the icon 302 in the example of FIG. 3) belongs, and “other basin” refers to the start cell. A basin different from the basin, and a cell outside the basin mean a cell belonging to another basin (that is, a cell not located upstream of the start cell).
ステップ902において、流域抽出プログラム141は、cell1を「対象セル」として指定する。 In step 902, the basin extraction program 141 designates cell1 as the “target cell”.
ステップ903において、流域抽出プログラム141は、対象セル(cell1)を含む部分領域を読み込む。この動作はステップ603と同じである。 In step 903, the basin extraction program 141 reads a partial region including the target cell (cell1). This operation is the same as step 603.
ステップ904において、流域抽出プログラム141は、cell1の隣接下流セル(図9の説明においてcell2と記載する)を特定し、その種類を判定する。具体的には、流域抽出プログラム141は、cell2が存在するか否か、及び、存在する場合、cell2に関するセルクラスCellのメンバ変数Kindの値を参照して、cell2が流域セル、流域外セル、無効セルまたは未定セルのいずれであるかを判定する。cell1の隣接下流セルは、最急勾配法(図14参照)によって求められる。実装では、cell1のメンバ変数DownDirに、水が流れる方向を示す値が格納される。 In step 904, the basin extraction program 141 identifies an adjacent downstream cell of cell1 (described as cell2 in the description of FIG. 9) and determines its type. Specifically, the basin extraction program 141 refers to whether or not cell2 exists, and if so, with reference to the value of the member variable Kind of the cell class Cell related to cell2, cell2 is a basin cell, a basin cell, It is determined whether the cell is an invalid cell or an undetermined cell. The cell adjacent to cell1 is obtained by the steepest gradient method (see FIG. 14). In the implementation, a value indicating the direction in which water flows is stored in the member variable DownDir of cell1.
ここで、ステップ904の判定結果に基づく処理の概要を説明する。 Here, the outline of the processing based on the determination result in step 904 will be described.
流域の定義によれば、ステップ503で抽出されたセルが流域外セルであれば、その下流の有効セルは、必ず流域外セルである。図9のcell1は、ステップ503で抽出されたセル自体またはその下流のセルであり、cell2はさらにその下流のセルである。したがって、cell1が流域外セルであり、cell1の隣接下流セルがcell2であり、かつ、cell2が有効セルである場合、cell2は必ず流域外セルである。このことに合致するように、流域抽出プログラム141は、cell2に関するセルクラスCellのメンバ変数Kindの値を更新する。 According to the definition of the basin, if the cell extracted in step 503 is a cell outside the basin, the downstream effective cell is always a cell outside the basin. In FIG. 9, cell1 is the cell itself extracted in step 503 or a cell downstream thereof, and cell2 is a cell further downstream thereof. Therefore, when cell1 is a cell outside the basin, the downstream cell adjacent to cell1 is cell2, and cell2 is an effective cell, cell2 is always a cell outside the basin. In order to match this, the basin extraction program 141 updates the value of the member variable Kind of the cell class Cell relating to cell2.
このような処理において、cell1が流域外セルであるにもかかわらずcell2が流域セルであると判定されることは、ステップ503で抽出されたセルが実は流域セルであることを示す。これは、直前の上流探索処理によって取得された流域が誤っていたこと、すなわち、上流探索処理のやり直しが必要であることを意味する。この場合、流域抽出プログラム141は、やり直しフラグの値を更新する。 In such a process, it is determined that cell2 is a basin cell even though cell1 is a non-basin cell, indicating that the cell extracted in step 503 is actually a basin cell. This means that the basin acquired by the immediately upstream search process is incorrect, that is, the upstream search process needs to be redone. In this case, the basin extraction program 141 updates the value of the redo flag.
やり直しフラグは、上流探索処理のやり直しが必要であるか否かを示す。具体的には、やり直しフラグの値がtrue(真)であることは、上流探索処理のやり直しが必要であることを示す。やり直しフラグは、例えば、初期値false(偽)のブール型のグローバル変数Failedである。 The redo flag indicates whether the upstream search process needs to be redo. Specifically, the value of the redo flag being true indicates that the upstream search process needs to be redo. The redo flag is, for example, a Boolean global variable Failed having an initial value of false.
次に、上記の処理の詳細を説明する。 Next, details of the above processing will be described.
cell2に関するセルクラスCellのメンバ変数Kindの値が流域(1)である場合、cell2は流域セルである。このことは、cell1が流域外セルであることと矛盾する。すなわち、このことは、既に流域外セルであると判定されているcell1及びその上流の全てのセルが実は流域セルであること、さらに言い換えると、前回の上流探索処理(ステップ502)の結果が誤っていることを意味する。このため、流域抽出プログラム141は、やり直しフラグの値を真に更新し(ステップ905)、ステップ912に進む。 If the value of the member variable Kind of the cell class Cell relating to cell2 is the basin (1), cell2 is a basin cell. This contradicts that cell1 is a cell outside the basin. That is, this means that cell 1 that has already been determined to be an out-basin cell and all of its upstream cells are actually basin cells. In other words, the result of the previous upstream search process (step 502) is incorrect. Means that Therefore, the basin extraction program 141 updates the value of the redo flag to true (step 905), and proceeds to step 912.
メンバ変数Kindの値が流域外(2)である場合、cell2は流域外セルである。このことは、cell1が流域外セルであることと矛盾しない。言い換えると、これによって、cell2及びその上流の全てのセルが流域外セルであることが確認された。このため、流域抽出プログラム141は、やり直しフラグ及びメンバ変数Kindの値を更新せずに(ステップ906)、ステップ912に進む。この場合、cell2のさらに下流を探索する必要がないため、cell2は新たな対象セルとして選択されない。 If the value of the member variable Kind is outside the basin (2), cell2 is a basin outside cell. This is consistent with cell1 being a basin cell. In other words, this confirmed that cell2 and all the cells upstream of it were out-basin cells. For this reason, the basin extraction program 141 proceeds to step 912 without updating the redo flag and the value of the member variable Kind (step 906). In this case, since it is not necessary to search further downstream of cell2, cell2 is not selected as a new target cell.
なお、cell2が流域外セルであるか否かは、どのような方法によって判定されてもよい。例えば、過去に実行された別の流域抽出処理によって、cell2が別の流域に属することが確定している場合、cell2に関するメンバ変数Kindの値が流域外(2)であるため、上記のようにcell2が流域外セルであると判定され、処理はステップ906に進む。ユーザがあらかじめ流域外の範囲を指定した場合も同様である。あるいは、メンバ変数Kindの値にかかわらず、cell2の標高が所定の標高(例えば、開始セルの標高)より低いと判定された場合に、cell2が流域外セルであると判定され、処理がステップ906に進んでもよい。あるいは、開始セルが河川上のセルである場合において、cell2が、開始セルが属するものと別の河川上のセルであると判定された場合、cell2が流域外セルであると判定され、処理がステップ906に進んでもよい。各セルがどの河川上にあるかは、地図データ191に基づいて判定することができる。 Note that whether or not cell2 is a cell outside the basin may be determined by any method. For example, when it is determined that cell2 belongs to another basin by another basin extraction process executed in the past, the value of the member variable Kind related to cell2 is outside the basin (2). It is determined that cell2 is a cell outside the basin, and the process proceeds to step 906. The same applies when the user designates a range outside the basin in advance. Alternatively, if it is determined that the altitude of cell2 is lower than a predetermined altitude (for example, the altitude of the start cell) regardless of the value of the member variable Kind, it is determined that cell2 is an out-basin cell, and the process is performed in step 906. You may proceed to. Alternatively, when the start cell is a cell on the river and cell2 is determined to be a cell on a different river from the one to which the start cell belongs, it is determined that cell2 is a cell outside the basin, and the processing is performed. Proceed to step 906. It can be determined based on the map data 191 which river each cell is on.
メンバ変数Kindの値が無効(3)である場合、cell2は無効セルである。このことは、cell1が流域外セルであることと矛盾しない。言い換えると、これによって、cell1及びその上流の全てのセルが流域外セルであることが確認された。このため、流域抽出プログラム141は、やり直しフラグ及びメンバ変数Kindの値を更新せずに(ステップ907)、ステップ912に進む。この場合も、cell2のさらに下流を探索する必要がないため、cell2は新たな対象セルとして選択されない。 If the value of the member variable Kind is invalid (3), cell2 is an invalid cell. This is consistent with cell1 being a basin cell. In other words, this confirmed that cell1 and all the cells upstream of it were out-basin cells. For this reason, the basin extraction program 141 proceeds to step 912 without updating the redo flag and the value of the member variable Kind (step 907). Also in this case, since it is not necessary to search further downstream of cell2, cell2 is not selected as a new target cell.
メンバ変数Kindの値が未定(0)である場合、cell2は未定セルである。流域の定義によれば、ステップ904においてcell2が有効セルであると判定された場合、cell2は必ず流域外セルである。このため、流域抽出プログラム141は、cell2を流域外セルに変更して(ステップ908)、ステップ912に進む。具体的には、流域抽出プログラム141は、cell2に関するセルクラスCellのメンバ変数Kindの値を流域外(2)に更新する。さらに、流域抽出プログラム141は、部分領域クラスCellUnitのメンバ変数Targetsにcell2を追加する。これによって、cell2は新たな対象セルとなる。 When the value of the member variable Kind is undetermined (0), cell2 is an undetermined cell. According to the definition of the basin, if it is determined in step 904 that cell2 is a valid cell, cell2 is always a cell outside the basin. Therefore, the basin extraction program 141 changes cell2 to a cell outside the basin (step 908), and proceeds to step 912. Specifically, the basin extraction program 141 updates the value of the member variable Kind of the cell class Cell relating to cell2 to outside the basin (2). Furthermore, the basin extraction program 141 adds cell2 to the member variable Targets of the partial region class CellUnit. As a result, cell2 becomes a new target cell.
cell1に隣接する全てのセルの標高がcell1の標高以上である場合(すなわち、cell1が図14において説明したケース(c)に該当する場合)、最急勾配法によれば、cell1の下流方向は存在しない(言い換えるとcell1から水が流出しない)。このため、ステップ904において、cell2が存在しないと判定される。この場合、流域抽出プログラム141は、最急勾配法ではなく、cell1の周囲の複数のセルの標高の配置に基づいてcell1の下流方向を決定するための処理を実行する。 When the altitude of all cells adjacent to cell1 is equal to or higher than the altitude of cell1 (that is, when cell1 corresponds to the case (c) described in FIG. 14), according to the steepest gradient method, the downstream direction of cell1 is Does not exist (in other words, water does not flow out of cell1). For this reason, in step 904, it is determined that cell2 does not exist. In this case, the basin extraction program 141 executes processing for determining the downstream direction of the cell 1 based on the arrangement of the altitudes of a plurality of cells around the cell 1 instead of the steepest gradient method.
具体的には、流域抽出プログラム141は、cell1を窪地セルに変更し(ステップ909)、窪地埋め処理を実行する(ステップ910)。ステップ909及びステップ910において実行される処理については後述する(図16及び図17参照)。窪地埋め処理が終了すると、流域抽出プログラム141は、窪地セルを流域外セルに変更して(ステップ911)、ステップ912に進む。 Specifically, the basin extraction program 141 changes cell1 to a depression cell (step 909), and executes depression filling processing (step 910). The processing executed in steps 909 and 910 will be described later (see FIGS. 16 and 17). When the depression filling process ends, the basin extraction program 141 changes the depression cell to a cell outside the basin (step 911), and proceeds to step 912.
全ての流域外セルについてステップ901からステップ912までのループが終了すると、流域抽出プログラム141は、下流探索処理を終了する。 When the loop from step 901 to step 912 is completed for all cells outside the basin, the basin extraction program 141 ends the downstream search process.
次に、図16および図17を用いて窪地埋め処理(ステップ910)の詳細を説明する。 Next, details of the depression filling process (step 910) will be described with reference to FIGS.
図16は、本発明の実施形態の窪地のデータ構造を示す説明図である。 FIG. 16 is an explanatory diagram illustrating a data structure of a depression according to the embodiment of this invention.
表1600に窪地型のデータを示す。実装の際には、これらのデータをメンバ変数として持つ、クラス名Sinkの型とすればよい。 Table 1600 shows depression type data. At the time of implementation, the type of the class name Sink that has these data as member variables may be used.
Sinkは、Cells、Outlets、WlevおよびFinishedの4つのメンバ変数を持つクラスである。CellsおよびOutletsはセル型を格納する可変長配列である(行1601および1602)。CellsおよびOutletsは、それぞれ、図17で説明する窪地セルおよび流出口セルを格納する。CellsおよびOutletsの初期値はemptyである。図9のステップ909は、cell1をメンバ変数Cellsに追加することによって実行される。Wlevは実数型であり、図17で説明する隣接最小標高を格納する(行1603)。Finishedはブール型であり、終了フラグを格納する(行1604)。Finishedの初期値はfalseである。 Sink is a class that has four member variables: Cells, Outlets, Wlev, and Finished. Cells and Outlets are variable length arrays that store cell types (lines 1601 and 1602). Cells and Outlets store depression cells and outlet cells described in FIG. The initial value of Cells and Outlets is empty. Step 909 of FIG. 9 is performed by adding cell1 to the member variable Cells. Wlev is a real number type and stores the adjacent minimum elevation described with reference to FIG. 17 (line 1603). Finished is a Boolean type and stores an end flag (line 1604). The initial value of Finished is false.
図17は、本発明の実施形態の窪地埋め処理(ステップ910)の詳細を示すフローチャートである。 FIG. 17 is a flowchart showing details of the depression filling process (step 910) according to the embodiment of the present invention.
ステップ1701において、流域抽出プログラム141は、「隣接最小標高」を算出する。隣接最小標高とは、窪地セルに隣接するセルの標高のうち最小の標高である。この窪地埋め処理の開始時点において、窪地セルはステップ909で得られたものだけである。したがってその時点の隣接最小標高はステップ909で得られた各窪地セルに隣接する8セルの標高の最小値であり、その値はステップ909で得られた窪地セルの標高と同じか、またはそれよりも大きい。 In step 1701, the basin extraction program 141 calculates “adjacent minimum elevation”. The adjacent minimum altitude is the minimum altitude of the altitudes of the cells adjacent to the depression cell. At the start of the depression filling process, the depression cells are only those obtained in step 909. Therefore, the adjacent minimum elevation at that time is the minimum value of the elevation of 8 cells adjacent to each depression cell obtained in step 909, and the value is equal to or more than the elevation of the depression cell obtained in step 909. Is also big.
実装では、ステップ909の終了時点で、窪地型Sinkのメンバ変数Cellsには、ステップ909において取得された窪地セル1つのみが格納されている。さらに、このステップ1701では、メンバ変数Cellsに隣接するセルの標高の最小値がメンバ変数Wlevに格納される。 In the implementation, at the end of step 909, only one depression cell acquired in step 909 is stored in the member variable Cells of the depression type sink. Furthermore, in this step 1701, the minimum value of the altitude of the cell adjacent to the member variable Cells is stored in the member variable Wlev.
流域抽出プログラム141は、それぞれの窪地セルについてステップ1702からステップ1710までの処理を繰り返す。図17の説明において、このループの処理対象のセルをcell1と記載する。実装では、メンバ変数Cellsのそれぞれの要素についてこのループを実行する。 The basin extraction program 141 repeats the processing from Step 1702 to Step 1710 for each depression cell. In the description of FIG. 17, the cell to be processed in this loop is referred to as cell1. The implementation executes this loop for each element of the member variable Cells.
流域抽出プログラム141は、cell1のそれぞれの隣接セルについてステップ1703からステップ1709までの処理を繰り返す。図17の説明において、このループの処理対象のセルをcell2と記載する。 The basin extraction program 141 repeats the processing from step 1703 to step 1709 for each adjacent cell of cell1. In the description of FIG. 17, the processing target cell of this loop is referred to as cell2.
ステップ1704において、流域抽出プログラム141は、cell2を含む部分領域を読み込む。この動作はステップ603と同じである。 In step 1704, the basin extraction program 141 reads a partial region including cell2. This operation is the same as step 603.
ステップ1705において、流域抽出プログラム141は、隣接最小標高Wlevとcell2の標高とを比較する。Wlevとcell2の標高とが等しい場合ステップ1706に進み、等しくない場合ステップ1707に進む。 In step 1705, the watershed extraction program 141 compares the adjacent minimum elevation Wlev with the elevation of cell2. If Wlev is equal to the altitude of cell2, the process proceeds to step 1706; otherwise, the process proceeds to step 1707.
Wlevとcell2の標高とが等しい場合、cell2は窪地の一部である。このため、ステップ1706において、流域抽出プログラム141は、cell2を窪地セルに変更する。実装では、メンバ変数Cellsにcell2を追加する。ステップ1706が実行された場合、追加されたcell2を処理するためのステップ1702からステップ1710までの処理が後に実行されることになる。 If Wlev and cell2 are equal in elevation, cell2 is part of a depression. For this reason, in step 1706, the basin extraction program 141 changes cell2 to a hollow cell. In the implementation, cell2 is added to the member variable Cells. When step 1706 is executed, the processing from step 1702 to step 1710 for processing the added cell2 will be executed later.
ステップ1706が実行された時点で、cell2の標高はメンバ変数Wlevの値に等しく、かつ、その標高の値が窪地セルの中で最も大きい。このため、図17の説明において、メンバ変数Wlevを窪地最大標高とも記載する。 When step 1706 is executed, the altitude of cell2 is equal to the value of member variable Wlev, and the altitude value is the largest among the depression cells. For this reason, in the description of FIG. 17, the member variable Wlev is also described as the maximum depression height.
ステップ1707において、流域抽出プログラム141は、窪地最大標高Wlevとcell2の標高とを比較する。Wlevがcell2の標高より大きい場合、cell2は窪地の一部ではない。さらにこの場合、cell2は、cell1を含む窪地に流入した水の流出口である。この場合、流域抽出プログラム141はステップ1708に進む。一方、Wlevがcell2の標高より小さい場合、cell2は窪地の一部である可能性があるが、そうでない可能性もある。この場合、流域抽出プログラム141は、ステップ1708を実行せずにステップ1709に進む。実装では、流域抽出プログラム141は、ステップ1708に進む前にcell2をメンバ変数Outletsに追加する。 In step 1707, the basin extraction program 141 compares the maximum depression elevation Wlev with the elevation of cell2. If Wlev is greater than cell2's elevation, cell2 is not part of the depression. Furthermore, in this case, cell2 is an outlet for water that has flowed into the depression containing cell1. In this case, the basin extraction program 141 proceeds to step 1708. On the other hand, if Wlev is less than cell2's elevation, cell2 may be part of a depression, but it may not. In this case, the basin extraction program 141 proceeds to step 1709 without executing step 1708. In implementation, the basin extraction program 141 adds cell2 to the member variable Outlets before proceeding to step 1708.
ステップ1708において、流域抽出プログラム141は、終了フラグFinishedを真(true)に更新する。なお、終了フラグの初期値は偽(false)である。つまり、ステップ1708が最初に実行されるまで、終了フラグFinishedは偽である。 In step 1708, the basin extraction program 141 updates the end flag Finished to true. Note that the initial value of the end flag is false. That is, the end flag Finished is false until step 1708 is executed for the first time.
ステップ1709において、まだ処理されていない隣接セルがある場合、ステップ1703のループに戻る。 If there is a neighboring cell that has not yet been processed in step 1709, the process returns to the loop of step 1703.
ステップ1710において、まだ処理されていない窪地セルがある場合、ステップ1702のループに戻る。 If there is a depression cell that has not yet been processed in step 1710, the process returns to the loop of step 1702.
ステップ1711では、終了フラグFinishedの真偽判定をする。終了フラグが真の場合、窪地に流入した水の流出口が既に特定されている。このことは、窪地の範囲が特定されたことを意味する。すなわち、この時点における窪地セルの範囲が、特定された窪地の範囲である。この場合、処理はステップ1712に進む。一方、終了フラグが偽の場合、窪地に流入した水の流出口がまだ特定されていない。この場合、窪地の範囲がまだ特定されていないため、処理はステップ1701に戻る。 In step 1711, the end flag Finished is checked for authenticity. If the end flag is true, the outlet of the water that has flowed into the depression has already been identified. This means that the range of the depression has been specified. That is, the range of the depression cell at this time is the specified depression range. In this case, the process proceeds to Step 1712. On the other hand, when the end flag is false, the outlet of the water that has flowed into the depression has not yet been identified. In this case, since the range of the depression has not been specified yet, the process returns to Step 1701.
ステップ1712において、流域抽出プログラム141は、すべての窪地セルの標高を隣接最小標高Wlevに変更する。なお、このステップで使用する隣接最小標高Wlevは、直前の回のステップ1701で求めた値であり、ステップ1712の時点の窪地セルに基づいて新たに隣接最小標高を算出するわけではない。この処理によって、すべての窪地セルの標高が等しくなる。以下の説明において、上記のように標高が変更された窪地セルを平地セルと言い換える。なお、実装ではメンバ変数Cellsに格納されたすべてのセルの標高をWlevに変更する。 In step 1712, the basin extraction program 141 changes the altitude of all the depression cells to the adjacent minimum elevation Wlev. It should be noted that the adjacent minimum elevation Wlev used in this step is the value obtained in the previous step 1701 and does not newly calculate the adjacent minimum elevation based on the depression cell at the time of step 1712. By this processing, the altitude of all the depression cells becomes equal. In the following description, a hollow cell whose elevation has been changed as described above is referred to as a flat cell. In the implementation, the altitude of all the cells stored in the member variable Cells is changed to Wlev.
ステップ1713において、流域抽出プログラム141は、すべての平地セルの下流方向を決定する。具体的には、流域抽出プログラム141は、平地セルに隣接する、平地セルよりも低い標高を持つセル(図17の例では、ステップ1707でTrueと判定された場合のcell2)を、その平地の流出口セルとする。そして、平地内の流れが流出口セルに向かうように平地内の水が流れる方向(すなわち下流方向)を決定する。 In step 1713, the basin extraction program 141 determines the downstream direction of all flat cells. Specifically, the watershed extraction program 141 selects a cell adjacent to the flat cell and having an altitude lower than that of the flat cell (in the example of FIG. 17, cell 2 when determined to be True in step 1707). The outlet cell. And the direction (namely, downstream direction) in which the water in a flat ground flows is determined so that the flow in a flat ground may go to an outlet cell.
まず、流域抽出プログラム141は、平地セルのうち、流出口セルに隣接し、かつ、水が流れる方向が決定していないセルの下流方向を、流出口セルに向かう方向に決定する。1つの平地セルに複数の流出口セルが隣接している場合には、前述した方向優先度に従って下流方向が決定される。続いて、流域抽出プログラム141は、上記のように下流方向を決定したセルを流出口セルと見なし、その新たな流出口セルについて上記の処理を実行する。このように、すべての平地セルの水が流れる方向が決定するまで、同様の処理を繰り返す。実装では、メンバ変数Outletsに格納されたすべてのセルを流出口セルとする。 First, the basin extraction program 141 determines a downstream direction of a cell that is adjacent to the outlet cell and in which the direction of water flow is not determined among the flat cells, as a direction toward the outlet cell. When a plurality of outlet cells are adjacent to one flat cell, the downstream direction is determined according to the direction priority described above. Subsequently, the basin extraction program 141 regards the cell whose downstream direction has been determined as described above as an outflow cell, and executes the above-described processing for the new outflow cell. In this way, the same processing is repeated until the direction in which the water in all the flat cells flows is determined. In the implementation, all cells stored in the member variable Outlets are defined as outlet cells.
なお、上記のような下流方向の決定方法は一例に過ぎない。窪地に流れ込んだ水が流出口セルから流出するように決定される限り、どのように下流方向が決定されてもよい。このように下流方向を特定することによって、全ての窪地セルがその窪地の流出口セルの上流であること、言い換えると、全ての窪地セルが、その窪地の流出口セルが属するものと同一の流域に属することが特定される。 The method for determining the downstream direction as described above is merely an example. The downstream direction may be determined in any way as long as it is determined that the water flowing into the depression flows out from the outlet cell. By specifying the downstream direction in this way, all the depression cells are upstream of the outlet cell of the depression, in other words, all the depression cells are the same basin to which the outlet cell of the depression belongs. Belonging to.
上記のように決定された下流方向は、その後に実行される上流探索処理(ステップ502)において使用される。具体的には、上記のように下流方向が決定されたセルが図6の処理のcell2として選択された場合、その決定された下流方向に基づいてステップ605の判定が実行される。 The downstream direction determined as described above is used in the upstream search process (step 502) executed thereafter. Specifically, when the cell for which the downstream direction has been determined as described above is selected as cell2 of the processing in FIG. 6, the determination in step 605 is executed based on the determined downstream direction.
このようにして、本実施形態ではユーザが図3に示した入力画面から情報を入力すると、プログラムが図7,8,10に示した進捗画面を提示して、最終的に図4に示した結果表示画面を提示することができる。 Thus, in this embodiment, when the user inputs information from the input screen shown in FIG. 3, the program presents the progress screen shown in FIGS. A result display screen can be presented.
本実施形態では部分領域を使用した場合の実施方法について説明した。しかし、部分領域を使用せずに本発明を実施することもできる。この場合、対象部分領域の読み込み処理(ステップ603、ステップ903、ステップ1704)を削除する。そして、ステップ203の直後に、次の処理を追加する。流域抽出プログラム141は、最初に、ユーザに解析対象領域を指定させる。次に、指定された領域の標高データ192および海域データ193を読み込む。次に、海域データ193により海域と判別されたセルを、無効セルに指定する。さらに、ステップ203で無効セルが指定されている場合は、そのセルも無効セルとする。そして、無効セルの標高を負の無限大にする。 In the present embodiment, the implementation method when the partial area is used has been described. However, the present invention can also be implemented without using partial areas. In this case, the target partial area reading process (steps 603, 903, and 1704) is deleted. Then, immediately after step 203, the following processing is added. The basin extraction program 141 first causes the user to specify the analysis target area. Next, the altitude data 192 and the sea area data 193 of the designated area are read. Next, the cell determined as the sea area by the sea area data 193 is designated as an invalid cell. Furthermore, if an invalid cell is specified in step 203, that cell is also designated as an invalid cell. Then, the elevation of the invalid cell is set to negative infinity.
以上述べたとおり、本発明によれば、流域に関する事前知識を要求しない流域抽出コンピュータプログラムが提供できる。このプログラムを用いることによって、コンピュータが使えるユーザであれば、専門家と同等の品質の流域抽出ができるようになる。 As described above, according to the present invention, a basin extraction computer program that does not require prior knowledge about a basin can be provided. By using this program, a user who can use a computer can extract a basin with the same quality as an expert.
100 PC
310 地図
302 下流端
401 水が流れる方向を示す線分
402 分水嶺を示す線分
701 上流探索処理における処理対象セルを示す点
702 標高データ192等をメモリに読み込んだ部分領域を示す矩形
1001 下流探索処理における処理対象セルを示す点
100 PC
310 Map 302 Downstream end 401 Line segment indicating the direction of water flow 402 Line segment indicating a watershed 701 Point 702 indicating a cell to be processed in the upstream search process Rectangle 1001 indicating a partial area in which the altitude data 192 and the like are read into the memory Indicates the cell to be processed in
Claims (14)
前記コンピュータは、
前記流域抽出プログラムが格納されるメモリと、前記メモリに格納された前記流域抽出プログラムを実行するプロセッサと、を備え、
地図上の複数の領域の標高を示す標高データを保持し、
前記複数の領域は、第1領域を含み、
前記流域抽出プログラムは、
前記第1領域に流れ込む水の流域を、前記標高データに基づいて上流方向に探索する第1手順と、
前記第1手順によって特定された流域が正しいか否かを判定する第2手順と、を前記プロセッサに実行させ、
前記第2手順において、前記特定された流域が正しくないと判定された場合、前記第1手順を再び前記プロセッサに実行させることを特徴とする流域抽出プログラム。 A basin extraction program for controlling a computer,
The computer
A memory for storing the basin extraction program; and a processor for executing the basin extraction program stored in the memory;
Holds elevation data showing the elevation of multiple areas on the map,
The plurality of regions include a first region;
The basin extraction program is
A first procedure for searching upstream of a water basin flowing into the first region based on the elevation data;
Causing the processor to execute a second procedure for determining whether or not the watershed identified by the first procedure is correct;
A basin extraction program that causes the processor to execute the first procedure again when it is determined in the second procedure that the specified basin is not correct.
前記流域抽出プログラムは、さらに、前記標高データに基づいて、前記第2領域の下流の前記領域を特定する第3手順を前記プロセッサに実行させ、
前記第2手順は、前記第3手順によって前記第2領域の下流の領域として特定された領域が、前記第1手順によって特定された流域に含まれる場合、前記第1手順によって特定された流域が正しくないと判定する手順を含むことを特徴とする請求項1に記載の流域抽出プログラム。 The plurality of regions further includes a second region not included in the basin identified by the first procedure,
The basin extraction program further causes the processor to execute a third procedure for identifying the area downstream of the second area based on the elevation data,
In the second procedure, when the region identified as the downstream region of the second region by the third procedure is included in the basin identified by the first procedure, the basin identified by the first procedure is The basin extraction program according to claim 1, comprising a procedure for determining that it is not correct.
前記第2領域の下流の領域から水が流出しないと判定された場合、前記標高データに基づいて、前記水が流出しないと判定された領域を含む窪地の範囲、及び、前記窪地に流れ込んだ水の流出口を特定する第4手順と、
前記窪地に流れ込んだ水が前記特定された流出口から流出するように、前記特定された窪地に含まれる各領域の下流方向を特定する第5手順と、を含み、
前記第3手順が実行された後に実行される前記第1手順において、前記第1領域に流れ込む水の流域を探索するために、前記第5手順によって特定された下流方向が使用されることを特徴とする請求項2に記載の流域抽出プログラム。 The third procedure includes
When it is determined that water does not flow out of the area downstream of the second area, based on the altitude data, the range of the depression including the area where the water is determined not to flow out, and the water that has flowed into the depression A fourth procedure for identifying the outlet of
A fifth step of identifying the downstream direction of each region included in the identified depression so that the water flowing into the depression flows out from the identified outlet.
In the first procedure executed after the third procedure is executed, the downstream direction specified by the fifth procedure is used to search for a water basin flowing into the first region. The basin extraction program according to claim 2.
前記第1手順は、
前記第1領域を対象領域として選択する手順と、
前記標高データから算出された、前記対象領域に隣接する領域と、前記対象領域に隣接する領域にさらに隣接する領域との間の勾配に基づいて、前記対象領域に隣接する領域の下流方向を特定する手順と、
前記勾配に基づいて特定された下流方向、又は、前記第5手順によって特定された下流方向に基づいて、前記対象領域に隣接する領域が前記対象領域の上流であるか否かを判定する手順と、
前記対象領域に隣接する領域が前記対象領域の上流であると判定された場合、前記対象領域に隣接する領域を前記流域内の領域として特定する手順と、
前記対象領域に隣接する領域が前記対象領域の上流であると判定された場合、前記対象領域に隣接する領域を新たな前記対象領域として選択する手順と、を含むことを特徴とする請求項3に記載の流域抽出プログラム。 The basin extraction program causes the processor to execute a procedure for receiving designation of the first region before the first procedure,
The first procedure includes:
Selecting the first region as a target region;
The downstream direction of the region adjacent to the target region is identified based on the gradient between the region adjacent to the target region and the region further adjacent to the target region calculated from the elevation data. And the steps to
Determining whether or not a region adjacent to the target region is upstream of the target region based on the downstream direction specified based on the gradient or the downstream direction specified by the fifth procedure; ,
When it is determined that the region adjacent to the target region is upstream of the target region, a procedure for specifying the region adjacent to the target region as a region in the basin;
The method includes: selecting a region adjacent to the target region as a new target region when it is determined that the region adjacent to the target region is upstream of the target region. The basin extraction program described in 1.
前記第2領域を対象領域として選択する手順と、
前記標高データに基づいて、前記対象領域と、前記対象領域に隣接する領域との間の勾配を算出する手順と、
前記勾配に基づいて、前記対象領域に隣接する領域が前記対象領域の下流であるか否かを判定する手順と、
前記対象領域に隣接する領域が前記対象領域の下流であると判定された場合、前記対象領域に隣接する領域を、前記第2領域の下流の領域として特定する手順と、
前記対象領域に隣接する領域が前記対象領域の下流であると判定された場合、前記対象領域に隣接する領域を、新たな前記対象領域として特定する手順と、
前記対象領域に隣接する複数の領域の全ての前記標高が、前記対象領域の前記標高より高い場合、前記対象領域から水が流出しないと判定する手順と、を含むことを特徴とする請求項3に記載の流域抽出プログラム。 The third procedure further includes:
Selecting the second region as a target region;
A procedure for calculating a gradient between the target region and a region adjacent to the target region based on the elevation data;
Determining whether an area adjacent to the target area is downstream of the target area based on the gradient; and
When it is determined that the area adjacent to the target area is downstream of the target area, the procedure of specifying the area adjacent to the target area as the downstream area of the second area;
When it is determined that the area adjacent to the target area is downstream of the target area, a procedure for specifying the area adjacent to the target area as a new target area;
The method includes a step of determining that water does not flow out of the target area when all the altitudes of a plurality of areas adjacent to the target area are higher than the altitude of the target area. The basin extraction program described in 1.
前記対象領域に隣接する領域が前記対象領域の下流であると判定され、かつ、前記対象領域に隣接する領域が前記第1領域の上流でないと判定された場合、前記流域抽出プログラムは、前記第3手順に含まれる手順のうち、前記対象領域に隣接する領域を前記第2領域の下流の領域として特定する手順を前記プロセッサに実行させないことを特徴とする請求項6に記載の流域抽出プログラム。 The third procedure further includes a procedure of determining whether an area adjacent to the target area is upstream of the first area,
When it is determined that the region adjacent to the target region is downstream of the target region, and the region adjacent to the target region is determined not to be upstream of the first region, the basin extraction program 7. The basin extraction program according to claim 6, wherein, among the procedures included in the three procedures, the procedure for specifying the region adjacent to the target region as a region downstream of the second region is not executed by the processor.
前記水が流出しないと判定された領域を前記窪地内の領域として特定する手順と、
前記窪地に隣接する領域の一つを対象領域として選択する手順と、
前記対象領域の標高が、前記窪地に隣接する全ての領域の標高の最低値と同一である場合、前記対象領域を、新たな前記窪地内の領域として特定する手順と、
前記窪地外の領域のうち、前記新たな窪地内の領域に隣接する領域の標高が、前記新たな窪地内の領域の標高より低い場合、前記新たな窪地内の領域に隣接する領域を前記窪地に流れ込んだ水の流出口として特定する手順と、を含むことを特徴とする請求項3に記載の流域抽出プログラム。 The fourth procedure includes
A procedure for identifying an area determined not to flow out of water as an area in the depression,
Selecting one of the areas adjacent to the depression as the target area;
When the altitude of the target area is the same as the lowest value of the altitudes of all areas adjacent to the depression, the procedure of specifying the target area as a new area in the depression;
When the altitude of the area adjacent to the area in the new depression is lower than the altitude of the area in the new depression, the area adjacent to the area in the new depression is the depression. The basin extraction program according to claim 3, further comprising: a procedure for identifying the outlet of water that has flowed into the water.
前記第1手順は、さらに、前記第1手順が実行されていることを示す情報を前記表示装置に表示させる手順を含み、
前記第3手順は、さらに、前記第3手順が実行されていることを示す情報を前記表示装置に表示させる手順を含むことを特徴とする請求項3に記載の流域抽出プログラム。 A display device is connected to the computer,
The first procedure further includes a procedure for causing the display device to display information indicating that the first procedure is being executed,
The basin extraction program according to claim 3, wherein the third procedure further includes a procedure for causing the display device to display information indicating that the third procedure is being executed.
前記流域抽出装置は、
メモリと、前記メモリに格納されたプログラムを実行するプロセッサと、を備え、
地図上の複数の領域の標高を示す標高データを保持し、
前記複数の領域は、第1領域を含み、
前記流域抽出装置は、
前記第1領域に流れ込む水の流域を、前記標高データに基づいて上流方向に探索し、
前記上流方向の探索によって特定された流域が正しいか否かを判定し、
前記特定された流域が正しくないと判定された場合、前記上流方向への探索を再び実行することを特徴とする流域抽出装置。 A basin extraction device for extracting a water basin,
The basin extraction device comprises:
A memory, and a processor that executes a program stored in the memory,
Holds elevation data showing the elevation of multiple areas on the map,
The plurality of regions include a first region;
The basin extraction device comprises:
Search the water basin flowing into the first region in the upstream direction based on the elevation data,
Determining whether the watershed identified by the upstream search is correct;
If it is determined that the specified basin is not correct, the upstream search is performed again.
前記流域抽出装置は、さらに、
前記標高データに基づいて、前記第2領域の下流の前記領域を特定し、
特定された、前記第2領域の下流の領域が、前記上流方向への探索によって特定された流域に含まれる場合、前記上流方向への探索によって特定された流域が正しくないと判定することを特徴とする請求項12に記載の流域抽出装置。 The plurality of regions further include a second region that is not included in the watershed identified by the upstream search.
The basin extraction device further comprises:
Identifying the region downstream of the second region based on the elevation data;
When the specified downstream area of the second area is included in the basin specified by the upstream search, it is determined that the basin specified by the upstream search is incorrect. The basin extraction device according to claim 12.
前記第2領域の下流の領域から水が流出しないと判定された場合、前記標高データに基づいて、前記水が流出しないと判定された領域を含む窪地の範囲、及び、前記窪地に流れ込んだ水の流出口を特定し、
前記窪地に流れ込んだ水が前記特定された流出口から流出するように、前記特定された窪地に含まれる各領域の下流方向を特定し、
前記窪地に含まれる各領域の下流方向が特定された後に実行される前記上流方向への探索において、前記第1領域に流れ込む水の流域を探索するために、前記特定された下流方向を使用することを特徴とする請求項13に記載の流域抽出装置。 The basin extraction device further comprises:
When it is determined that water does not flow out of the area downstream of the second area, based on the altitude data, the range of the depression including the area where the water is determined not to flow out, and the water that has flowed into the depression Identify the outlet of the
Identify the downstream direction of each region included in the identified depression so that the water that flows into the depression flows out from the identified outlet.
In the upstream search performed after the downstream direction of each region included in the depression is specified, the specified downstream direction is used to search for a water basin flowing into the first region. The basin extraction apparatus according to claim 13.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009134067A JP5337995B2 (en) | 2009-06-03 | 2009-06-03 | Watershed extraction program and watershed extraction device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009134067A JP5337995B2 (en) | 2009-06-03 | 2009-06-03 | Watershed extraction program and watershed extraction device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2010282349A JP2010282349A (en) | 2010-12-16 |
| JP5337995B2 true JP5337995B2 (en) | 2013-11-06 |
Family
ID=43539035
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2009134067A Active JP5337995B2 (en) | 2009-06-03 | 2009-06-03 | Watershed extraction program and watershed extraction device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5337995B2 (en) |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7077818B2 (en) * | 2018-06-28 | 2022-05-31 | 富士通株式会社 | Information processing equipment, river water level prediction method and river water level prediction program |
| KR102140795B1 (en) * | 2018-12-07 | 2020-08-04 | (주)헤르메시스 | Method for computing watershed boundary based on digital elevation model, apparatus, and recording medium thereof |
| EP3828822B1 (en) | 2019-11-28 | 2024-10-16 | Dassault Systèmes | Civil engineering |
| EP3828824B1 (en) * | 2019-11-28 | 2025-01-08 | Dassault Systèmes | Polyline contributor in civil engineering |
| EP3828823B1 (en) | 2019-11-28 | 2026-01-14 | Dassault Systèmes | Merging watershed segmentation basins in civil engineering |
| CN113657324B (en) * | 2021-08-24 | 2024-06-21 | 速度科技股份有限公司 | Urban functional area recognition method based on remote sensing image object classification |
| KR102828760B1 (en) * | 2022-01-28 | 2025-07-03 | (주)헤르메시스 | Watershed analysis apparatus and method thereof |
| CN114723906B (en) * | 2022-04-15 | 2025-07-18 | 山东省水利科学研究院 | Karst region key leakage zone small-basin water collection basin demarcating method and device |
| CN116415318B (en) * | 2023-03-20 | 2024-03-08 | 长江水利委员会长江科学院 | Modeling method for hydrologic connectivity of lake in inner flow area based on mathematical morphology |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006127156A (en) * | 2004-10-28 | 2006-05-18 | Japan Weather Association | Method and system for evaluating flooding risk, basin database, its preparation program, and method and program for simulating flooding |
| JP2007011582A (en) * | 2005-06-29 | 2007-01-18 | Information & Science Techno-System Co Ltd | Flood forecasting system |
| JP2008050903A (en) * | 2006-08-28 | 2008-03-06 | Nippon Telegr & Teleph Corp <Ntt> | Flood prediction method and flood prediction system |
-
2009
- 2009-06-03 JP JP2009134067A patent/JP5337995B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2010282349A (en) | 2010-12-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5337995B2 (en) | Watershed extraction program and watershed extraction device | |
| Maathuis et al. | Digital elevation model based hydro‐processing | |
| Bhatt et al. | A tightly coupled GIS and distributed hydrologic modeling framework | |
| CN114648617B (en) | A water system extraction method based on digital elevation model DEM | |
| Omran et al. | New ArcGIS tools developed for stream network extraction and basin delineations using Python and java script | |
| JP4431545B2 (en) | Inundation simulation device and program | |
| CN115758856B (en) | A research method for studying the impacts of landscape patterns and climate change on the future water quality of a watershed. | |
| CN109308308A (en) | Method and device for simulation and result analysis of drainage pipe network based on 3D dynamic visualization | |
| JP5026992B2 (en) | Basin estimation program | |
| Li et al. | Improvement of city rainfall model subcatchment structure based on urban hydrology process | |
| CN107944089A (en) | A kind of plot limit for height analysis system and its analysis method for regarding corridor because of the present circumstance | |
| Zhao et al. | Comparison of two different methods for determining flow direction in catchment hydrological modeling | |
| CN119888113A (en) | A digital twin watershed terrain image service fusion method | |
| CN120217606A (en) | Water supply network zoning metering area division method, device and electronic equipment | |
| Gautam | Flow routing with Semi-distributed hydrological model HEC-HMS in case of Narayani River Basin | |
| KR20240128771A (en) | Apparatus and method for generating sewer network spatial information based on grid | |
| Gopalan | WRAPHydro data model: finding input parameters for the water rights analysis package | |
| KR100425430B1 (en) | Method Of Creating And Modifying DTM/DEM By Adjacent Vector Data Process | |
| CN114509042B (en) | A shielding detection method, shielding detection method for observation route and electronic equipment | |
| Shamsi | Arc hydro: a framework for integrating GIS and hydrology | |
| Haider et al. | Seasonal variability in hydrologic responses due to climate and land-cover changes in the Pothohar plateau, Pakistan | |
| CN115600365A (en) | Underground water resilience spatial distribution and uncertainty prediction method thereof | |
| Rabideau et al. | Analytic-element modeling of supraregional groundwater flow: Concepts and tools for automated model configuration | |
| JP7630827B2 (en) | Water volume prediction system, water volume prediction method and program | |
| Nurhamidah et al. | A Raster-based model for flood inundation mapping on delta lowland |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120309 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120418 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130516 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130709 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130717 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5337995 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |