[GRASS-user] getting the current location name

Johannes Radinger johannesradinger at gmail.com
Wed Feb 13 08:13:39 PST 2013


Hi,

On Wed, Feb 13, 2013 at 4:31 PM, Rebecca Stedham
<rlstedham at btinternet.com> wrote:
> Hi there,
>
> I am trying to 'get' the current grass location, set it to a variable such
> that I can then use it in a python script.  Currently I have managed to
> print the current location to the command terminal screen using:
>
> grass.run_command('g.gisenv', get = 'LOCATION_NAME')

maybe you can try grass.read_command instead:
x = grass.read_command('g.gisenv', get = 'LOCATION_NAME')

/j

>
> I have now become stuck. Would anyone be able to recommend to me a way to
> assign a variable to it???
> Thank you in advance for any help you can offer.
>
> Becky
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list