<div dir="ltr">Hi Sittichai,<div><br></div><div> The location of the database is J:\MY_PROJECT\GRASS</div><div><br></div><div>Is that what you wanted to know?</div><div><br></div><div>Thanks,</div><div><br></div><div>Pedro</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 6, 2015 at 5:51 PM, sittichai choosumrong <span dir="ltr"><<a href="mailto:sittichai.ocu@gmail.com" target="_blank">sittichai.ocu@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>He Pedro<br><br></div>Please try to specific your GISDBASE location as the code showing below;<br><br>import os<br>import sys<span class=""><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></span>location = "AZ"<br>gisdbase = "C:/Users/pcamargo/AppData/Roaming/GRASS6/grassrc6"<br>mapset = "AZMAP"<span class=""><br><br>import grass.script as grass<br>import grass.script.setup as gsetup<br>gsetup.init(gisbase, gisdbase, location, mapset)<br><br></span></div>Best,<br></div>Sittichai<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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></div></div>_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">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><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: <a href="tel:%2B66%2055%20962753" value="+6655962753" target="_blank">+66 55 962753</a><br></span></span></span></div><div><span style="color:rgb(102,102,102)"><span style="background-color:rgb(243,243,243)">Mobile: <a href="tel:%2B66%2095-635-8102" value="+66956358102" target="_blank">+66 95-635-8102</a><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>
</blockquote></div><br></div>