Questions tagged [pygrass]

Object-oriented Python API for GRASS GIS.

Filter by
Sorted by
Tagged with
1 vote
0 answers
36 views

Optimizing memory usage when running r.viewshed in GRASS

Short explanation: I am using r.viewshed as part of a script. The viewshed analysis is the most costly (time) part of the script and I'm trying to optimize how quickly it runs (I need to run the ...
user avatar
1 vote
0 answers
49 views

Errors Running Some Commands in GRASS Standalone Script

After much struggle I have managed to get a GRASS standalone script run outside of GRASS. I can successfully get an output from running some commands, while others give a very unclear and unhelpful ...
user avatar
0 votes
0 answers
18 views

PyGrass command problem

I have a code in grass with paython 2.x that to enter the name of a shapefile layer and store it in a variable uses the command layer.shapefile = raw_input ("enter the name of the layer"). ...
user avatar
2 votes
0 answers
51 views

GRASS GIS: r.out.gdal raises an exception and hangs if it's called multiple consecutive times

I'm using a small python routine (grass.script, pygrass) to handle several operations on sentinel2 imagery. I'm calling r.out.gdal inside the script and a very annoying problem occurs: when it is ...
user avatar
  • 85
0 votes
1 answer
38 views

PyGRASS r.mapcalc crashes with ERROR: Unable to make mapset element

I'm trying to load a GeoTIFF and then do some calculations on it with r.mapcalc the code is as follows: from grass.pygrass.modules.shortcuts import general as g from grass.pygrass.modules.shortcuts ...
user avatar
  • 185
0 votes
1 answer
78 views

Exporting a GeoTIFF with PyGRASS

I want to export a GeoTIFF with PyGRASS but i can't figure out how I can do that. my code so far: # import grass python libraries from grass.pygrass.modules.shortcuts import general as g from grass....
user avatar
  • 185
0 votes
1 answer
45 views

How to load data into R via PyGRASS?

I have a remote machine where my GRASS binaries (7.8) are available and I want to apply this solution https://gis.stackexchange.com/a/255899/36712 to my data set of thousands of small images. In most ...
user avatar
  • 185
2 votes
0 answers
71 views

Using Pygrass Functions in Jupyter gives XML Error

I have been trying to use pygrass from grass78 with Python 3.7 inside a Jupyter notebook and have run into an issue where I can import grass modules, but cannot call any pygrass functions, e.g, r....
user avatar
1 vote
0 answers
36 views

Can't create a vector map with VectorTopo in new mapset after switching

I need to create vector maps in different mapsets with pygrass. However, there seems to be a "hidden" global variable which prevents mapset in pygrass from changing. It sort of "memorizes" the mapset ...
user avatar
2 votes
1 answer
209 views

grass GIS + spyder python script error

I'm getting crazy with grass gis and python. I want to call a grass function from an external python script (using spyder for instance). I've installed QGIS + GRASS with the OSGeo4W64 installation ...
user avatar
  • 21
1 vote
1 answer
237 views

pyGRASS on MacOS: unable to import pygrass.raster

I am running GRASS 7.3 on Mac OS 10.11.5 El Capitan. I'm trying to figure out how to get GRASS GIS running via python scripting (pygrass). I'd like to be able to access raster data programatically. ...
user avatar
  • 486
1 vote
0 answers
87 views

Running Python script in GRASS every time map extent is altered

I am looking to develop a python script that triggers every time the user zooms or pans to a new map extent. The script I have in mind will clip a raster to the visible extent thus reclassifying the ...
user avatar
  • 81
1 vote
1 answer
1k views

GRASS python API [closed]

I have Ubuntu 16.04 64 bit and python 2.7.12 on my system. I have installed GRASS GIS 7 from the Ubuntu software support (I thing not is the better choose for install). Now I want to take GRASS ...
user avatar
  • 1,079
2 votes
1 answer
2k views

Exception using PyGRASS: "No module named 'core'"

I am trying PyGRASS on Ubuntu 14.04. I have GRASS 7 installed from the UbuntuGIS PPA: $ dpkg -l | grep grass ii grass 7.0.4-1~trusty1 ...
user avatar