[GRASS-dev] ps.map: scale wrong and no output

Glynn Clements glynn at gclements.plus.com
Wed Nov 15 19:25:45 EST 2006


Maciej Sieczka wrote:

> Hi,
> 
> ps.map calculates the scale wrong.
> 
> In a following region:
> 
> $ g.region -g
> n=5603200
> s=5572300
> w=3661900
> e=3709600
> nsres=100
> ewres=100
> rows=309
> cols=477
> 
> a following ps.map syntax:
> 
> ---
> raster dol
> 
> paper a0
> end	
> 
> end
> ---
> 
> leads to the calculated scale is wrong:
> 
> $ ps.map input=ps.txt out=dol.ps
> PS-PAINT: scale set to 1 :
> 189563909041466328239248756598074334180039196672.
> PS-PAINT: reading raster file <dol in PERMANENT> ...
> PS-PAINT: PostScript file "dol2.ps" successfully written.
> 
> ... and the file is corrupted.
> 
> 
> 
> Interestingly, each another run calculates a different scale, eg.:
> 
> 1 : 142326034786662069525054397244000749605886099456
> 1 : 117895386731897106408980263771204349942212591616
> 1 : 130987549471569116744136784814156140792334254080
> 
> 
> If I define the paper manually, like:
> 
> height 46.77
> width 33.07
> left 1
> right 1
> bottom 1
> top 1
> 
> All is OK, the calculated scale is 1:37000.

Specifying a named paper size doesn't work. More precisely, failing to
specify all of the properties of the paper size doesn't work.

The problem is due to the attempt to handle rotated plots:

	RCS file: /grassrepository/grass6/ps/ps.map/r_paper.c,v
	Working file: r_paper.c
	----------------------------
	revision 1.2
	date: 2006/08/04 07:25:22;  author: markus;  state: Exp;  lines: +22 -12
	Bob Covill: fix paper size/map scaling for rotated map
	----------------------------

The updated version of read_paper() attempts to unconditionally fill
in all of the fields related to paper sizes, when it should only be
setting fields which are actually specified. If the user fails to
explicitly specify any of the fields, that field will contain garbage.

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




More information about the grass-dev mailing list