Tag Info

Hot answers tagged

5

You have an option ate the Layer Labeling Settings > Rendering > Feature options > "Label every part of multi-part features" Just check that option.


4

There's a plugin called Leaflet.label which does what you want: https://github.com/Leaflet/Leaflet.label


3

You are missing a very little detail: the fact that in Python you can pull elements from a list starting at the back. The last element of a list corresponds to index -1. For example: location = "Cedar Wood Park" locationChoppped = location.split(" ") print locationChoppped[-1] would return: Park, and: location = "Highland Grove Hyper Megalopolis" ...


3

This is python, and in your examples you're using the ampersand (&) to concatenate your string. You don't do this in the unformatted example that works. Use the plus sign - + - instead.Ampersand is used in VBScript.


3

You should be able to use the Year function directly in your label expression: [Diameter] & " " & [Material] & " Installed: " & Year([InstallDate])


2

Both letter and word spacing units correspond to font size units. So, if you set the font size to map units, your letter and word spacing units will be map units. As you said, that's not very intuitive, but if you have an idea of functions in programming, you can see in line 2559 of the QgsPalLabeling class, how the letterspace is applied: the letter ...


2

One solution: create a new column of type integer. Using field calculator, assign the value using the $rownumber variable. Then, enter the following logic into the "Show label" option in rendering parameters of the label dialog: [new column name] % 5 = 0 The % is the modulo operator - it represents the remainder of the first number after dividing by the ...


2

You could also add a text field to your subdivision layer, HasInspection. Calculate the values in that field to Y or N based on whether it has an inspection point. Then set up a label class that only labels subdivisions where HasInspection = Y. Once you do this, you'll only have to run the field calculation periodically (or do the update in the new ...


2

This is what I would do. First I would use the selection tool to select all of the polygons that contain a point Selection→select by location→selct from "subdivion" Source layer "inspection"→ contain the source layer feature I would then right click on the subdivisions class and create a layer from selected features you now have a layer of subdivisions ...


2

Activate your layer in the ToC and try this in the QGIS Python console: layer = iface.activeLayer() layer.setCustomProperty("labeling", "pal") layer.setCustomProperty("labeling/enabled", "true") layer.setCustomProperty("labeling/fontFamily", "Arial") layer.setCustomProperty("labeling/fontSize", "10") layer.setCustomProperty("labeling/fieldName", "ename") ...


1

I've sort of replicated your situation. Not sure if there's an easier way to do it, but the following code snippet works for me (I'm using QGIS v.2.8). To use it, activate your layer in the ToC, open the QGIS Python console, and copy&paste the code there. lyr = iface.activeLayer() renderer = lyr.rendererV2() children = renderer.rootRule().children() ...


1

What I think you really need is to use label classes. More info is available in the help documentation at http://resources.arcgis.com/en/help/main/10.2/index.html#//00s80000000v000000 Basically though, what you would be doing is creating different classes of labels that you can label differently, just like you can classify your symbology so different ...


1

An alternative method to adding a field to your attribute table is to use the legend to show your feature count. If you symbolize your polygons by group_nameand create a legend to show these there is an option to show feature count: This will then display in your legend as: Forest (4) Park (2) etc...


1

Here is one way of doing it: Add an integer field 'InstallYear' to the attribute table. Use the Field Calculator on the new 'InstallYear' column, then enter this: InstallYear = year([InstallDate]) From here you can simply change your label expression to: [Diameter] & """ & [Material] & " " & "Installed: " & [InstallYear] ...


1

When you export to PDF, on the second tab of the "Options" you will see a box that will most likely be unchecked: "Embed All Document Fonts" Make sure that it is checked and it should reduce those errors for the people viewing your PDFs. If you yourself are seeing those errors, then something else is going haywire because those fonts should already be ...


1

Don't think this is possible as of yet. A workaround could be to: Create a copy of your layer Edit the symbology of the copied layer to make the features transparent (ie. no visualisation) Add layers to the copied layer and edit the placement options so that it doesn't overlap the labels from the original layer. Hope this helps and hopefully others can ...


1

After having a look at your CSV data file I have to say that the field names you are handling are not really recommended, since they generate all sorts of problems. When you stated your question I guessed your field names looked like "Top\nElevation", which is not the case if you look at your data file, since it contains field names in the form: "Top ...


1

I've reproduced your problem. It seems that you need to escape the \n in your field names. What does that mean? If you try to pass directly the field name valLabel.fieldName = "Top\nElevation", Python will handle such string as: "Top Elevation" which is not what your field name looks like. But, if you escape the \n, this way: valLabel.fieldName = ...


1

Quick Solution: In layer properties dialog for this layer you can set the general label rotation (layer properties > labels > placement). If the number for the map rotation in print composer is 30 (it rotates clockwise), then the number for the label rotation is 30 (it rotates counter clockwise). Does it work with your layout?



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