New answers tagged

3

The problem was the parameter "allow only horizontal and vertical flow of water". I really don't know why this is set by default in QGIS/Processing!!! damn noob error!


1

From GRASS Manual: Categories to become no data are specified by setting the output category value to "NULL".


1

You are using parser() function to bring up a your GRASS module interface, but you are also setting up environment to run GRASS modules without starting GRASS explicitly. Although it is possible to use both, usually you do only one depending on what you want to achieve. In case you want to write a script which would run in GRASS environment as a module ...


0

Okay, when inspecting the source code I found out that GRASS 6.4.3's v.rast.stats grasps the output from r.univar with the bash command cut -d | -f. As r.univar itself is a compiled script already and all statistics are calculated anyway, there is few possibility to get the script faster as far as I see things. The only way is to reduce the number of ...


3

I had success by using g.remove -f type=vector pattern="temp*" It turns out, when intending to remove multiple files based on their names and making use of wildcards, one uses the pattern parameter and not the name.


1

From the doc, I don't think it's possible. However, if you are free to use QGIS, you could give a try to the LecoS plugin which allows you to choose the metric you want to compute (contrary to the native zonal statistics plugin).


1

Not exactly what I was looking for, but until now this the best solution for versions below prior to 7.1 that I was able to find. In the command line, during a GRASS session, one can type for instance, v. and then press the TAB key twice, then say yes when asked to display all possibilities. I will show all vector modules. GRASS 7.0.3 ...


4

There is a relatively new module g.search.module which lists modules based on keywords. Perhaps could be helpful for what you are trying to do. This module is so far in GRASS 7.1 only.


3

Here's a small python script. The DEM is from the GRASS lidar time series dataset (https://grass.osgeo.org/download/sample-data/). The contents of pts.txt referenced in the script (I assume this is like your sites point data) are: 913606.791589,250337.104673 913428.036449,249990.943925 Here's the points on the DEM: Here's the script that uses mapcalc to ...


1

I don't know of a command that lists the modules per se. But if I wanted to list the modules that were available to me, I would list what was in the bin folder, e.g. on Windows, dir %GISBASE%\bin\r.* I looked in the env.bat file, and bin appears to be the only folder that is added to the path and has GRASS modules in it. So it seems the result of listing ...


2

You could have a look at the RasterStats plugin. It can compute histograms for zones (I don't know in what format, though), which could help you finding how much of each class is located in each zone. There are other zonal statistics plugins (ZonalStats, Zonal statistics), but I don't think they can give accurate enough statistics for what you're trying to ...


1

I'm in a similar boat as you and this site has been more than helpful: http://www.ing.unitn.it/~grass/docs/tutorial_64_en/htdocs/esercitazione/network_analysis/index.html It goes through the various v.net tools in GRASS - I'm not a coder or anything, but I've become pretty familiar with GRASS over the past few months with the help of this site.


2

v.to.points creates a vector with 2 layers. With the second layer you should have unique ID. You should thus simply specify the second layer with v.db.select or write into a new feature with v.category. # return unique IDs v.db.select line_points layer=2 # change layer 2 to 1 v.category input=line_points output=line_points2 option=chlayer layer=2,1 ...


2

I tried out the r.drain algorithm in my QGIS (version 2.12, GRASS 6.4) with the raster dem and point (in blue) of below image. After running the r.drain grass module with successfully finish. I copied and pasted the complete r.drain command at the GRASS shell; with another name for the output raster. r.drain input=utah_demUTM2@javier output=out_raster ...


3

Steven Kays answer in pyqgis. Just select the lines in your layer before running the script. The script does not support the linemerging so it can not work on layer with multilinestring #!python # coding: utf-8 # https://gis.stackexchange.com/questions/173127/generating-equal-sized-polygons-along-line-with-pyqgis from qgis.core import QgsMapLayerRegistry, ...


1

GRASS GIS has made it very easy to calculate both spatial as well as temporal descriptive statistical summaries. To get the statistical summaries such as mean, median, standard deviation etc. for each raster layer saved within GRASS t.ras one can use t.rast.univar This function creates statistical summaries for each of the layer. By checking the advance ...


0

One solution would be to convert each of your polygons to rasters. Then take the portion of cell counts in each landcover class by the total cell count from the clip. Here is an example function: PortionClassInPoly <- function(MySingleShape, MainRaster) { # Start with one shape from your list # Rasterize this shape according to the ...


1

GRASS GIS addin r.sun.hourly can be used to calculate instantaneous solar radiation flux(w/m2) at an specified interval. By default it is set to run at an hourly instance however by changing the 'time_step' parameter can change the time instant for the run. For eg if you want the total irradiance every two minutes, this is how the parameters would look like. ...


1

I think I understand now. Let me know if this is not what you're looking for. >>> import subprocess >>> p = subprocess.Popen(['v.in.ascii', 'input=/home/username/Desktop/temp.txt', 'output=raster_pnts','x=1','y=2','fs=\',\'','--o'],stdout=subprocess.PIPE, stderr=subprocess.PIPE) >>> stdoutdata, stderrdata = p.communicate() ...


2

I agree with @just-GIS. You can use the slope or the aspect derivate (r.slope.aspect) from your terrain model to search for flat areas. Once you have identified them and you are OK with the results you can use r.to.vect to convert your raster map into a vector format.


4

Run the aspect tool r.slope.aspect. Try the < min_slope option set to a very low number. The unclassified areas are your flat area. Play with the setting to get it just how you like. You can then use r.reclass to reclass the aspects created so something like -1 and the gap areas as 1. Now multiply this my the original raster and all your areas are ...


6

r.local.relief is an addon and not a standard Grass command. It is a Python script (r.local.relief.py) using grass.script, however it is not installed by default. you need first to install the addon in GRASS GIS and after create a processing algorithm to use this new Grass command. The processing Python module use the Python subprocess module to execute ...


0

In QGIS: Try Vector->Geometry Tools->Singleparts to multipart (QGIS 2.8.3). In Unique ID field select 'xxxxx' elevation attribute of input shapefile. Result - multilinestring shapefile with unique 'elevation' attribute.


1

You need to use two tools in the "Vector / Geometry" menu: "Dissolve" the layer using the elevation field as the dissolve field. How well this works depends on how well the line endpoints match up at the tile boundaries. If the endpoints don't match well enough for the lines to dissolve together, then you can use the PostGIS-based fuzzy-matching ...



Top 50 recent answers are included