Questions tagged [grass]

GRASS GIS (Geographic Resources Analysis Support System) is a free, open source geographical information system (GIS) specialized in handling raster, topological vector, image processing, and graphic data. GRASS GIS is a high performance analytical GIS and remote sensing with focus on modularity. Users can process both day-to-day data as well as massive time series.

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

An example for Viewshed analysis in Python

My goal: Using a .TIF DEM, I would like to conduct a viewshed analysis. This is to be used as one feature for a larger program written in Python that will significantly improve work quality in my ...
user avatar
  • 11
0 votes
1 answer
27 views

How to set GRASS GIS environment variables in MacOS?

I'm trying to use grass.script and grass_session in a standalone python script on my MacOS device, but I always get error messages that tells me specific environment variables aren't set in the right ...
user avatar
1 vote
1 answer
22 views

v.out.ogr -c flag in GRASS GIS is filling islands

I have a very big shapefile (polygons) to load in GRASS GIS, thus I am selecting only relevant rows based on a .txt file with some conditions (e.g., the ID of the polygon). However, when I try to save ...
user avatar
3 votes
1 answer
32 views

GRASS GIS: Execute SQL query and save output

I'm trying to find a way in GRASS GIS to execute a complex SQL query (with JOINs) and save it. SELECT a.id, a.geom FROM schema01.table01 a JOIN schema01.table02 b ON a.geom && b.geom AND ...
user avatar
0 votes
1 answer
34 views

r.mapcalc - Python script in GRASS

I'm having trouble with a simple script in Python. I do not know where the error is. I use GRASS 8.0. import os import math import grass.script as grass elevation = 'dem_10_fill' elev_new = '...
user avatar
1 vote
1 answer
25 views

v.clean rmarea resulting in empty result

