[GRASS-dev] g.region error msg with empty WIND file

Markus Neteler neteler at osgeo.org
Thu Aug 6 08:09:37 PDT 2015


Hi,

just had a power cut while doing raster processing.
After restart the following error msg came up:

GRASS 7.1.svn (eu_laea): > g.region n=2571000 s=2211000 w=4183000
e=4523000 res=1000 -a
ERROR: Field <projection> missing

Tracing it down:

GRASS 7.1.svn (eu_laea): > g.region n=2571000 s=2211000 w=4183000
e=4523000 res=1000 -a
D1/3: G_set_program_name(): g.region
D2/3: G_file_name(): path = /grassdata/eu_laea/sp_modis_swath
D2/3: G_file_name(): path = /grassdata/eu_laea/PERMANENT/DEFAULT_WIND
D2/3: G_file_name(): path = /grassdata/eu_laea/PERMANENT/DEFAULT_WIND
D2/3:     file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       99
D3/3: region item: zone:       0
D3/3: region item: north:      2599999.9994859
D3/3: region item: south:      2499999.99955235
D3/3: region item: east:       4400000.0001125
D3/3: region item: west:       4300000.00005084
D3/3: region item: cols:       20
D3/3: region item: rows:       20
D3/3: region item: e-w resol:  5000.00000308
D3/3: region item: n-s resol:  4999.99999668
D3/3: region item: top:        1
D3/3: region item: bottom:     0
D3/3: region item: cols3:      20
D3/3: region item: rows3:      20
D3/3: region item: depths:     1
D3/3: region item: e-w resol3: 5000.00000308
D3/3: region item: n-s resol3: 4999.99999668
D3/3: region item: t-b resol:  1
D2/3: G_file_name(): path = /grassdata/eu_laea/sp_modis_swath/WIND
D2/3: G_file_name(): path = /grassdata/eu_laea/sp_modis_swath/WIND
D2/3:     file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
ERROR: Field <projection> missing
D1/3: G_set_program_name(): g.gisenv
D3/3: G_option_to_separator(): key = separator -> sep = '/'

... shows after longer debugging that really the WIND file was simply 0 bytes:

ls -la /grassdata/eu_laea/sp_modis_swath/WIND
-rw-r--r-- 1 sajid gis 0 Aug  6 11:55 /grassdata/eu_laea/sp_modis_swath/WIND


How to change lib/gis/rd_cellhd.c to detect this and write out an
informative message?

(solution: g.region -d, the it is written anew)

thanks
Markus


More information about the grass-dev mailing list