[GRASS-dev] [bug #5454] (grass) ps.map scaling not correct when projection units are feet

Request Tracker grass-bugs at intevation.de
Sun Jan 28 18:51:31 EST 2007


this bug's URL: http://intevation.de/rt/webrt?serial_num=5454
-------------------------------------------------------------------------

Subject: ps.map scaling not correct when projection units are feet

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: CVS HEAD  20070127 at 04:18  UTC

Noticed a strange anomaly in ps.map output when working in a State Plane Coordinate System with coordinates in feet.  Specifying any scale in ps.map gives manifestly incorrect scaling.  The scalebar produced also bears no obvious relationship to the scale of the map.

To reproduce:  create a location in New Mexico State Plane Coordinates, Central Zone, NAD83 (EPSG number 2258).  The result will have a PROJ_INFO file like this:
name: Transverse Mercator
proj: tmerc
datum: nad83
towgs84: 0.000,0.000,0.000
ellps: grs80
lat_0: 31
lon_0: -106.25
k: 0.999900
x_0: 500000.0001016001
y_0: 0
no_defs: defined

and a PROJ_UNITS file of:
unit: US survey foot
units: US survey foots
meters: 0.3048006096012192


Set the region to something arbitrary, for example:

> g.region -p
projection: 99 (Transverse Mercator)
zone:       0
datum:      nad83
ellipsoid:  grs80
north:      1485814.68884
south:      1485263.50884
west:       1525396.34529
east:       1526171.30805
nsres:      0.61310345
ewres:      0.61310345
rows:       899
cols:       1264
cells:      1136336


Now use the following ps.map file to generate postscript:

paper a0
end
scalebar f
 where 1.5 1.5 
 length 500
 height .25
 segment 5
 numbers 2
 fontsize 12
end
mapinfo 
  where 11.5 15
  fontsize 12
end
grid 100
  color black
  numbers 2
end

This should display a 100 foot grid and nothing else, and should have a 
scale bar with 100 foot markings that match the grid size.

For the region specified above, ps.map will select "1:982" as the scale.  Now try tinkering with the scale by adding scale commands to the ps.map file.  Even selecting "1:982" will give completely different results than leaving the scale out altogether.  As you change scale, the scalebar will not change size to reflect the change in the map grid.

I dug around a little in the source code, but couldn't find an obvious reason for why this is happening.  I thought it might be that the G_database_units_to_meters function might be returning the wrong value, but I haven't actually tried to debug so I'm not ready to say that's it.

I do not see the same behavior in a UTM location (where units are in meters).  


-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list