[GRASS-user] Defining Environment variable for WinGRASS

Greetings

Is it possible to define a Environmental variable for Windows, like GDAL_DATA, like this in a Python Script?

os.environ[‘GDAL_DATA’] =

Is this possible? does this work?

Thanks

Best regards,
Luisa

Luisa Peña wrote:

Is it possible to define a Environmental variable for Windows, like
GDAL_DATA, like this in a Python Script?

os.environ['GDAL_DATA'] = <PATH>

Is this possible? does this work?

Yes.

However, as each process has its own environment, it only affects the
process running the script and any child processes spawned from the
script. You can't modify the environment of other processes, e.g. the
process which invoked the script.

--
Glynn Clements <glynn@gclements.plus.com>

Hi Glynn
For instance if I define GDAL_DATA like that, If in the same script I run grass.Popen(<command to external gdal executable) is that defined GDAL_DATA path applicable?
Thanks

2011/3/31 Glynn Clements <glynn@gclements.plus.com>

Luisa Peña wrote:

Is it possible to define a Environmental variable for Windows, like
GDAL_DATA, like this in a Python Script?

os.environ[‘GDAL_DATA’] =

Is this possible? does this work?

Yes.

However, as each process has its own environment, it only affects the
process running the script and any child processes spawned from the
script. You can’t modify the environment of other processes, e.g. the
process which invoked the script.


Glynn Clements <glynn@gclements.plus.com>

Luisa Peña wrote:

For instance if I define GDAL_DATA like that, If in the same script I run
grass.Popen(<command to external gdal executable) is that defined GDAL_DATA
path applicable?

Yes.

--
Glynn Clements <glynn@gclements.plus.com>