[GRASS-user] Get current location projection in a Python Script

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Sun May 30 05:41:37 EDT 2010


[...]
 
Nikos Alexandris:
> >>> Just for the records, a thread not _directly_ about it but close
> >>> (enough?):
> >>> <http://osgeo-org.1803224.n2.nabble.com/Getting-rows-cols-of-a-region-i
> >>> n -a- script-tc2787474.html#a2788062>
[...]
> > 1. http://www.mail-archive.com/grass-user@lists.osgeo.org/msg08280.html
> > 2. http://www.mail-archive.com/grass-user@lists.osgeo.org/msg08288.html

Michael Barton wrote: 
> These work, but there is a better shortcut now from the GRASS Python
> library.

> regiondict = grass.region()
 
> will create a Python dictionary regiondict with values for extents and
> resolution. It's the same as creating a dictionary by parsing g.region
> -ugp

Attached a simple python script with various ways to get "rows, cols" from the 
"current" region.

Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g.region.resolution.py
Type: text/x-python
Size: 2410 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20100530/016c86d6/g.region.resolution.py


More information about the grass-user mailing list