d.3d for lat long

(R Jesse Chaney) jesse at terra.cor2.epa.gov
Thu Sep 24 17:25:17 EDT 1992

	I recieved a suggestion on how to fix d.3d so that it would work for
lat long raster files.  It "mostly" works.  I could not get it to work for
entire raster files, but for zoomed regions of raster files.  So if you have
a map of the world you may only be able to do smaller regions of it at a time.
I do not know of this applies to raster files of less than the entire world.

	Good luck.  Use at your onw risk.  All disclaimers apply.  Etc.

R Jesse Chaney                        Internet: jesse at terra.cor2.epa.gov
US Environmental Protection Agency    Internet: jchaney at research.cs.orst.edu
200 SW 35th Street                    UUCP:     hplabs!hp-pcd!orstcs!jchaney
Oregon State University               Phone:    (503) 754-4497
Corvallis, Oregon 97331 USA

In the d.3d src directory (src/display/d.3d), there is a file called
get_inputs.c that creates initial settings.  In the function
get_defaults(), I just added these two lines:

        while((exag * max - exag * min) > (window.east - window.west)/5.)
            exag /= 5.; 

I put them right after the line:

        exag = 2.0 ;

in the defaults: goto block.  (I'd tell you the line number, but
there have been a few other minor changes in this file for GRASS4.1,
to use a new 3d.view file writing routine from the GRASS gis library,
so the line number would be different in your version.)

This fix has the effect of insuring that the initial elevation range 
is scaled to be between 1/5th and 1/25th as high as the data is wide.

Note that all units displayed by d.3d are in degrees, so if you want to
set a precise resolution in minutes & seconds you'll have to convert
to decimal first.

More information about the grass-dev mailing list