New answers tagged

0

As @markusN and @BERA comented, I lacked the import part which I did not using v.import if not writeVECT like this: library(rgrass7) # PARAMETERS lpath <- "./Layers/Lines_light/Lines.shp" l <- readOGR(lpath) G <- initGRASS(gisBase = "/usr/lib/grass76", home = getwd(), gisDbase = getwd(), location = '...


0

(written upon the discussion above) You may want to use v.what.vect which uploads vector values at positions of vector points to the table. Importantly, run v.db.addcolumn beforehand to have a column in the attribute table which can be populated with the results.


1

Why not just run the tool again, but this time put the table as your first layer, and the joined results as the second layer? Then you'll get the table records that are not present in the joined layer. You can skip output under 'Joined layer' in the toolbox options, and generate a temporary or saved layer for the unjoinable features. You could save it as ...


1

First, please upgrade your GRASS. You are working with a 10 year old version! Second "equidistant cylindrical" is a projection method, not a specific coordinate reference system. The EPSG code 1029 seems to be a simple cartesian reference system - not what you want. The World Equidistant Cylindrical CRS is referred to as 54002: see epsg.io website Next, ...


1

You skipped the crucial stage of setting the computational region. Always precede every raster operation with g.region... Here's my result: # Import raster micha@tp480:Downloads$ r.import rasterData.tif output=r Importing raster map <r>... 100% # Always begin by setting region micha@tp480:Downloads$ g.region -ap rast=r projection: 99 (...


0

Go to C:\Program Files\QGIS 3.12\apps\grass\grass78\ and copy the "bin" folder directly into C:\Program Files\QGIS 3.12\bin\. Now the GRASS modules are in the specified path C:\Program Files\QGIS 3.12\bin\bin. Done


0

You can do this with r.patch, or using isnull() in r.mapcalc.simple, or using &&& or ||| operators.


0

r.watershed has a flow input and an accumulation output. Pass in the manning raster for flow and the accumulation will be the "cumulative ... Manning's n values over which the water has traveled" that you seek. You can run it a second time with no flow input, and then accumulation is the number of cells. You can use that to get the average n value.


2

Since the release of QGIS 3.12 you can do raster value fuzzification (Fuzzy Membership in ArcGIS terms) with the newly added Fuzzify raster algorithms in the processing toolbox. Up to date there are the following functions available: Linear Membership Power Membership Fuzzy-Small Membership Fuzzy-Large Membership Fuzzy-Near Membership Gaussian Membership ...


0

Did you import the respective GRASS GIS Python scripting API? Using the "North Carolina sample dataset", it works like this: >>> import grass.script as grass >>> grass.run_command("r.random", overwrite=True, input="basin_50K",npoints=15, raster="randomsample", vector="randomsample") Collecting Stats... 100% WARNING: Vector map <...


0

I experienced the same issue after countless uses in a script. Suddenly the script started returning errors. a missing use_sp() was the point. I guess I lately installed sf and that drove to a non default adoption of the driver.


0

GRASS extensions should be manually downloaded and installed on MS Windows. Download r.clip from here: https://wingrass.fsv.cvut.cz/grass76/x86_64/addons/grass-7.6.1/ (since you have 7.6). Unzip the files in YOUR_USER\AppData\Roaming\GRASS7\addons Now r.clip should work.


1

I have been strugling with this grass tools to create this R package that builds Steiner Trees. I had that same error and It was because topology errors or little gaps between lines. Sometimes, they seems to be all within the network, but sometimes they are not attached. If a node is within one of these, the v.net.steiner crush. You can solved using a ...


1

I foun it that, if you try to execute v.net.steiner within R, it will crush when you have some nodes connected to unconnected lines. Sometims, there are topology error and some others there are just lines not attached to the main network. In this package, there is a function that uses grass tools to clean lines before using these in v.net.steiner --> https:...


1

Here I made an R package that could handle this problem. This tool uses that v.net.steiner algorithm, but uses it iteratively in order to get just the lines of the network that are relevant. Alfter iterate over n samples of your terminals, it calculates a new optimal Steiner Tree for the whole network. So in resume, you will save ram because: - You don't ...


0

For this question in my experience, Toolbox in ArcGIS can solve this problem. You can use the Merge Divided Roads tool under the Generalization tool in Toolbox. In details: Firstly, open the attribute table of your map in ArcGIS, add a field named it as add and then use field calculator to let add=1 Secondly, use the Merge Divided Roads tool under the ...


0

I'm not completely sure but i think the string of your output is the path for the vector output. Print it and check it. If so, you can 'cast' that output into a QgsVectorLayer. The run method returns a dictionary with one or more output names (the ones shown in the algorithm description) as keys and the file paths of those outputs as values qgis.doc ...


1

If each band of the multiband raster exists as independent files in your hardrive then you can list those files names. Example as list: input = ['C:/Users/Eloisa/band1.tif', 'C:/Users/Eloisa/band2.tif', 'C:/Users/Eloisa/band3.tif'] If you only have the multiband raster then you can extract each single band using GDAL. Assuming your image is a TIFF: from ...


1

Sorry, my orginal answer seems to have some problems as it happens to show a workaround (for the values I unintentionally used), but does not really adress the main problem. So what happened in your case is connected to be a problem described in the Grass manual Simplification can fail for many boundaries if the simplification parameters would result in ...


0

It seems that you need to set the required GRASS GIS related environmental variables (the OSGeo4W shell would do that for you) for your use case. Find them here:https://github.com/OSGeo/grass/blob/master/mswindows/env.bat Note that %GISBASE% needs to point to your local installation path.


0

Following Bogusław Ciastek's solution, I made a copy of the Start Menu shortcut, open its properties and changed its destination by substituing --gui with --gtext. Now I have 2 shortcuts: one starts Grass with GUI, the other one without it! Moreover, I added my C:\Program Files\QGIS 3.10\bin folder to the path env variable, now I can call grass78 (in my ...


0

I can load the .JP2 DEM into GRASS ... , but it comes in as a 3-layer raster map with color naming being the only difference (R/G/B) You do not have a DEM (elevation data), but RGB bands. This means it is impossible to extract contours from that image. The 'unusable contours' are consequence from interpolating color data (instead of elevation).


1

After verification of your TIFF/TIF input I would suggest reprojecting it to a different CRS, more common for Ukrainian territory EPSG:5561, a.k.a. UCS-2000 / USK-2000. And afterwards set up the project-CRS exactly to the same CRS as your TIFF/TIF-file. As well I would double check if your path to the input/output folder have any special characters or empy ...


Top 50 recent answers are included