Questions tagged [labeling]

Rendering values from attribute tables as text on maps near their feature. For questions about legend labels use the [legend] tag instead.

Filter by
Sorted by
Tagged with
3
votes
0answers
200 views

QGIS expression for label text to display vertex coordinates of polygons

This question is inspired by Displaying vertex coordinates of a polygon or line without creating a new layer and especially by the answer by @JGH: https://gis.stackexchange.com/a/381130/88814 The ...
3
votes
1answer
5k views

Adding label to QgsVectorLayer in PyQGIS? [closed]

My goal is to define labels programmatically for the case similar for the figure below: But I didn't find any guidance how to do so using Python. I have a feeling it could be done using QgsLabel ...
3
votes
2answers
2k views

MultiLine field-name label referencing in PyQGIS?

A labeling routing (which is updated often) is being implemented via pyqgis and a QComboBox. The code below worked great, that is until needs for narrowed column headers spawned the use of pythons '...
2
votes
0answers
159 views

Define color for label-buffer with data-defined override/expression

In QGIS 3.8 (Win 10) I have a Point-Layer with labels in a certain distance and leader lines, created with geometry-generator. The leader lines in some cases cross below the label and are masked by a ...
2
votes
1answer
759 views

QGIS Labels Rotation

I have imported some OS MasterMap data into QGIS 3.2 and have labelled the Cartographic Text dataset. This dataset has a rotation field, populated with various angles of rotation depending where they ...
2
votes
1answer
990 views

Labelling line layer using QgsPalLayerSettings() QGIS failed

I'm trying to set label on polygon and line layer using PyQGIS. Setting label on polygon layer succeed, but fails on line layer. Here my script : #Set polygon layer palyr = ...
2
votes
2answers
6k views

Text layer styling in GeoServer?

I am wondering what is the best approach to use for text layers in GeoServer. AFAIK, there is no text layer in GeoServer. But in many occassions we need to use text layers and not simply label for ...
2
votes
1answer
579 views

SHP file Left / Right Label Alignment issue in QGIS 2.0.1-Dufour

cld anyone let me know how it works to get the desired label placement for the opened SHP file into QGIS 2.0.1- Dufo
2
votes
2answers
4k views

How to convert decimal point to comma in QGIS?

I am working with data in Colombia where decimal points are written as commas. I would love to create a new column in QGIS that would convert all decimal points (periods) to commas for the purpose of ...
2
votes
1answer
1k views

How can I have the percentage instead of the Frequency in Google Earth Engine? (Edited question)

EDIT : Since I had 2 questions in one, I edited it to only have one (second part here.) EDIT 2 : I got a partial answer on another forum and made my script more universal I have yet another question ...
2
votes
1answer
856 views

Regular expression substring for labelling

I downloaded OSM .pbf raw data for Germany. Right now I'm trying to create label badges for german highways. German highways have names starting with the letter 'A' followed by a number with up to ...
2
votes
1answer
273 views

Setting placement labels on “Offset From Point” with OffsetX,Y parameters in PyQGIS?

I'm trying to set properties of QgsVectorLayer using QGIS 3. I want to put labels with "Offset from point" and define "Offset X" and Offset Y". I saw on the documentary that there is a class "...
2
votes
1answer
612 views

Adding x and y values while creating a label QGIS

I'm trying to create a label on a map in QGIS. I can open the setting where there are an X and Y button and a few other properties, like opacity and distance. I'm pretty sure the problem is that I ...
2
votes
1answer
102 views

Labels not rendering at appropriate resolution for a single polygon across different layers

I have re-used a single geometry layer and joined it with a lot of tables for regional maps of different variables. Now, I suddenly have an issue with labels for one of the polygons.The issue is ...
2
votes
1answer
3k views

change default font of labels in QGIS

I've just opened a feature request, but maybe someone knows a temporary solution. In QGIS 2.2 one can change the default font of the Print Composer (through the Menu Option -> Setttings). But I think ...
1
vote
1answer
894 views

Connecting vector label size with map-units?

