[GRASS-dev] d.out.file: world (wld) file support issue

Hamish hamish_b at yahoo.com
Fri Jan 25 18:33:01 EST 2008


Markus Neteler wrote:
> I wanted to add world file support to d.out.file but it seems that
> d.info -g doesn't work correctly (-g just added in SVN) in case that
> the "res=" parameter of d.out.file is used. The generated world file
> remains identical and thus the resulting map shifted.
> 
> What's wrong here? Patch attached to generate the world file.

Hi,
I haven't looked at the patch yet, but some comments.

first of all why not just use g.region for this? when are display NSEW
and g.region NSEW different? I don't understand the point.

display pixel resolution is resampled. It has nothing to do with region
resolution. so to caclulate it you would need to do 
(east-west)/$GRASS_WIDTH   not  (east-west)/ewres

have a look at d.out.gpsdrive. This does the same, it creates world
file(like) output of another flavour, dealing with things like double
and quadruple sizing. [For that I found it nice to quadruple size then
use GIMP's cubic resampler to mix back to target size. Much nicer
output than GRASS's nearest neighbor resampling.]


A solution I have used in the past is to use d.out.file, then
r.in.gdal(XY) + r.region. Then r.out.gdal could make the geotiff of the
image.

ISTR something about using r.mapcalc's r#map, g#map, b#map operators
but don't quite remember how that fit into the puzzle. That was done in
relation to allowing multiple raster overlays in ps.map AFAICR. (??)


other Qs:
how to deal with white bands if region aspect ratio does not match
display window aspect ratio? (see previous changes to d.info needed for
d.out.gpsdrive)

need to check that changes to d.info work correctly in sub-frames.



Hamish



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the grass-dev mailing list