Top / v.in.ogr
[GRASS]
[GRASSコマンドリファレンス]
[r.in.srtm]
v.in.ogr †
未完成
使用方法: 未完成
フラグ: 未完成
パラメータ: 未完成
サンプル: 未完成
その他: 未完成
SWBDデータをGRASSに読み込む †
NASAのSRTMデータに付随する水域ポリゴンデータのSWBDは,ESRI Shapeファイルで提供されており,v.in.ogrコマンドで取り込むことが可能です。データはzip形式で圧縮されているため,使用する前に解凍する必要があります。
以下e130n32e.shpファイルを取り込む例となります。GRASS Mapsetの設定についてはr.in.srtmを参考にしてください。
# shapeファイルを取り込む GRASS> v.in.ogr -oz dsn=e130n32e.shp output=e130n32e # 以下インポート処理の内容が表示される Proceeding with import... Layer: e130n32e Importing map 21 features... ----------------------------------------------------- Building topology ... 95 primitives registered Building areas: 100% 95 areas built 95 isles built Attaching islands: 100% Attaching centroids: 100% Topology was built. Number of nodes : 95 Number of primitives: 95 Number of points : 0 Number of lines : 0 Number of boundaries: 95 Number of centroids : 0 Number of areas : 95 Number of isles : 95 Number of areas without centroid : 95 ----------------------------------------------------- WARNING: Cleaning polygons, result is not guaranteed! Building topology ... Topology was built. Number of nodes : 95 Number of primitives: 95 Number of points : 0 Number of lines : 0 Number of boundaries: 95 Number of centroids : 0 Number of areas : - Number of isles : - ----------------------------------------------------- Break polygons: Registering points ... 22653 All points (vertices): 22772 Registered points (unique coordinates): 22653 Points marked for break: 100 Breaks: 16 ----------------------------------------------------- Remove duplicates: Duplicates: 2 ----------------------------------------------------- Break boundaries: Intersections: 7 ----------------------------------------------------- Remove duplicates: Duplicates: 4 ----------------------------------------------------- Clean boundaries at nodes: Modifications: 9 ----------------------------------------------------- Break boundaries: Intersections: 0 ----------------------------------------------------- Remove duplicates: Duplicates: 0 ----------------------------------------------------- Clean boundaries at nodes: Modifications: 0 ----------------------------------------------------- Change dangles to lines: Removed dangles: 1 removed lines: 1 ----------------------------------------------------- Remove bridges: Removed bridges: 0 removed lines: 0 ----------------------------------------------------- Building topology ... Building areas: 100% 95 areas built 91 isles built Attaching islands: 100% Topology was built. Number of nodes : 106 Number of primitives: 134 Number of points : 0 Number of lines : 0 Number of boundaries: 134 Number of centroids : 0 Number of areas : 95 Number of isles : 91 Number of areas without centroid : 95 Layer: e130n32e ----------------------------------------------------- ----------------------------------------------------- Building topology ... 125 primitives registered Building areas: 100% 95 areas built 91 isles built Attaching islands: 100% Attaching centroids: 100% Topology was built. Number of nodes : 121 Number of primitives: 125 Number of points : 0 Number of lines : 0 Number of boundaries: 109 Number of centroids : 16 Number of areas : 95 Number of isles : 91 Number of areas without centroid : 79 ----------------------------------------------------- 29 input polygons total area: 3.268648e+09 (95 areas) overlapping area: 0.000000e+00 (0 areas) area without category: 8.490104e+08 (79 areas)
# 取り込んだベクトルデータの概要を出力 GRASS 6.2.1 (SRTMv2_ARC3):~/grassdata/SRTMv2_ARC3 > db.describe -c table=e130n32e ncols:4 Column 1:cat:INTEGER Column 2:facc_code:CHARACTER Column 3:cell:DOUBLE PRECISION Column 4:wb:DOUBLE PRECISION
# 取り込んだベクトルデータの内容を出力 GRASS > v.report map=e130n32e option=area Displaying column types/names for database connection of layer 1: cat|facc_code|cell|wb|area 1|BH140|122310|5|1|1338859.11924613 2|BH080|122310|3|8|361935162.048713 3|BH080|122310|4|12|3518454.61833854 4|BH080|122310|11|16|2045726628.24222 5|BH080|122310|12|17|424043.105328643 6|BH080|122310|19|18|4101558.5292012 7|BH080|122310|21|19|2533542.83254112 8|BH140|122310|25|21|59070.3682921123 9|BH080|122310|28| 10|BH080|122310|35| 11|BH140|122310|66| 12|BH140|122310|65| 13|BH080|122310|39| 14|BH080|122310|42| 15|BH080|122310|60| 16|BA040|122310|59| 17|BA040|122310|9| 18|BA040|122310|47| 19|BA040|122310|52| 20|BH080|122310|64| 21|BA040|122310|43|
# リージョン設定 # 該当するSWBDのリージョンにあわせます # これをきちんと行わないと, # v.to.rastでラスタデータ化する場合に不具合が出ます # SRTM処理用のMASKとする場合のリージョン設定は後述 GRASS > g.region vect=e130n32e
#ラスタ変換 #警告が大量に表示されるが,おそらく問題なし? #島ポリゴンはポリゴンの結線順序(時計まわり,反時計まわり)で判断? GRASS > v.to.rast input=e130n32e output=e130n32e column='cat' Loading vector information ... 21 records selected from table 0 mins 01 sec Sorting areas by size ...WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) WARNING: Area without centroid (may be OK for island) 95 areas 0 mins 00 secs Processing areas ... 95 areas 0 mins 00 secs Processing lines ... 125 lines 0 mins 00 secs Writing raster map ... 0 mins 00 secs Creating support files for raster map ... 0 mins 00 secs Raster map <e130n32e> done. Total processing time: 0 mins 01 sec
# 水域ポリゴンのカテゴリ値を全て1に GRASS > r.mapcalc 'e130n32eedit=if(e130n32e)' # # MASKを作成する場合には以下を実行 # r.mapcalc 'MASK=if(isnull(e130n32e),1,null())'
# TIFF 画像出力 GRASS > r.out.tiff input=e130n32eedit output=e130n32eedit.tif
以上の操作で以下のような画像が作成されます。
SWBDをMASKとして,対応するSRTMデータの処理を行う場合には,前述のg.region?以降の処理を,以下のように変更します。
# 対応するSRTM3"データに対してマスクをかける場合には # SWBDデータの図郭にリージョンを合わせr.mapcalcを実行 # g.region vect=...とすると, # 図郭の範囲とは必ずしも一致しないことに注意 # また適宜res=オプションで解像度を指定 GRASS > g.region n=33N s=32N e=131E w=130E res=0:00:03
# 水域部のマスク画像を作成 GRASS > r.mapcalc 'MASK=if(isnull(e130n32e),1,null())'
これで,以降のSRTMデータの処理は,陸域のみの行われることになります。
Counter: 1305,
today: 2,
yesterday: 0
Last-modified: Fri, 07 Nov 2008 17:26:00 JST (664d)
Last-modified: Fri, 07 Nov 2008 17:26:00 JST (664d)


