[GRASS-user] Calling GRASS functionality from outside - how to create location

Hi All,

I need to create a Python script that calls the GRASS functionality from outside, which is perfectly explained in the wiki pages [1, 2, 3].
The problem is that I would need to create the location within the script running.
Is this possible and how?

Thanks in advance.

Regards,
madi

[1] http://grass.osgeo.org/wiki/GRASS_and_Python
[2] http://grass.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly
[3] http://grass.osgeo.org/wiki/GRASS_Python_Scripting_Library


Margherita DI LEO

Postdoctoral Researcher
European Commission - DG JRC
Forest Resources and Climate
I-21020 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

On Wed, Oct 17, 2012 at 3:50 PM, Margherita Di Leo <diregola@gmail.com> wrote:

The problem is that I would need to create the location within the script
running.
Is this possible and how?

The GRASS 7 startup script allows to create new locations:
http://grass.osgeo.org/grass70/manuals/html70_user/grass7.html

(For GRASS 6 there is a similar script in Addons.)

There is also a Python function for this:
python::core::create_location()
http://grass.osgeo.org/programming7/namespacepython_1_1core.html#a82acc872f87a3f3c3fb46cd0a2769662

Markus