I have a working application of labels to a point array - but the size of the text is not relative to the map scale. This decreases the readability of labels when panning and zooming. To resolve~ ...
1
vote
0answers
96 views

Custom labeling with same angle as rectangular object and specific position using QGIS?

Can the following be done in QGIS? It should be formula based without manual formatting as performed by my predecessor to get the following output. So Grave_No on right parallel to the y axis of ...
1
vote
1answer
1k views

Labeling classes for small roads on large extent maps in ArcMap with SQL statement?

I have many small sub divisions that won't label nice, (lot of overlapping) unreadable. While using the bullet leader symbol. What would be the best statement that would place the labels in a ...
1
vote
1answer
1k views

Labeling line features using PyQGIS?

I used the following code to label the line features(roads) in a layer.It works in the console, but not by python code(application) It works for the points too. What did I do wrong? def labell(...
1
vote
2answers
1k views

How to prevent automatic new line when labeling point feature class?

I have a point feature class that I am labelling with the string "EXIT" for a majority of points, but some points will be longer, such as "EXIT into Pacific". I wrote a labeling script that will ...
16
votes
2answers
45k views

Multiple labels for one layer in QGIS [duplicate]

Is it possible to show two or more labels for one layer? For example - one label will show the name of a school and the 2nd label will show the number of students? They should be completely different ...
13
votes
4answers
8k views

Connecting label and point with line/arrow using QGIS

Is it possible in QGIS to connect labels and points with a line/arrow or something? In my map it is not clear which label goes with its point. I can't bring it closer because there are many more ...
13
votes
1answer
8k views

Interactive and dynamic map with wind data in R leaflet?

I have some data like this : longitude latitude speed direction 1 6.10722222 46.23639 4 360 2 6.95416667 43.54694 4 360 3 7....
14
votes
1answer
4k views

How to create text labels with background boxes?

I'm trying to create some custom labels for point features in a QGIS point vector layer, and I want to write a python plugin to do it. We need our labels to be presented with color tinted rectangles ...
10
votes
2answers
4k views

How to only show labels for an arbitrary selection of items?

I'm curious how others go about solving this problem: You've created a map for something with a large number of features that are labeled. The customer/client asks that you only show labels for X, Y ...
11
votes
4answers
7k views

Are there any cartography “rules” you should follow when labeling maps?

We've all seen poorly labeled maps before. In these maps, the wording is either illegible or unpleasant to view due to positioning, color choice or size, or the labels take up so much map space that ...
11
votes
2answers
8k views

How to use label classes, expressions, and annotations?

I've always found that when it comes to python, vector analysis, QGIS gives ArcGIS a run for its money, hell some of the qgis plugins exceed ArcGIS's performance by a few hours; however, I always have ...
7
votes
2answers
3k views

How to use interacting PostgreSQL/PostGIS triggers in QGIS to create multiple labels on polygons?

EDIT: The trigger functions posted are well done but there are still a few issues. I've uploaded two screen recordings: http://workupload.com/file/ygRnYtp9 http://workupload.com/file/OBY7i9Fh I ...
5
votes
2answers
3k views

Managing label spacing/density in QGIS?

How to manage space in between labels (or density)? I would like to have less labels in order to have more space in between. The label order is not important. I would like to precise is just for ...
9
votes
2answers
4k views

Show only one label for multiple points with same value in QGIS

I have a point shapefile which has for a few occasions multiple points with the same ID. Doesn't look nice with the normal label-display. Is it possible in QGIS to only display one label then? I ...
8
votes
1answer
723 views

Place label along line near start and end of line in QGIS

I have four fields managing the numbering of the start and end of road sections. I created two label rules, one for the start and one for the end of the road sections. I set the position of the ...
6
votes
2answers
317 views

Label callout lines to the closest point on the label

I am trying to improve callout lines on maps I'm making. I'm currently using the method in this link to make my callout lines. That works fine, bu I'd like the lines to always go to the closest point ...
4
votes
3answers
10k views

Expression labelling in ArcMap: Label only where value is > 1

I have a field in a shapefile with values ranging from 1-50 and multiple listed as 0. Is there a way to label only the features where the number in the priority field is > 0?
4
votes
4answers
1k views

Generating chainage nodes and labels along line each 10 meters in QGIS

I have a line defined by a start and end node. I’d like to insert a node every 10m spacing and label it with the chainage (distance along the line). I thought I could insert nodes every 10m then ...
11
votes
5answers
5k views

Measuring straightness of a curve segment (represented as a polyline)

I'm working on an automatic elevation contour labeling algorithm and one of the factors that I want to take into account when deciding the positions of labels is how "straight" a particular segment of ...
10
votes
2answers
5k views

How to format labels with leading zeroes?

I'm trying to display a number next to a symbol in QGIS 2.0.1 - The numbers are from an integer-field in a postgresql database. The goal is that single digit numbers get a leading 0. Examples: 12 -->...
9
votes
1answer
749 views

Pause Labeling in QGIS?

Is it possible to pause/stop labeling temporarily in QGIS like in Arcmap for all layers at once? The label toolbar offers no solution.
7
votes
2answers
3k views

How is the default label field chosen by ArcMap?

I have 2 questions: I know how to manually go to Layer Properties>Labels tab>Label Field and choose my label field. I also know that I could set up my primary label field and save the setting as a ...
7
votes
1answer
460 views

Access / modify QGIS copyright decoration through python

Is there a possibility, i.e. API, for PyQGIS to access / modify the copyright decoration (View -> Decorations > Copyright Label) in QGIS? I've looked in the Python QGIS API (http://geoapis.sourcepole....
6
votes
3answers
2k views

Using degree symbol in Label Expressions of ArcMap? [closed]

I am trying to use the labeling process to display latitude and longitudes for a set of data points. To make the labels appear formal, I wish to add the degree symbol (°) to the labels. My python ...
6
votes
2answers
2k views

How to add text on top of symbols for vector layers in QGIS

I read the QGIS 3.2 Changelog and saw a new feature to add text on top of symbols for vector layers. Does anyone knows how to do this?
5
votes
1answer
497 views

QGIS Labels with HTML formating

For complex labels, it would be useful to be able to use HTML formatting when different fields should be shown, on multiple lines and with different font sizes. Is this possible with QGIS? Or is there ...
5
votes
1answer
335 views

Multi-field labeling of shapefile with PyQGIS?

I wrote the following code in order to draw the line labels with multiple fields. However, the label do not appear automatically in QGIS and I have to switch the "Layer Properties/Labels", and toggle ...
5
votes
2answers
1k views

Rule-based labeling using Atlas

Does anybody know how to only label features of a shapefile that are inside of another shapefile's features used as coverage in Atlas?
5
votes
2answers
2k views

different labels at various scales

I have a locality layer of neighborhoods and suburbs from a spatialite database. How do I label this single layer with the neighborhood name at a lower scales, but as I zoom out, I would like the town ...
4
votes
1answer
178 views

Setting a Background Color with RVBT field with python

I'm trying to set the color of a background of a layer. To do this i created an attribute "Color" with the RVBT numbers associate to each feature. As in the picture, i want to set the color with those ...
4
votes
2answers
69 views

Giving grid cells unique ID of numbers and letters by rows and columns

In QGIS 3.16 I have a grid made up of c.900 squares and I want to give each square in the grid an individual name. I want rows to be numbers and columns to have letters so when they meet that is our ...
4
votes
1answer
1k views

Are features of new labelling tool available to control via Python API?

I am writing a plugin using Python and currently using methods that set the label similar to those seen under Layer Properties. Some of the features under the new labelling engine available on the ...
3
votes
4answers
1k views

Filtering out labels surrounding active feature in Atlas

Let me put it this way, if I’ve tried data-defined rendering and the common featureid expression and it’s still not working - and I think one or both options should - what basic thing could I be ...
3
votes
2answers
957 views

Which labelling tool/engine in QGIS will be supported in the long term?

Why does QGIS appear to have two labelling tools? (Note this is not new and old symbology, but that...) there are two different GUIs, one in the toolbar (which gives the Data Defined Settings option) ...