[GRASSLIST:4544] Advice on changing source code for g.region command

Roy Sanderson R.A.Sanderson at newcastle.ac.uk
Fri Sep 20 08:13:02 EDT 2002


Hello Grass-users

I've recently upgraded our system and advised my colleagues to start using
GRASS5.0 (pre5), and one alteration which is causing problems is that the
output from "g.region -p" has changed.  In Grass4.3 the output was in the
form of:

projection:
zone:
north:
south:
east:
west:
nsres:
ewres:
rows:
cols:

whereas in Grass 5 the output from "g.region -p" gives

projection:
zone:
north:
south:
west:
east:
nsres:
ewres:
rows:
cols:

The observant amongst you will spot that east and west have swapped round.
As my colleagues have the g.region command liberally embedded in various
scripts, and the output is read by their own C programs, this is causing
problems.  My suggestion to them that they should go through all their C
programs and edit the input lines was not well received!

As an alternative, I'm wondering whether to alter the Grass 5.0 code
myself, and recompile it.  I've not done this before, but assume the
offending lines are in
/src/grass5.0.0pre5/src/general/g.region/cmd/printwindow.c  Am I safe in
simply swapping the fprintf lines round for east and west so that they
match the Grass4.3 format, and re-compiling?

Many thanks for your help
Roy

----------------------------------------------------------------------------
Roy Sanderson
Centre for Life Sciences Modelling
Porter Building
University of Newcastle
Newcastle upon Tyne
NE1 7RU
United Kingdom

Tel: +44 191 222 7789
Fax: +44 191 222 6563
r.a.sanderson at newcastle.ac.uk
http://www.ncl.ac.uk/clsm

----------------------------------------------------------------------------



More information about the grass-user mailing list