Slide 32
Slide 32 text
©ONE COMPATH CO., LTD. All rights reserved.
// 名前が⻑いのでリネーム
$ mv Z__C_RJTD_20170807020000_NOWC_GPV_Ggis1km_Prr05lv_FH0005-0100_grib2.bin nowc_grib2.bin
// GDALで読み込み(エラーになる)
$ gdalinfo nowc_grib2.bin
getdrstemplate: DRS Template 5.200 not defined.
ERROR 4: nowc_grib2.bin is a grib file, but no raster dataset was successfully identified.
gdalinfo failed - unable to open 'nowc_grib2.bin'.
// データ圧縮⽅式を確認(ランレングス圧縮)
$ wgrib2 nowc_grib2.bin -packing -d 1
check_pdt_size: pdt=50008 needs to be added to pdt_len(..)
1.1:0:packing=Run length packing with level values,_
// データ圧縮⽅式を⼀般的な形式に変換
$ wgrib2 nowc_grib2.bin -set_grib_type complex3 -grib_out nowc_grib2_gen.bin
// nowc_grib2_gen.binが出来上がる
// データ圧縮⽅式を確認(Grid Point Data - Complex Packing and Spatial Differencing)
$ wgrib2 nowc_grib2_gen.bin -packing -d 1
check_pdt_size: pdt=50008 needs to be added to pdt_len(..)
1:0:packing=Grid point data - complex packing and spatial differencing,c3
// GDALで読み込み(成功)
$ gdalinfo nowc_grib2_gen.bin
Warning 6: Template 4.50008 is not recognized currently
Driver: GRIB/GRIdded Binary (.grb, .grb2)
Files: nowc_grib2_gen.bin
Size is 2560, 3360
Coordinate System is:
GEOGCRS["Coordinate System imported from GRIB file",
...
35
気象庁のGRIB2はデータ圧縮⽅式がマイナー
なのでwgrib2以外のパー
サーはほとんど未対応
wgrib2で⼀般的なデータ圧縮
⽅式に変換してあげればその
他のパーサーで読み込める
GRIB2が対応してるデータ圧縮⽅式⼀覧
GDALはランレングス圧縮に対応していない
wgrib2はランレングス圧縮に対応している
気象庁はランレングス圧縮でデータ部を圧縮
これでQGISで
読める