[GRASS-user] BIN raster import

Glynn Clements glynn at gclements.plus.com
Wed Sep 3 20:52:06 EDT 2008


Hamish wrote:

> > It would be nice if r.in.bin offered a "create new location" option. 
> > That way, the import could work byte-by-byte without worrying about 
> > bounds,

Import (r.in.*) modules ignore the current region; no resampling is
performed.

With r.in.bin, you can specify the bounds via the
north=/south=/east=/west= options, but this is just used to set the
bounds of the imported map (analogous to running r.region after
importing); it doesn't otherwise affect the import process.

> Binary files are just a long string of numbers. Without knowing the number
> of rows and columns it could be either wide and short or narrow and tall.
> There's no way for the module to pick that up otherwise. (unless like the
> old GMT format (r.in.bin -h) there is some header info in the file)

Depending upon the data, you may be able to infer the number of
columns from a 1-dimensional FFT of (a portion of) the data.

Or you can factor the total number of cells, treating each factor as a
candidate for the number of columns, checking for similarity between
adjacent cells and discontinuities at the edges.

Such approaches tend to be more effective if the data isn't made up of
clusters of (real) data surrounded by a sea of no-data/zero/sea-level/etc.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list