First you need to project your geographic coordinates to a cartesian 2D coordinate system, since affine transformations don't apply to geographic coordinate systems.
You can apply an affine transformation from control points or from transformation parameters. The QGIS plugin asks you transformation parameters, but it is much more common for a user to have ...
It can be done in one step in QGIS in the raster calculator.
In QGIS3, for a raster layer named "x", use the following expression:
(("x">0)*"x") / (("x">0)*1 + ("x"<=0)*0)
This trick maps raster values x>0 into the ratio x/1 = x, and raster values x<=0 into the ratio 0/0 = NaN. This NaN is rendered as FLOAT_MIN (aka -3.402832...e+38) if the ...
Interesting question! It's something I've wanted to try myself, so gave it a go.
You can do this in PostGRES/POSTGIS with a function which generates a set of polygons.
In my case, I have a table with one feature (a MULTILINESTRING) which represents a railway line. It needs to use a CRS in meters, I'm using osgb (27700). I've done 4km x 2km 'pages'.
GRASS is usually used for scientific purposes. So unless you want to do some sophisticated spatial analysis or routine, just stick with QGIS. Also GRASS works with its own formats so you will have to import/export data to exchange data with someone. Even if you will need sophisticated spatial analysis or routine at some point you will be able to do it with ...
According to Diego Alonso's comments from the mappingGIS blog1, this error is related to QGIS version 2.14. With the upgrade, the standalone installer eliminated the msys folder from GRASS 7 algorithms.
To bypass this error, go to Processing -> Options -> Provider and deactivate all GRASS folders from previous versions. Set these paths as blanks. Then, ...
In QGIS Raster Calculator, the comparison return 0 (if false) or 1 (if true). So you can write a conditional using a sum of products.
((raster1@1 >0.3) * raster1@1 * raster2@1 ) + ((raster1@1 <=0.3) * raster1@1 * raster3@1 )
They have a major difference on how they deal with vectors and this is very important:
GRASS has full/real topology support, that means that a single boundary can share several areas .
QGIS is primarily non-topological or "spaghetti" , adjacent area boundaries are duplicated.
And they relate in the way that Qgis can display and edit GRASS vectors through ...
My solution, based on the one from @wwnick reads the raster dimensions from the file itself, and covers the whole image by making the edge tiles smaller if needed:
import os, sys
from osgeo import gdal
dset = gdal.Open(sys.argv)
width = dset.RasterXSize
height = dset.RasterYSize
print width, 'x', height
tilesize = 5000
for i in range(0, width, ...
There is no direct route to convert an image into a shapefile format. Your jpg map has no spatial reference. You can load it into arcmap but it won't know where to put it. In order to tell arcmap where it belongs in space you have to provide geographic reference points, hence the term 'georeferencing'.
In ArcGIS this is done via the Georeferencing ...
Sure, have for instance a look at the r.neighbors tool available through the processing-toolbox with GRASS support enabled.
It has a similar functionality as the Focal Statistics tool.
I will also soon add a generic filter function to my QGIS plugin LecoS (needs installed Scipy), which can do the same stuff, but uses python+scipy as backbone.
Here is a quick worked example of setting the GRASS environment, reading an on-disk raster, calculating a focal mean (using r.neighbors) and reading the results back into R. Hopefully this will get you started.
if (!require(rgrass7)) stop("rgrass7 PACKAGE MISSING")
setwd("D:/TMP") # Working directory
# Set on-disk raster variable
rname <- paste(getwd(...
With PyQGIS in the Python console, see How to add Direction and Distance to attribute table? for the azimuths of the segments of a line (with the azimuth functions of Points: point1.azimuth(point2))
but you can use many other Python modules like Shapely and Fiona without using QGIS see Python: traitement des couches vectorielles dans une perspective ...
The answer will depend on the requirements of your specific workflow and application but I can offer you advise on how a drainage network is generally extracted from a digital elevation model (DEM). The key to extracting a drainage network from a DEM is creating a flow accumulation raster, i.e. a raster for which each grid cell contains a value that is ...
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
# coding: utf-8
from qgis.core import QgsMapLayerRegistry, ...
yes, r.reclass is for reclassing thematic rasters, like the Corine Land Cover. It will work for your data, but the routine will cast the float numbers to integers before doing the reclass, so it might lead to unexpected results.
What you are looking for is r.recode
The rules are defined in many formats, one of those is the following:
The idea is to merge all your shapefiles containing linestrings. You have to handle with unique identifiers that are characterizing your linestrings definitely, according to the distinct shapefiles.
Add the unique IDs to the attribute table of each shapefile if required: Open the attribute table, toggle editing and add a new column. Fill the ...
There is differents solutions. And this can work with simple polyline and multiple selected entities
select orientation for generation and read index (left-to-right, north-to-south...)
set object size
shape = (4000,8000) # (<width>,<length>)
define superposition coef (10% by default ?)
Ordering polyline (...
Tom Patterson, the lead cartographer at the U.S. National Parks Service has some excellent tutorials on working with DEM data to make beautiful shaded reliefs. Part of his workflow involves using Natural Scene Designer and Adobe Photoshop.
For my own workflow I like to use GDAL to resample the size of the DEM before rendering a shaded relief. This often ...
I hesitate to mention this because markusN's answer is so good. But if you don't get on with GRASS and if your DEM is not too large you could try the following.
Firstly, note the coordinates for the pixels that you wish to edit. Then explode the DEM to xyz triplets using gdal2xyz:
gdal2xyz.py input_dem.tif output.csv
'output.csv' will be a space delimited ...
You could start by getting the difference of the two DEMs. QGIS has a raster calculator tool that should come in handy. Just get tiles of both DEMs that cover the same area and subtract the values of one DEM from the other. That should get you a nice raster layer that shows the differences in elevation between the two DEMs.
I had to do this just recently. Using ArcGIS 10:
If you only want to symbolise the dead ends you can just set up a Topology on the roads featureclass and set the rule "Must not have dangles". this will put a marker on every feature that has a dead end.
Alternatively, run the "Feature Vertices to Points" Tool (Located in Data Management Tools --> Features) ...
A general way of solving this problem is to find all polylines having a node whose valence = 1.
A valence table may be created either in memory or on disk, using a key that is the hash of the x&y of each end point of each polyline. You may wish to truncate x and y may be truncated if polylines are not snapped.
Each node is labeled by its degree (or ...
What is not mentioned, yet:
QGIS and GRASS GIS - both can be run as a completely separate software
However, GRASS GIS algorithms are included in QGIS processing toolbox (can be excluded or included during the installation of QGIS software). Thus, GRASS algorithms (similarly as GDAL, SAGA, R scripts, or other activated providers) can be used directly from ...