I got some issues with v.clean in QGIS. I try to get rid of small polygons in a vectoriced raster layer. The Layer got one column with integers with value 0 or 1. I use: { '-b' : True, '-c' : False, '...
user avatar
  • 109
0 votes
2 answers
16 views

GRASS: Installing add-ons and mkdir: cannot create directory ‘/usr/lib64/bin’: Permission denied

GRASS: Installing add-ons and getting mkdir: cannot create directory ‘/usr/lib64/bin’: Permission denied. Example: g.extension extension=r.in.pdal ...
user avatar
  • 205
0 votes
0 answers
11 views

GRASS: Modules tab has white background making text unvisible

GRASS: Modules tab has white background making text unvisible. Operating system: ID_LIKE="opensuse suse" VERSION_ID="20220303" PRETTY_NAME="openSUSE Tumbleweed" Any ...
user avatar
  • 205
1 vote
1 answer
27 views

Error importing vector contour layer into GRASS

In QGIS 3, I created points with ELEV value to make a topography. Then I created contour lines from those points, using the Contour plugin. The layer is of Line type. Then I am trying to generate a ...
user avatar
  • 165
1 vote
1 answer
23 views

i.vi writing null data to output raster on first attempt

I have the following lines of code in a bash script I wrote using osgeo's GRASS command line tools: i.vi viname=ndvi output=$ndvi_fn nir=$nir_fn red=$red_fn --overwrite while r.info $ndvi_fn -r | grep ...
user avatar
0 votes
1 answer
30 views

Cannot install GRASS GIS add-ons

I am very new to GRASS GIS. I am trying to install an add-on (r.bioclim) but I get "ERROR: 'svn' required. Please install 'svn' first". I cannot understand how to install it (or even what it ...
user avatar
0 votes
0 answers
19 views

How to use d.rast to display raster map in GRASS Map Display

I am running a python script in the simple editor in GRASS 7.87. I want to display the output='twi_patch' from r.patch in the GRASS GIS Map Display. I can do this manually by going into the Data tab ...
user avatar
  • 1,679
2 votes
1 answer
73 views

How to fix "No module named grass.script" error in Linux PyCharm?

I'm trying to use v.generalize in the GRASS GIS library within a python code in PyCharm on my Linux Ubuntu system to make a shapefile that originally was a raster look less "blocky" by ...
user avatar
0 votes
1 answer
44 views

Running GRASS r.watershed in Python returns SyntaxError: expression cannot contain assignment

I am trying to run r.watershed in my Python script using GRASS. I am trying to put in the appropriate parameters but I keep getting the error: SyntaxError: expression cannot contain assignment, ...
user avatar
  • 1,679
2 votes
0 answers
44 views

Why Betweenness Centrality in large networks have negative values?

I use GRASS GIS v.net.centrality to calculate betweenness centrality. As far as I know there should be values from 0 to (n-1)(n-2) in any given network with n nodes. However I got lots of negatives (...
user avatar
  • 71
1 vote
0 answers
89 views

Georeferencing automatically images [closed]

I was wondering if there exists a way to georeference automatically an image taken from a drone knowing approximately the position of the drone. In other words, a way to detect interesting points on ...
user avatar
0 votes
0 answers
33 views

Cannot load GRASS raster layer with a PyQGIS script

I wrote the following script and try to run it in QGIS Python console. I use it to load data from a GRASS repository. This script used to run fine with QGIS 3.16.4 and GRASS GIS 7.8.6dev But it doesn'...
user avatar
1 vote
0 answers
45 views

V.Generalize errors

I am using QGIS version 3.24.1-Tisler. I'm trying to simplify contour lines in a very flat area in Canada. The contour lines in this example are 5 meter lines and they are complex to look at, and when ...
user avatar
  • 45
0 votes
1 answer
38 views

Does GRASS's i.segment use all bands of data in a GeoTiff?

I'm trying to understand more about how the i.segment algorithm works. Most importantly, does it use all of the available bands in an image? The documentation notes you must specify a group. When I ...
user avatar
1 vote
0 answers
25 views

Is it possible to run grass v.generalize as part of a separate console (ie not inside QGIS)

As per the documentation : There is not a processing console in QGIS, but all processing commands are available instead from the QGIS built-in Python console. That means that you can incorporate ...
user avatar
3 votes
1 answer
50 views

Calculating region pair distances along network in QGIS 3.22.4

I'm currently attempting to calculate the distances between several thousand region pairs (centroids) along the Roman road network in QGIS. I want to achieve something similar to the "Shortest ...
user avatar
  • 51
2 votes
0 answers
58 views

How to resolve "ERROR: Unable to load GDAL library" when running r.watershed tool in QGIS?

I am trying to run r.watershed on a dem file and am getting the above error. I have QGIS 3.24.1 installed from OSGeo4W installer on Windows 11. I uninstalled a previous version and deleted ...
user avatar
3 votes
2 answers
86 views

Deleting overlaping vertex between line-features if not start/end vertex

I have a problem. I have a road-network dataset that has topological intersection where it's not supposed to be (see picture below). To solve this, what I want to do is to erase overlapping vertexes ...
user avatar
2 votes
0 answers
72 views

Network analysis in QGIS with nodes at start and end point

I have a dataset form a national agency with a topologically correct road-network. However, I have a problem when applying network analysis within QGIS to the dataset. I have tried both the native ...
user avatar
1 vote
1 answer
27 views

Issues with vectorisation of thinned flow accumulation through r.to.vect on QGIS

I'm trying to produce a shapefile river network from a flow accumulation raster using the r.to.vect function and I've overcome some difficulties regarding bit depth and thinned raster. n.b. I don't ...
user avatar
  • 197
1 vote
0 answers
26 views

Can't run Grass7 tools from python qgis

I'm trying to run GRASS's v.net.steiner in a python script, but I can't seem to call GRASS tools. from qgis.core import * qgs = QgsApplication([], False) qgs.initQgis() import processing from ...
user avatar
4 votes
1 answer
49 views

r.surf.area outputs are unclear (QGIS)

For different projects in my company the area was calculated using $area (and sometimes area($geometry) in the Field Calculator. I decided to change the surface area calculation to using the r.surf....
user avatar
  • 343
1 vote
1 answer
31 views

Can't access rasters from PERMANENT mapset from Python

I'm having trouble accessing files from my PERMANENT mapset in the Python code editor inside GRASS. I am able to access the raster I would like to set my projection to from the console, but for some ...
user avatar
1 vote
1 answer
83 views

Opening GRASS GIS 7.8.4 Results in Error

When trying to create a new location in GRASS GIS 7.8.4 on a machine running Windows 11 I get the following error: Traceback (most recent call last): File "C:\PROGRA~1\QGIS32~1.1\apps\grass\...
user avatar
  • 583
2 votes
1 answer
64 views

Unable to access GRASS data from QGIS

I can access GRASS tools in the processing toolbox in QGIS but cannot browse my GRASS data (which is what I primarily need). Thus, I cannot run any GRASS tools since GRASS data are not recognized. ...
user avatar
  • 23
1 vote
1 answer
29 views

How can I get one line only from river network extraction GRASS?

I have used the grass function r.watershed to get the river network by calculating the accumulation. However, as an output when I want to extract the river network by applying a filter on the ...
user avatar
  • 11
4 votes
2 answers
180 views

Workflow to remove gaps between polygons

In a polygon dataset, I have several thousands of features that have gaps mostly at the corner zones (see below). I'd like to remove them but I haven't yet found an appropriate workflow. I have ...
user avatar
  • 1,444
0 votes
0 answers
21 views

Using v.neighborhoodmatrix addon in GRASS

I am new to GRASS software. I successfully added v.neighborhoodmatrix addon in GRASS 8.0 manually, but I couldn't use it. https://grass.osgeo.org/grass-stable/manuals/addons/v.neighborhoodmatrix.html ...
user avatar
  • 1
1 vote
1 answer
36 views

Setting Region with Python Loop in GRASS GIS not Updating to include Extent of Multiple Rasters

I am using the Python simple editor in GRASS GIS to write a script that can import multiple raster files into GRASS GIS mapset. The first for loop successfully pulls in the orthophoto and its relevant ...
user avatar
2 votes
0 answers
74 views

Installing a GRASS addon in QGIS

I am trying to use the GRASS addon r.vector.ruggedness in QGIS, but it is not available. Then, I downloaded GRASS directly and there it is possible to download the addon that I want. Nevertheless, I ...
user avatar
1 vote
0 answers
38 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
1 answer
32 views

Is v.surf.mass not available anymore in the recent versions of GRASS GIS? If so, why?

I wanted to use the tool v.surf.mass, described here in the docs from GRASS GIS 7.0. However, this tool does not seem to be available on the newer versions (tried 7.6, 7.8 and 8.0). When I type v.surf....
user avatar
0 votes
1 answer
24 views

GRASS GIS 7.8.5 i.sentinel.mask Error

I am trying to run i.sentinel.mask in GRASS GIS 7.8.5 I am having the following Error: ERROR: Option <input_file> is mutually exclusive with all of <blue>, <green>, <red>, <...
user avatar
  • 529
1 vote
1 answer
255 views

Tools from grassplugin does not work in QGIS 3.22.2

I have a problem with the grassplugin in QGIS 3.22.2 Białowieża. When I try to use the v.net.alloc (and other grass-tools) from the Processing Toolbox in the standalone QGIS 3.22.2 I get this error: ...
user avatar
1 vote
0 answers
30 views

v.to.3D failing in QGIS

I'm trying to use v.to.3D in QGIS to create lines with proper elevation so I can export it to DXF. However, I'm running in to some issue when using v.to.3D. When googling I have seen others asking the ...
user avatar
  • 11
0 votes
0 answers
38 views

Iterate v.export on GRASS 7.8.5 through Python 3 using a list and SQL

I would like to iterate an analysis on a vector for each unique value present on his attribute table. The first step is to extract different vector according to the unique identifier, but the SQL ...
user avatar
0 votes
1 answer
334 views

Method to resample 2d numpy array to a coarser grid and weighted by pixel area in python (analogy to grass r.resmap.stats -w)

What is the optimal method in Python, when I need to resample 2d numpy array (grid) to coarser resolution (weighted by pixel area, the case when the new resolution is not the exact multiple of the ...
user avatar
  • 989
1 vote
2 answers
47 views

Which quantile calculation method(s) does GRASS-GIS use?

Per Wikipedia , there are 9 common methods of calculating quantiles in common use across various statistical software packages, as well as languages like R and Python. Various other custom ...
user avatar
  • 3,430
0 votes
1 answer
84 views

GRASS function r.fill.dir not working on specific DEMs

I'm using QGIS. The function r.fill.dir is not working on a few DEMs I'm working with. With other DEMs, it works. I attached the log report and one of the troublesome DEMs. You can see my QGIS ...
user avatar
0 votes
1 answer
49 views

Correct measure unity for slope and aspect in order to work in QGIS with "r.sun.insoltime"

I'm using QGIS 3.10 and I should create a raster that shows the hours of sunlight referring to a given day for my province. r.sun.insoltime (Fig. 1, sorry it's in Italian but I traslate) to work asks ...
user avatar
  • 23
3 votes
1 answer
119 views

Extracting peaks and cols from a DTM raster and convert them into point shapefiles (QGIS)

I’m trying (again) to find an automatic way to extract peaks and cols from a DTM raster (derived from LiDAR surveys). By “peak” I mean simply the cell with the highest value of a neighbour of cells; ...
user avatar
  • 197
1 vote
1 answer
56 views

Cannot connect to PostGIS database with GRASS, but can connect with psql with the same credentials

I am trying to connect to a PostGIS database (hosted in a docker container) on a remote server with GRASS. I am able to connect with psql and confirm that the table is there (IP redacted): psql -h x.x....
user avatar
  • 3,278
5 votes
2 answers
146 views

Running the GRASS algorithm in standalone Python code using the PyQGIS processing module

What is the right way to import GRASS algorithms for a standalone Python script? I tried the solutions (solution1, solution2), but they didn't help me. Here's the code that doesn't import GRASS ...
user avatar
  • 5,682
0 votes
0 answers
50 views

QGIS GRASS decoding error

As many others, as I found out, I to have a problem with GRASS possibly due to location (Czech Republic, Middle Europe). This is what I get: QGIS version: 3.20.3-Odense QGIS code revision: 495fbaec Qt ...
user avatar
0 votes
1 answer
38 views

Finding GRASSBIN on Linux

I am installing GRASS on linux. I have managed to download source code and compile and can now run grass from the command line to open GRASS and start a session. I am trying to run python scripts ...
user avatar

1
2 3 4 5
43