Hot answers tagged

13

I'm not sure how to enforce it for existing polygons, but you could make it work for any future ones that you create. In Project Properties>Default styles>Style Manager, you could create your own default symbol style for "Fill": Edit the Border color's expression and set it to @symbol_color: Lastly, set your new fill style as the default: This will ...


9

If 'Scaleable Vector Graphics' (.SVG) symbol is also an option, then yes you can use it for labeling objects (polygon in your case). Right click on the layer and navigate to Properties > Labels > Background. From the Shape dropdown select SVG and browse for the appropriate symbol as shown in the screen shot. As a result it will draw graphic symbols in the ...


8

The Topology Checker plugin has an option to check if a layer contains multipart geometries. It is also possible to highlight multipart geometries.


7

First install QGIS plugin "Affine Transformation" from Plugins > Manage and Install Plugins.. Then start editing and navigate to vector > Geoprocessing Tools > Affine Transformation. Add your latitude value in 'y+' as encircled in the screen shot.


6

Short and sweet: Right-click on the layer in the Layers Panel and select Change vector datasource. In the dialog box that appears, just hit OK without changing any of the settings. Basically, you are "changing" the vector datasource to what it already was, but this forces QGIS to reload the layer definition. Tested in QGIS 2.14 on Linux Mint 17.2.


6

Hopefully the following image will help a little: Essentially, you can move a rule 'inside' another by dragging it across. This creates a nested style. In the image, I dragged the last 2 rules (blue and yellow) inside the green rule. Now if you add a filter (expression) to the green rule and if it applies to any feature, the features will not only turn ...


6

You need to set the "show label" expression (under Rendering) to "name" is not null and the label to "name".


5

Not tested but perhaps use something like this in the Python Console: layer = qgis.utils.iface.activeLayer() geom = QgsGeometry() if layer.wkbType() == QGis.WKBMultiPolygon: for feature in layer.getFeatures(): if geom.isMultipart(): print feature.id()


5

You can use something like the following: layer = qgis.utils.iface.activeLayer() provider = layer.dataProvider() ext = layer.extent() stats = provider.bandStatistics(1,QgsRasterBandStats.All,ext,0) print "minimum value = ", stats.minimumValue print "maximum value = ", stats.maximumValue print "mean = ", stats.mean print "stdDev = ", stats.stdDev Here ...


5

It looks like there actually is Xenial support in the debian repository and although I haven't tried the following solution myself I guess it is worth a try. Before trying the following I would uninstall all previous qgis packages using sudo apt-get remove qgis python-qgis qgis-plugin-grass and remove deb http://qgis.org/debian wily main and deb-src ...


4

This feature is currently being evaluated to be integrated with QGIS 2.16 (and has good chances that it will be) will be part of QGIS with the 2.16 release and present on master builds from after Apr, 29 2016. For a solution compatible with 2.14 see below. Or if you want to use QGIS 2.14, use a Geometry Generator symbol layer. CASE WHEN ...


4

You could to use an expression for labeling. You not must to label the "Street" Field directly: exemple: wordwrap("Street", 14)


3

Try: "SPECIES" IS NOT NULL AND "SPECIES" != 'Corvus corax' AND instead of the OR


3

You can add Google Aerial basemap to you QGIS canvas using Google TMS. Save the following as .xml file and load it as a raster in QGIS <GDAL_WMS> <!-- Data is subject to term of use detailed at http://code.google.com/intl/nl/apis/maps/terms.html and http://www.google.com/intl/en_ALL/help/terms_maps.html --> <Service name="TMS"> ...


3

There's currently no out-of-the-box functionality for this in Print Composer. As a work-around, you can add graticules as a separate layer and label their end points, like here: (Example uses data from http://www.quantarctica.org/)


3

Your dataset needs some kind of feature ID, like in this example: Then you can use a rule using the modulo operator % to fhe features, e.g. every 10th feature only: <theID> % 10 = 0 This is the corresponding rule-based renderer. You can add scales to the rules as well.


3

