[GRASS-dev] [GRASS GIS] #1161: g.region and r.info decimel issue
when using grass python libs
GRASS GIS
trac at osgeo.org
Fri Sep 17 17:57:53 EDT 2010
#1161: g.region and r.info decimel issue when using grass python libs
------------------------+---------------------------------------------------
Reporter: isaacullah | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Python | Version: 6.4.0
Keywords: | Platform: All
Cpu: All |
------------------------+---------------------------------------------------
When running grass.region() and grass.raster_info(), values come out in
double precision, which is NOT what you get if you run g.region or r.info,
where they come out in single precision. This can cause region
misalignments and problems with boolean comparisons in scripts.
{{{
>>> grass.run_command('r.info', map = 'BETA_elevation41', flags = 'g')
north=4293588.60267
south=4284488.78578
east=737425.161232
west=723395.443544
0
>>> grass.raster_info('BETA_elevation41')
{'north': 4293588.6026699999, 'timestamp': '"none"', 'min':
387.10700417163201, 'datatype': 'DCELL', 'max': 1339.129374287, 'ewres':
4.9998993900000004, 'vertical_datum': '', 'west': 723395.44354400004,
'units': '', 'title': ' (BETA_elevation41)', 'east': 737425.16123199998,
'nsres': 4.9998993900000004, 'south': 4284488.7857799996}
>>> grass.run_command('g.region', flags = 'gp')
n=4293588.60267
s=4284488.78578
w=723395.443544
e=737425.161232
nsres=4.99989939
ewres=4.99989939
rows=1820
cols=2806
cells=5106920
0
>>> grass.region()
{'rows': 1820, 'e': 737425.16123199998, 'cells': 5106920.0, 'cols': 2806,
'n': 4293588.6026699999, 's': 4284488.7857799996, 'w': 723395.44354400004,
'ewres': 4.9998993900000004, 'nsres': 4.9998993900000004}
}}}
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1161>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list