<div dir="ltr"><div><div><div>He Pedro<br><br></div>Please try to specific your GISDBASE location as the code showing below;<br><br>import os<br>import sys<br><br>gisbase = os.environ['GISBASE'] = "C:/Program Files/QGIS Valmiera/apps/grass/grass-6.4.3"<br>sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))<br>gisdbase = os.path.join(os.getenv('APPDATA', 'GRASS6/grassrc6'))<br><br>location = "AZ"<br>gisdbase = "C:/Users/pcamargo/AppData/Roaming/GRASS6/grassrc6"<br>mapset = "AZMAP"<br><br>import grass.script as grass<br>import grass.script.setup as gsetup<br>gsetup.init(gisbase, gisdbase, location, mapset)<br><br></div>Best,<br></div>Sittichai<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 6, 2015 at 11:16 PM, Pedro Camargo <span dir="ltr"><<a href="mailto:veigacamargo@gmail.com" target="_blank">veigacamargo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br></div> I have been trying to use GRASS without opening it explicitly following the instructions from here: <a href="http://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_6" target="_blank">http://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_6</a><br><br></div> Since I am on Windows, I had to adapt it a bit (and I tried many, many variations). The most likely <br><br><br>import os<br>import sys<br>location = "AZ"<br>mapset = "AZMAP"<br>gisbase = os.environ['GISBASE'] = "C:/Program Files/QGIS Valmiera/apps/grass/grass-6.4.3"<br>sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))<br>gisdbase = os.path.join(os.getenv('APPDATA', 'GRASS6/grassrc6'))<br>import grass.script as grass<br>import grass.script.setup as gsetup<br>gsetup.init(gisbase, gisdbase, location, mapset)<br><br><br></div>What I get when I run these lines is the line below:<br><div><div><br>'c:\\users\\pcamargo\\appdata\\local\\temp\\tmp7wvogg'<br><br><br></div><div>The content of this file is <br></div><div><br>GISDBASE: C:/Users/pcamargo/AppData/Roaming/GRASS6/grassrc6<br>LOCATION_NAME: AZ<br>MAPSET: AZMAP<br><br></div><div>While it should be getting the contents from the file at C:\Users\pcamargo\AppData\Roaming\GRASS6\grassrc6<br><br><br></div><div>What am I doing wrong?<br><br></div><div>Thanks,<br><br></div><div>Pedro<br></div><div><br><br></div></div></div>
<br>_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">Dr.Sittichai Choosumrong</span></span></div><div><span style="color:rgb(102,102,102);background-color:rgb(243,243,243)">-------------------------</span><br></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">Lecturer, </span></span><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)"><br>Geography and </span></span><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">Geographic Information Science (GISci)<br></span><span style="background-color:rgb(243,243,243)"><span>Department of Natural Resources and Environment,</span></span></span></div><div><span style="color:rgb(102,102,102)">Faculty of Agriculture, Natural Resources and Environment</span><span style="color:rgb(102,102,102);background-color:rgb(243,243,243)">,</span><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)"><span><br></span></span></span></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)"><span></span></span>Naresuan University,</span><span style="color:rgb(102,102,102);background-color:rgb(243,243,243)"> Thailand 65000</span></div><div><span style="color:rgb(102,102,102);background-color:rgb(243,243,243)"><br></span></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)"><span>Office: +66 55 962753<br></span></span></span></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">Mobile: +66 95-635-8102<br></span></span></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">email: <a href="mailto:sittichaic@nu.ac.th" target="_blank">sittichaic@nu.ac.th</a><br></span></span></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">■□■□■□■□■□■□■□■□■</span></span></div><div><br></div></div></div></div></div></div></div></div></div>
</div>