Tag Info

Hot answers tagged

4

You can databind the label Placement Quadrant with this expression structure: CASE WHEN azimuth < 23 OR azimuth > 338 THEN 1 WHEN azimuth > 24 AND azimuth < 69 THEN 2 ELSE 3 END You may also need an expression calculating a more appropriate offset depending on the azimuth. Update: The offset can databind to an ...


3

So far the only way that works for me for polylines is split them two times around a place I want label in - into 3 parts - and set only middle part with visible label. For polygons and points I am using EasyCustomLabeling ( http://plugins.qgis.org/plugins/EasyCustomLabeling/ ) which works great, creates memory layer which also can be saved as shapefile ...


3

The easiest way to do this probably is to create multiple label classes. Add two classes with the SQL query specified and then have different label expressions for those.


2

I am rather new to QGIS as well so there may be a much better way to accomplish map tip suppression for individual layers: Just made a quick test with v2.8.2 on Windows. From the "Display" page of the layer properties, setting the Map Tip to display to be a field filled with NULL values results in no map tip for that layer. I also found if the map tip ...


2

If you are using PostGIS for your spatial data, this post https://sigsemgrilhetas.wordpress.com/2015/01/12/etiquetas-com-guias-em-qgis-e-postgis-labels-leading-lines-with-qgis-and-postgis/ by Alexandre Neto explains how leading lines can be added to the points in your database. Its a well written tutorial worth reading, it also has a movie in the post that ...


2

You could try downloading and installing the EasyCustomLabeling plugin from Plugins > Manage and Install Plugins, this creates a duplicated memory layer of your selected vector layer and contains the same attributes. (Note that you will also need to download and install the Memory Layer Saver plugin to save the memory layer correctly, this is described in ...


2

No, but you can extract the vertices to a new point layer, make the point layer transparent and label the points. Menu: Vector > Geometry Tools > Extract Nodes...


2

You can use the field calculator to update the column removing unwanted chars: replace( "mycolumn", '#F','') You can also use this directly in an label expression, if you do not want to delete the char from the record. You have a long list of string function for you convenience.


2

I believe there is a bug affecting the display of labels when data is reprojected. I bumped into it a couple of days ago also. See: https://hub.qgis.org/issues/12025 Note: it looks like may have been fixed yesterday... impressive!


2

On the Reference System Properties dialog go to Labels tab -> Label Oriantation (bottom of dialog)


2

This works for me and I have labeling only with 2nd word: So maybe you have few atributres without " ", and you get "out of index". def label([SSA_NAME]): x = [SSA_NAME] x1 = x.split(" ") if len(x1)>1: return x1[0] + " " + x1[1] else: return x1[0]


1

Since I was not able to realize the rotation I did the following to achieve a comparable solution: I just switched the line direction (How can I switch line direction in QGIS?). This rotated the labels by 180°.


1

For QGIS 2.8.2, it works fine. You can turn the labels upside-down: To rotate labels by 180 degrees (or turn them upside-down), from the Rendering tab you can enable the option the Show upside-down labels option which would automatically rotate the labels. You don't need to define a value for 180 degrees: Then that should do it. Remember that 6 and 9 ...


1

As far as I remember, the rotation can only take effect if you also data-define the coordinates. Otherwise, labeling just follows the position defined in the placement section and ignores the data-defined settings.


1

To exclude some of the arrows of labels that have been moved with the tool you can manipulate label's layer. I first selected all the labels with arrows that should not have arrows and then used the Field Calculator to add a new column in the attribute table. In this column I put a "1" for the selected labels. For the labels that were not moved or should ...


1

Not sure I completely understand but I noticed there's a couple of attributes in the custom label layer called LblShow and LblAShow, both of which use Boolean values (0 for false; 1 for true): The LblShow is the actual label so we can leave that with an attribute of 1. The LblAShow is the arrow (although in my view, it's practically tiny). If we update ...


1

You're looking for placementFlags. So, palyr.placementFlags = QgsPalLayerSettings.AboveLine should work. Note that LinePlacementFlags can be combined, so palyr.placementFlags = QgsPalLayerSettings.AboveLine | QgsPalLayerSettings.BelowLine will allow labels above and below the line, but not on over the line.


1

Your SVG files have issues. Try opening them in Inkscape and selecting View -> Zoom -> Drawing. There's polygons present WAY outside the document area. These are showing up in the composer map, causing the artefacts.


1

With qGIS 2.8.1., on the formatting tab of the label tool (also on the layer properties) you can define to format numbers and show decimal places.


1

In the advanced field calculation be sure to select python as the syntax: The code (to copy and paste): def FormatThis(number): AsString = str(int(number)) # just the whole numbers Dec = number-int(number) # extract the decimals G3 = [AsString[::-1][i:i+3][::-1] for i in range(0, len(AsString), 3)][::-1] return ','.join(G3) + ...


1

For quadrant: CASE WHEN "Strike" > 325 OR "Strike" <= 25 THEN 5 WHEN "Strike" > 25 AND "Strike" <= 70 THEN 8 WHEN "Strike" > 70 AND "Strike" <= 115 THEN 7 WHEN "Strike" > 115 AND "Strike" <= 160 THEN 6 WHEN "Strike" > 160 AND "Strike" <= 205 THEN 3 WHEN "Strike" > 205 AND "Strike" <= 250 THEN 0 WHEN ...


1

NULL in the attribute table means no data. So, there is nothing to write. You can use the expression dialog in the labeling options. Layer Properties > Labels > Label this layer with: Expression dialog (click the button) If the value in the attribute field "wert" (or "Feuerwehr") is NULL , then QGIS will label the object with 'no data' (or 'NULL', 'Kein ...



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