[GRASS-dev] Access current region in pygrass

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Thu Sep 1 01:16:44 PDT 2016


Hi devs,

I am trying to access the Bbox of my current region in pygrass (GRASS 7.0.4), following examples here:
https://grass.osgeo.org/grass70/manuals/libpython/pygrass.gis.html#module-pygrass.gis.region.

Unfortunately, "north" returns always 1, for some reason I do not understand...

This is what I do:

>>> from grass.pygrass.gis.region import Region
>>> Region()
projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  wgs84
north:      75N
south:      60N
west:       15E
east:       6W
nsres:      1
ewres:      1
rows:       15
cols:       339
cells:      5085

>>> r = Region()
>>> r
projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  wgs84
north:      75N
south:      60N
west:       15E
east:       6W
nsres:      1
ewres:      1
rows:       15
cols:       339
cells:      5085

So, the region definition in my Python object "r" looks OK, but then
>>> r.north
1.0

Where I would expect to get 75.0 and
>>> r.get_bbox
<bound method Region.get_bbox of Region(north=1, south=0, east=1, west=0, nsres=1, ewres=1)>

I must be overlooking something pretty obvious... Any hint?

Cheers
Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160901/e3117d45/attachment-0001.html>


More information about the grass-dev mailing list