<div dir="ltr">Update:<div><br></div><div>So, the folder from which I was running the command was wrong, and when ran the script from the correct folder, it ran just fine.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 20, 2021 at 10:55 PM Ayush Chauhan <<a href="mailto:ayush@huviair.com">ayush@huviair.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Veronica, everyone,<div><br></div><div>I used the below URL to re-install the grass7.8, after deleting the previous grass6.4.4 and previous grass7.8.5 versions.</div><div><br></div><div><a href="https://grass.osgeo.org/grass78/source/snapshot/grass-7.8.git_src_snapshot_2021_07_17.tar.gz" target="_blank">https://grass.osgeo.org/grass78/source/snapshot/grass-7.8.git_src_snapshot_2021_07_17.tar.gz</a><br></div><div><br></div><div>I am trying to run a simple grass script, that will count the number of points on the geojson file.</div><div><br></div><div>```</div><div><div style="color:rgb(102,136,204);background-color:rgb(0,12,24);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(56,72,135)"># %module</span></div><div><span style="color:rgb(56,72,135)"># % description: greets the user and prints the information of a spatial file</span></div><div><span style="color:rgb(56,72,135)"># %end</span></div><div><span style="color:rgb(56,72,135)"># %option</span></div><div><span style="color:rgb(56,72,135)"># % key: test</span></div><div><span style="color:rgb(56,72,135)"># % type: string</span></div><div><span style="color:rgb(56,72,135)"># % required: yes</span></div><div><span style="color:rgb(56,72,135)"># % multiple: no</span></div><div><span style="color:rgb(56,72,135)"># % description: Geospatial test file</span></div><div><span style="color:rgb(56,72,135)"># %end</span></div><br><div><span style="color:rgb(34,85,136)">import</span> sys</div><div><span style="color:rgb(34,85,136)">from</span> grass.pygrass.modules <span style="color:rgb(34,85,136)">import</span> Module</div><div><span style="color:rgb(34,85,136)">import</span> grass.script <span style="color:rgb(34,85,136)">as</span> grass</div><br><br><div><span style="color:rgb(153,102,184);font-style:italic">def</span> <span style="color:rgb(221,187,136)">main</span>():</div><div> <span style="color:rgb(56,72,135)"># Import raster and vector</span></div><div> Module(<span style="color:rgb(34,170,68)">"v.in.ogr"</span>, <span style="color:rgb(34,119,255);font-style:italic">input</span><span style="color:rgb(34,85,136)">=</span>opts[<span style="color:rgb(34,170,68)">"test"</span>], <span style="color:rgb(34,119,255);font-style:italic">output</span><span style="color:rgb(34,85,136)">=</span><span style="color:rgb(34,170,68)">"test"</span>, <span style="color:rgb(34,119,255);font-style:italic">overwrite</span><span style="color:rgb(34,85,136)">=</span><span style="color:rgb(242,128,208)">True</span>)</div><div> info <span style="color:rgb(34,85,136)">=</span> grass.vector_info(<span style="color:rgb(34,170,68)">"test"</span>)</div><div> <span style="color:rgb(153,102,184)">print</span>(<span style="color:rgb(34,170,68)">"Number of points: </span><span style="color:rgb(242,128,208)">%s</span><span style="color:rgb(34,170,68)">"</span> <span style="color:rgb(34,85,136)">%</span> info[<span style="color:rgb(34,170,68)">"points"</span>])</div><br><br><div><span style="color:rgb(34,85,136)">if</span> __name__ <span style="color:rgb(34,85,136)">==</span> <span style="color:rgb(34,170,68)">"__main__"</span>:</div><div> opts, _ <span style="color:rgb(34,85,136)">=</span> grass.parser()</div><div> sys.exit(main())</div><br></div></div><div>```</div><div><br></div><div>Now, when I am running the following command:</div><div>```</div><div>/home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78 -c EPSG:4326 location --exec /home/ec2-user/volume_calc/.venv/bin/python3 /home/ec2-user/volume_calc/simple_test.py test=/home/ec2-user/volume_calc/media/tour_id/tmpb1civ9id_grass_engine/test.geojson<br></div><div>```</div><div><br></div><div>I receive the following error:</div><div><br></div><div>```</div><div>Starting GRASS GIS...<br>Creating new GRASS GIS location <location>...<br>Traceback (most recent call last):<br> File "/home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78", line 2348, in <module><br> main()<br> File "/home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78", line 2248, in main<br> geofile=params.geofile, create_new=True)<br> File "/home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78", line 1002, in set_mapset<br> create_location(gisdbase, location_name, geofile)<br> File "/home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78", line 804, in create_location<br> epsg=epsg, datum_trans=datum_trans)<br> File "/home/ec2-user/src/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 1541, in create_location<br> gisdbase = gisenv()['GISDBASE']<br>KeyError: 'GISDBASE'<br></div><div>```</div><div><br></div><div>I have set all the environment variables for the binary file of grass78 ("/home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78")</div><div><br></div><div>GISBASE: /home/ec2-user/src/grass/dist.x86_64-pc-linux-gnu<br>GUI: text<br>GRASSBIN: /home/ec2-user/src/grass/bin.x86_64-pc-linux-gnu/grass78<br>PYTHONPATH: /home/ec2-user/src/grass/dist.x86_64-pc-linux-gnu/etc/python<br>GISDBASE: /home/ec2-user/volume_calc/media/tour_id<br></div><div>LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$GISBASE/lib<br>PATH = $PATH:/usr/bin:$GISBASE/bin:$GISBASE/scripts <br>LC_ALL: C.UTF-8<br></div><div><br></div><div>Still, the python grass script(/home/ec2-user/src/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py) is giving me the GISDBASE error (I think it is env variable error, not sure).</div><div>Please tell me, is there any environment variable that I am forgetting? Or this is something else.</div><div><br></div><div>And this is happening after the new installation. In my previous version, I was able to run this basic script to test my grass installation (which is failing this time).</div><div>Please let me know if you need more information.</div><div>Thanks</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 19, 2021 at 8:45 PM Veronica Andreo <<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Ayush</div><div><br></div><div>GRASS 7.8 already has the r.external module, so no need to patch it. I'd try first by using a clean installation of grass 7.8.5 (or compilation of 7.8.6 for that matter). <br></div><div><br></div><div>Also the same way there's v.import for vector data, there's r.import for quick raster import, so you could try that for importing your raster map.</div><div><br></div><div>my 0.02 cents</div><div>Vero<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun, 19 jul 2021 a las 8:16, Ayush Chauhan (<<a href="mailto:ayush@huviair.com" target="_blank">ayush@huviair.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am using the below code in my grass script to calculate volume from the DSM file input into the script and the polygon points on the DSM.</div><div>```</div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div># %module</div><div># % description: Calculate volume of area and prints the volume to stdout</div><div># %end</div><div># %option</div><div># % key: area_file</div><div># % type: string</div><div># % required: yes</div><div># % multiple: no</div><div># % description: Geospatial file containing the area to measure</div><div># %end</div><div># %option</div><div># % key: points_file</div><div># % type: string</div><div># % required: yes</div><div># % multiple: no</div><div># % description: Geospatial file containing the points defining the area</div><div># %end</div><div># %option</div><div># % key: dsm_file</div><div># % type: string</div><div># % required: yes</div><div># % multiple: no</div><div># % description: GeoTIFF DEM containing the surface</div><div># %end</div><div><br></div><div>import sys</div><div>from grass.pygrass.modules import Module</div><div>import grass.script as grass</div><div><br></div><div><br></div><div>def main():</div><div><br></div><div> Module(</div><div> "v.import",</div><div> input=opts['area_file'],</div><div> output="polygon_area",</div><div> overwrite=True</div><div> )</div><div> Module(</div><div> "v.import",</div><div> input=opts['points_file'],</div><div> output="polygon_points",</div><div> overwrite=True</div><div> )</div><div> Module(</div><div> "v.buffer",</div><div> input="polygon_area",</div><div> s=True,</div><div> type="area",</div><div> output="region",</div><div> distance=1,</div><div> minordistance=1,</div><div> overwrite=True</div><div> )</div><div> Module("r.external", input=opts['dsm_file'], output="dsm", overwrite=True)</div><div> # Set Grass region and resolution to DSM</div><div> Module("g.region", raster="dsm")</div><div> # Set Grass region to vector bbox</div><div> Module("g.region", vector="region")</div><div> # Create a mask to speed up computation</div><div> Module("r.mask", vector="region")</div><div> # Transfer dsm raster data to vector</div><div> Module("v.what.rast", map="polygon_points", raster="dsm", column="height")</div><div> # Decimate DSM and generate interpolation of new terrain</div><div> Module("v.surf.rst", input="polygon_points", zcolumn="height",</div><div> elevation="dsm_below_pile", overwrite=True)</div><div> # Compute difference between dsm and new dsm</div><div> Module("r.mapcalc",</div><div> expression='pile_height_above_dsm=dsm-dsm_below_pile', overwrite=True)</div><div> # Set region to polygon area to calculate volume</div><div> Module("g.region", vector="polygon_area")</div><div> # Volume output from difference</div><div> Module("r.volume", input="pile_height_above_dsm", f=True)</div><div><br></div><div> return 0</div><div><br></div><div><br></div><div>if __name__ == "__main__":</div><div> opts, _ = grass.parser()</div><div> sys.exit(main())</div></blockquote>```<div><br><div><div>The area file I am providing contains the below contents(area_file.geojson):</div><div><br></div><div>```</div></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><div>{"type": "Feature", "properties": {}, "geometry": {"type": "Polygon", "coordinates": [[[73.31231666938123, 26.22297239890824], [73.31241572405983, 26.222379996744422], [73.3134282830031, 26.222577464467804], [73.31281194277611, 26.222906576595037], [73.31231666938123, 26.22297239890824]]]}}</div></div></blockquote><div><div>```</div><div><br></div><div><div>The points file I am providing contains the below contents(points_file.geojson):</div><div><br></div><div>```</div></div></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><div><div>{"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31231666938123, 26.22297239890824]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31241572405983, 26.222379996744422]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.3134282830031, 26.222577464467804]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31281194277611, 26.222906576595037]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31231666938123, 26.22297239890824]}}]}</div></div></div></blockquote><div><div><div>```<br></div></div><div><br></div><div>When I run the below command,</div><div><br></div><div>```</div></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><div><b>/home/ec2-user/grass/bin.x86_64-pc-linux-gnu/grass78 -c \</b></div><div><b>/home/ec2-user/volume_calc/media/tour_id/files/dsm_volume.tif location \</b></div><div><b>--exec python3 /home/ec2-user/volume_calc/grass_calc_vol.py \</b></div><div><b>area_file=/home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/area_file.geojson \</b></div><div><b>points_file=/home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/points_file.geojson \</b></div><div><b>dsm_file=/home/ec2-user/volume_calc/media/tour_id/files/dsm_volume.tif</b></div></div></blockquote><div><div>```</div><div><br></div><div>I get below output.</div><div>```</div></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><div>(.venv) [ec2-user@ip-10-0-3-14 volume_calc]$ /home/ec2-user/grass/bin.x86_64-pc-linux-gnu/grass78 -c /home/ec2-user/volume_calc/media/tour_id/files/dsm_volume.tif location --exec python3 /home/ec2-user/volume_calc/grass_calc_vol.py area_file=/home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/area_file.geojson points_file=/home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/points_file.geojson dsm_file=/home/ec2-user/volume_calc/media/tour_id/files/dsm_volume.tif</div></div><div><div>Starting GRASS GIS...</div></div><div><div>Creating new GRASS GIS location <location>...</div></div><div><div>Cleaning up temporary files...</div></div><div><div>Executing <python3 /home/ec2-user/volume_calc/grass_calc_vol.py area_file=/home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/area_file.geojson points_file=/home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/points_file.geojson dsm_file=/home/ec2-user/volume_calc/media/tour_id/files/dsm_volume.tif> ...</div></div><div><div>Check if OGR layer <OGRGeoJSON> contains polygons...</div></div><div><div> 100%</div></div><div><div>Creating attribute table for layer <OGRGeoJSON>...</div></div><div><div>Importing 1 features (OGR layer <OGRGeoJSON>)...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Registering primitives...</div></div><div><div>-----------------------------------------------------</div></div><div><div>Cleaning polygons</div></div><div><div>-----------------------------------------------------</div></div><div><div>Breaking polygons...</div></div><div><div>Breaking polygons (pass 1: select break points)...</div></div><div><div> 100%</div></div><div><div>Breaking polygons (pass 2: break at selected points)...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Removing duplicates...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Breaking boundaries...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Removing duplicates...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Cleaning boundaries at nodes...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Merging boundaries...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Removing dangles...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Building areas...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Removing bridges...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Registering primitives...</div></div><div><div>Building areas...</div></div><div><div> 100%</div></div><div><div>Attaching islands...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Finding centroids for OGR layer <OGRGeoJSON>...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Writing centroids...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>1 input polygons</div></div><div><div>Total area: 4106.45 (1 areas)</div></div><div><div>-----------------------------------------------------</div></div><div><div>Copying features...</div></div><div><div> 100%</div></div><div><div>Building topology for vector map <polygon_area@PERMANENT>...</div></div><div><div>Registering primitives...</div></div><div><div>Building areas...</div></div><div><div> 100%</div></div><div><div>Attaching islands...</div></div><div><div> 100%</div></div><div><div>Attaching centroids...</div></div><div><div> 100%</div></div><div><div>Input</div></div><div><div></home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/area_file.geojson></div></div><div><div>successfully imported without reprojection</div></div><div><div>Check if OGR layer <OGRGeoJSON> contains polygons...</div></div><div><div> 100%</div></div><div><div>Creating attribute table for layer <OGRGeoJSON>...</div></div><div><div>Importing 5 features (OGR layer <OGRGeoJSON>)...</div></div><div><div> 100%</div></div><div><div>-----------------------------------------------------</div></div><div><div>Building topology for vector map <polygon_points@PERMANENT>...</div></div><div><div>Registering primitives...</div></div><div><div>Input</div></div><div><div></home/ec2-user/volume_calc/media/tour_id/tmpo99fe5bi_grass_engine/points_file.geojson></div></div><div><div>successfully imported without reprojection</div></div><div><div>Note: In latitude-longitude coordinate system specify distances in degree</div></div><div><div>unit</div></div><div><div>WARNING: Option 'minordistance' is not available with GEOS buffering</div></div><div><div>Buffering areas...</div></div><div><div> 100%</div></div><div><div>Cleaning buffers...</div></div><div><div>Building parts of topology...</div></div><div><div>Building topology for vector map <region@PERMANENT>...</div></div><div><div>Registering primitives...</div></div><div><div>Snapping boundaries...</div></div><div><div>Reading features...</div></div><div><div>Snap vertices Pass 1: select points</div></div><div><div> 100%</div></div><div><div>Snap vertices Pass 2: assign anchor vertices</div></div><div><div> 100%</div></div><div><div>Snap vertices Pass 3: snap to assigned points</div></div><div><div> 100%</div></div><div><div>Breaking polygons...</div></div><div><div>Breaking polygons (pass 1: select break points)...</div></div><div><div> 100%</div></div><div><div>Breaking polygons (pass 2: break at selected points)...</div></div><div><div> 100%</div></div><div><div>Removing duplicates...</div></div><div><div> 100%</div></div><div><div>Breaking boundaries...</div></div><div><div> 100%</div></div><div><div>Removing duplicates...</div></div><div><div> 100%</div></div><div><div>Cleaning boundaries at nodes</div></div><div><div> 100%</div></div><div><div>Building topology for vector map <region@PERMANENT>...</div></div><div><div>Building areas...</div></div><div><div> 100%</div></div><div><div>Removing dangles...</div></div><div><div> 100%</div></div><div><div>Removing bridges...</div></div><div><div> 100%</div></div><div><div>Attaching islands...</div></div><div><div>Building topology for vector map <region@PERMANENT>...</div></div><div><div>Attaching islands...</div></div><div><div> 100%</div></div><div><div>Calculating centroids for all areas...</div></div><div><div> 100%</div></div><div><div>Generating list of boundaries to be deleted...</div></div><div><div> 100%</div></div><div><div>Deleting boundaries...</div></div><div><div> 100%</div></div><div><div>Calculating centroids for areas...</div></div><div><div> 100%</div></div><div><div>Building topology for vector map <region@PERMANENT>...</div></div><div><div>Registering primitives...</div></div><div><div>Building areas...</div></div><div><div> 100%</div></div><div><div>Attaching islands...</div></div><div><div> 100%</div></div><div><div>Attaching centroids...</div></div><div><div> 100%</div></div><div><div>WARNING: Unable to open datum table file</div></div><div><div> </home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/datum.table></div></div><div><div>WARNING: Datum <WGS_1984> not recognised by GRASS and no parameters found</div></div><div><div>WARNING: Unable to open ellipsoid table file</div></div><div><div> </home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/ellipse.table></div></div><div><div>Projection of input dataset and current location appear to match</div></div><div><div>Importing band 1 of 1...</div></div><div><div>Link to raster map <dsm> created</div></div><div><div>Reading areas...</div></div><div><div> 100%</div></div><div><div>Writing raster map...</div></div><div><div> 100%</div></div><div><div>Reading areas...</div></div><div><div> 100%</div></div><div><div>Writing raster map...</div></div><div><div> 100%</div></div><div><div>Reading areas...</div></div><div><div> 100%</div></div><div><div>Writing raster map...</div></div><div><div> 100%</div></div><div><div>Reading areas...</div></div><div><div> 100%</div></div><div><div>Writing raster map...</div></div><div><div>^CTraceback (most recent call last):</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/scripts/r.mask", line 199, in <module></div></div><div><div> main()</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/scripts/r.mask", line 179, in main</div></div><div><div> type='area', cats=cats, where=where, env=env)</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 440, in run_command</div></div><div><div> returncode = ps.wait()</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1019, in wait</div></div><div><div> return self._wait(timeout=timeout)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1653, in _wait</div></div><div><div> (pid, sts) = self._try_wait(0)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1611, in _try_wait</div></div><div><div> (pid, sts) = os.waitpid(self.pid, wait_flags)</div></div><div><div>KeyboardInterrupt</div></div><div><div>Traceback (most recent call last):</div></div><div><div> File "/home/ec2-user/volume_calc/grass_calc_vol.py", line 80, in <module></div></div><div><div> sys.exit(main())</div></div><div><div> File "/home/ec2-user/volume_calc/grass_calc_vol.py", line 61, in main</div></div><div><div> Module("r.mask", vector="region")</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/interface/module.py", line 602, in __init__</div></div><div><div> self.__call__(*args, **kargs)</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/interface/module.py", line 660, in __call__</div></div><div><div> return self.run()</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/interface/module.py", line 783, in run</div></div><div><div> self.wait()</div></div><div><div> File "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/modules/interface/module.py", line 796, in wait</div></div><div><div> stdout, stderr = self._popen.communicate(input=self.stdin)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 956, in communicate</div></div><div><div> self.wait()</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1019, in wait</div></div><div><div> return self._wait(timeout=timeout)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1653, in _wait</div></div><div><div> (pid, sts) = self._try_wait(0)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1611, in _try_wait</div></div><div><div> (pid, sts) = os.waitpid(self.pid, wait_flags)</div></div><div><div>KeyboardInterrupt</div></div><div><div>Traceback (most recent call last):</div></div><div><div> File "/home/ec2-user/grass/bin.x86_64-pc-linux-gnu/grass78", line 2348, in <module></div></div><div><div> main()</div></div><div><div> File "/home/ec2-user/grass/bin.x86_64-pc-linux-gnu/grass78", line 2286, in main</div></div><div><div> returncode = run_batch_job(batch_job)</div></div><div><div> File "/home/ec2-user/grass/bin.x86_64-pc-linux-gnu/grass78", line 1635, in run_batch_job</div></div><div><div> returncode = proc.wait()</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1019, in wait</div></div><div><div> return self._wait(timeout=timeout)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1653, in _wait</div></div><div><div> (pid, sts) = self._try_wait(0)</div></div><div><div> File "/usr/lib64/python3.7/subprocess.py", line 1611, in _try_wait</div></div><div><div> (pid, sts) = os.waitpid(self.pid, wait_flags)</div></div><div><div>KeyboardInterrupt</div></div></blockquote><div><div>```</div><div><br></div><div>I had to hit <b>CTRL + C </b>to stop the infinite loop. </div><div><br></div><div>Few lines from my grass78 bin file inside <b>/home/ec2-user/grass/bin.x86_64-pc-linux-gnu/</b></div><div><br></div><div>```</div></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div>GISBASE = os.path.normpath("/home/ec2-user/grass/dist.x86_64-pc-linux-gnu")</div><div>os.environ['GISBASE'] = GISBASE</div><div>CMD_NAME = "grass78"</div><div>GRASS_VERSION = "7.8.6dev"</div><div>LD_LIBRARY_PATH_VAR = 'LD_LIBRARY_PATH'</div><div>CONFIG_PROJSHARE = os.environ.get('GRASS_PROJSHARE', "/usr/share/proj")</div></blockquote><div><div>```</div><div>Environment variables that I am setting:</div><div><br></div><div>```</div> env["LC_ALL"] = "C.UTF-8"<br> env["GISBASE"] = "/home/ec2-user/grass/dist.x86_64-pc-linux-gnu"<br> env["GISDBASE"] = self.tmpdir # in the above code eg.
<b>tmpo99fe5bi_grass_engine</b><br> env['PATH'] = "$PATH:/usr/bin:$GISBASE/bin:$GISBASE/scripts"<br> env['LD_LIBRARY_PATH'] = "$LD_LIBRARY_PATH:$GISBASE/lib"<br> env['GISRC'] = "$HOME/.grass7"<br> env['PYTHONPATH'] = "$HOME/grass/dist.x86_64-pc-linux-gnu/etc/python"<div>```</div><div><br></div><div>Also, I had copied the r.external file from version grass-6.4.4 that was installed automatically when I ran `sudo yum install grass`. Because it was not present in the bin folder of this location</div></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><div><b><br></b></div><div><b>/home/ec2-user/grass/dist.x86_64-pc-linux-gnu/bin/</b></div></div></blockquote><div><br></div>Is there a way to get the file from outside, thus removing the grass-6.4.4 version and using the grass-7.8.5 version r.external file (can that be a cause of infinite loop)?<div>Any suggestions as to what is going wrong? or anything wrong in the Grass SCRIPT mentioned above, that could potentially lead to an infinite loop.<br><div>Please let me know if you need more information.</div><div><br></div><div>--</div><div><div dir="ltr"><div dir="ltr"><div>Regards,</div><div>Ayush Chauhan</div><div><br></div></div></div></div></div></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="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,</div><div>Ayush Chauhan,</div><div>Senior Product Engineer,</div><div>+91 8269036401 | <a href="http://huviair.com" target="_blank">Huviair Technologies</a></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,</div><div>Ayush Chauhan,</div><div>Senior Product Engineer,</div><div>+91 8269036401 | <a href="http://huviair.com" target="_blank">Huviair Technologies</a></div></div></div>