You can do this via the python interface. Start the Python Console from the plugin menu. As an example, this code will set all 10 fields of the first layer to "Hidden": # get map canvas object mc = iface.mapCanvas() # get the first layer (layer 0) l = mc.layers()[0] # get the edit form configuration f = l.editFormConfig() # loop over 0 to 9, and set ...


3

Not sure if this will help in your situation but you can try using the following expression for the Wrap on character option which checks the length of characters: CASE WHEN length("Street") > 15 THEN ' ' END This checks that if the total number of characters for a feature in the field "Street" is over 15, the wrap character becomes a space. So: ...


3

Some vector formats are read-only in QGIS. So, first check if your Cropped layer is read-only: Cropped.isReadOnly() If not, then you could use this code snippet to delete all features whose Name attribute value is already in the roads list (note the handy function to delete all those features in a single step): features = Cropped.getFeatures() ids = [ ...


3

If you are unsure which distributions are supported, enter the url after deb into your browser, and navigate to the dists folder. Then you see that http://qgis.org/debian/dists/is up to xenial, while http://qgis.org/ubuntugis/dists/only supports precise and trusty. Other sources are the ubuntugis stable ppa, which currently has only QGIS 2.8.3 for trusty, ...


2

I had to solve this issue for a client running QGIS on Windows tablets 8-10. The best solution I found so far is GpsGate Splitter Express. If you install it with the plugin, it makes it possible to read the GPS data from the location provider and send it to a virtual COM port. The program runs at startup, so UEFI secure boot has to be disabled for this to ...


2

In my opinion, a much easier way to use an "in house" plugin is to place a copy in the following directory: C:\OSGeo4W\apps\qgis\python\plugins Also within this directory you will see other plugins that are installed as core plugins that come with the OSGEO4W download of QGIS. After placing a copy of your custom plugin into this directory, be sure to go ...


2

I have done a similar stuff, mine does work. Check it out. It is for 2.14 qgis. If you are locked you should probably check http://docs.qgis.org/2.2/en/docs/pyqgis_developer_cookbook/raster.html (see the version number on the link) from PyQt4.QtCore import QSize from PyQt4.QtGui import QPainter, QImage, QColor from PyQt4.QtCore import QFileInfo from ...


2

I got it to work on my GNU/Linux machine by replacing this code block from your script: QgsApplication.setPrefixPath('/usr', True) QgsApplication.initQgis() by this one: qgisApp = QgsApplication([], True) QgsApplication.setPrefixPath('/usr', True) QgsApplication.initQgis() The first line of this code block initializes the QgsApplication class, making ...


2

I'm still confident that the issue is the file path in attribute 'icon' (seeing as this method has worked on a data-set my end). Could you post an example string from this attribute so we can see if it should work? If this is the issue, or if you are having trouble editing this attribute, as you say above, I would recommend re-creating the attribute using ...


2

I would use the Count Points in Polygons tool in the Processing Toolbox -> QGIS Geoalgorithms -> Vector Analysis Tools. The result is your layer "province" but with an additional field which lists the number of hotels. Note that this tool counts points, so you'd have to convert your hotel polygonal layer into a point layer using Polygon Centroids or some ...


2

Sorry for the long time to answer, I was on vacation. I am using the QGis 2.14 in portuguese, but i'll try to show you the steps with pics bellow. 1- click in save as 2- On the "save window" choose the option "inclui dimensao-z" in english is equal to "include Z data" i think.


2

A similar idea to Underdark's, but doesn't require a unique field Adding a unique id is easy with attribute editor and $rownumber, but it can be slow if you're using shapefiles and have lots of points. Use Rule Based Rendering, and have two rules randf(0.0,1.0)>.9 [default rule] Unselect the default rule so it doesn't appear, and symbolise the first ...


2

Other way, if no field suitable for modulo filter, is create a cluster layer. There is a plugin: https://plugins.qgis.org/plugins/QgisMarkerCluster/ Then use Scale Dependent Rendering...


2

You can use the QuickMap Services plugin to get aerial background maps in QGIS. You have to activate additional sources with Web -> QuickMapServices -> Settings, More services, Get contributed pack. BTW the Openlayers plugin still works for me in QGIS 2.14. You might need to update the plugin to version 1.3.6. Apart from the plugin, many surveying ...



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