Tag Info

Hot answers tagged

12

You could use PyQGIS for that (not sure is the best solution for it, though). Select (or activate) the layer in the QGIS ToC, open the QGIS Python console, and copy this code snippet: prefix = "'" layer = iface.activeLayer() attr = layer.rendererV2().classAttribute() attrColor = 'color' # Name of the field to store colors fieldIndex = ...


9

Using advanced install of the OSGEO4W installer, you can choose the package qgis-ltr. This will bring you the long term release qgis 2.8.x. QGIS 2.10.1 and ltr can be installed together (same as QGIS and qgis-dev can). Double-clicking on a project file will open it with only one of them. You can change the version with doubleclicking on ...


3

This is how you can use raster calculator to find "safe area" (note: basic analysis) using ArcGIS 10.2. Load your DEM into ArcGIS Desktop [] Open Raster Calculator and enter the conditions that you want to find. In the example below, I want to find areas of elevation from the DEM that are equal to or greater than 186m (186 is the level that my flood ...


3

I've finally solved this for my purposes so here's the solution I came up with if it helps anyone: Write a python script which essentially does this: identify the unique categories in the point layer field of interest for each category, select all matching points and establish the extent of this set for each extent generate a new polygon in a blank ...


3

Before I get to how to in QGIS I feel I should mention that from table browser in QGIS you can select and copy the whole table and paste into your favorite spreadsheet software and calculate sums (or other) there. If you really want to do it in QGIS, the best way is to use SQL query for this. Meaning you need to work in some database (don't panic, it is ...


3

According to this QGIS Change Log entry for the latest 2.10 "Pisa" release of QGIS, support for true curve features, including circles, was only just added in this latest release. See the "New geometry engine" topic. It requires a datasource like PostGIS that supports true curved geometry types. However, the documentation there is slightly ambiguous. It ...


3

Why not data define the image path? Next to the image filename is a button which allows you to link the path to an attribute in your data (or set via an expression).


3

You can use function editor tab in the field calculator and make your azimuth function like this: from qgis.core import * from qgis.gui import * @qgsfunction(args="auto", group='Custom') def azimuth(x1,y1,x2,y2,feature,parent): p1 = QgsPoint(x1,y1) p2 = QgsPoint(x2,y2) a = p1.azimuth(p2) if a < 0: a += 360 return a Once ...


3

Processing provides example code for a new algorithm provider. It's located in the processing folder inside your home directory, e.g. on my machine: C:\Users\anita\.qgis2\python\plugins\processing\algs\exampleprovider Based on these example files, you can build your own plugin which can contain as many new algorithms as you want.


3

You could use the raster Calculator something like (raster1>raster2>raster3)*1 OR (raster1>raster3>raster2)*1 OR (raster2>raster3>raster1)*2 OR (raster2>raster1>raster3)*2 OR (raster3>raster2>raster1)*3 OR (raster3>raster1>raster2)*3


2

Following on from what you wrote and the links in the comments sections, I got a more refined hatched boundary (only within the polygons). I used the "Difference Tool" (Vector/Geoprocessing Tools/Difference) and used the following settings to clip the buffer to the extent that I wanted: I used a -20m value for the buffer, but if you wanted longer ...


2

Take a look at the plug in CADDigitize. It may be helpful. edit : This tool allows the user to draw circles, squares, resctangels, ellipses from many ways.


2

To simply state your problem, you have one set of points with a value but those points/values apply to both ends of a line; you want to add two different point values as separate attributes to one line. There are (at least) two ways to do this. The first is to extract the start and end nodes of all your lines as points. Since you have an Advanced license, ...


2

If you view the layer in QGIS with On-the-fly-reprojectionenabled (which is default if the loaded layers have different CRS). you will not see any difference. That is the deeper sense of reprojecting: The object stays on the same spot on Earth, but the coordinates change. If you turn off otf, you will see the layers on different places after zooming to the ...


2

Reason When you create a symbol it has ownership of its layers. When you add a layer to an existing symbol, it takes ownership of the added layer. Ownership means it is free to delete it whenever it wants. In your example both symbols assume ownership of symbol_layer2 (symbol2 because it created symbol_layer2, symbol1 because symbol_layer2 was added to ...


2

You should also change the CRS of the project by clicking the grey planet on the bottom right:


2

You can do this with two UPDATE statements, one for the distance, and the second for the line ID, with a subquery to get the values from the line table. And use the ORDER BY ST_Distance(...) LIMIT 1 construct to get only the closest line. I have a cities point layer, and a hiways line layer. Each has a primary key column 'pk'. I added to the cities two ...


2

QGIS updated to the SIP API V2 between 1.8 and 2.0. See: https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20#Replace-QStringList-with-list It will transparently convert some types (like QString or QList) between python and Qt types. So you can just use a python list of str or unicode objects and pass it to the pyqgis and pyqt API wherever ...


2

I have never worked in QGIS. The R equivalent would be to use gUnion in the rgeos package: http://www.inside-r.org/packages/cran/rgeos/docs/gUnion Here is a reproducible example to demonstrate: library(sp) library(rgeos) #create polygon r1 <- cbind(c(641777, 642290, 642276, 641794), c(7036885, 7036743, 7036154, 7036146)) r2 <- cbind(c(642320, ...


2

The EPSG: 3857, WGS 84 / Pseudo Mercator in QGIS is called WGS84 Web Mercator (Auxiliary Sphere) in ArcGIS. You are simply not using the right projection.


1

There is a very straightforward way to load GIS data directly into Blender with this plugin by Domlysz. The wiki shows how to install and use it. I've had the best success using projected datasets rather than lat/lon, only as I find it easier to match metres to Blender units when manipulating the data in 3D. Blender should also ignore the separate channels ...


1

Clip the image to the size of the DEM then export the terrain only to Blender then apply the clipped image as a texture in Blender?


1

There are a couple of ways to make your contours smoother. Looking at the contours, I suspect it's because the IDW raster is low resolution. Did you use the default size (300x300) when creating this? Resize your IDW raster Probably the easiest way :- take your existing IDW raster and make it bigger with gdal warp (Raster > Projections > Warp). ...


1

You were nearly there when you said clip a raster by a polygon. Essentially they're the same operation: you can clip your raster to the polygon and then mask the result to the values you require. This masked raster can then either be converted into a polygon or kept as a raster. Note, it may be easier if you convert your polygon to a raster first.


1

The coordinates must be in the same crs as the layer the diagrams are attached to. Could this be your issue?


1

You create a memory layer without any fields. To set some attributes you need corresponding fields. When creating memory layers you can give field definitions as part of the argument type: self.layer = QgsVectorLayer(self.type+'?field_a:string(20)&field_b:int', self.name, "memory") For your layer to work you have to define the same fields as for the ...


1

I solved this problem via SAGA's Remove Duplicated Points.


1

The best way to find out which layer is correct, is to set the project CRS to EPSG:3857 with on-the-fly-reprojection enabled, then load a Google or Openstreetmap background via the OpenLayers plugin, then add your layers and check their layer CRS. Then you see which layer ist placed on the right spot, and which might have a wrong CRS. BTW this page ...


1

Could you use the Easy Custom Label plugin and and draw an empty label with an SVG background for this? So; Give the difficult features their own layer. Install the plugin and create an easy label layer with it Make the label blank i.e. ' ' On background choose draw background , choose SVG and the appropriate SVG symbol (Note: I had to change the ...


1

Following on Vince's comment: you can remap your species to IDs that are powers of 2, as below, represented as integers and binary. Species 1 --> 1 --> 00000001 Species 2 --> 2 --> 00000010 Species 3 --> 4 --> 00000100 You can see that each species is identified by a 1 in a unique slot in the bit sequence. So for each species, you'd have ...



Only top voted, non community-wiki answers of a minimum length are eligible