New answers tagged

4

you can make a ruled based labeling, where the rule makes a negative buffer and test the area against 0. play around with the buffer value to get the best fitting value.


0

You can probably do it your way, but why no be free as a bird and use sql in a virtual layer: select t1.x,t1.y, t1.geometry, t2.year from table1 t1 inner join table2 t2 using (id) Assuming you have geometry in table1. BTW x is long not lat. A lot of data stuff in qgis an be handled with a virtual layer. A lot easier to remember than where a dialog with ...


0

As a quick fix, go to Layer properties / Labels / Rendering and turn on Show all labels for this layer (including colliding labels). This should make all the labels appear, even if they collide with something else. With this quick fix, you may now get colliding labels in your map canvas, and you will get them in all layouts, etc. If this is a problem, you ...


-2

Select all features, Right click the feature class in the TOC, selection -> export selection to new layer.


7

I've tested some options (QGIS 3.10). It's not really straight forward, and you will need to write quite a few expressions, with some math involved. Diagram size need to be in "Map units" (also in rendering). Bar length is then used as a base for a lot of expression values later. You need to "place" the diagrams with "overrides" (easiest with a points layer)...


2

First select on Autocad the layer you want to export by turning off the others. Then save the file on AutoCAD in .dxf. On QGIS insert the .dxf as a vector file and select only what you need. In my case for example I wanted to export text files that contain coordinates: Now the points contain in the attributes table the coordinates that I want to transform ...


3

Disclaimer: I didn't come up with the code, Claas Leiner did and provided it to us. Labelling works as follows: case when "nenner" IS NULL then "zaehler" Else "zaehler" ||'::'||'―' ||':::'|| "nenner" end While "zaehler" is the "main"-number of the parcel and "nenner" the sub-number. So you might need to change the column names. : is the line ...


3

Certainly yes but is difficult to guess how to do it even it is somehow documented in https://www.mapserver.org/mapfile/expressions.html The function to use is "tostring" tostring ( n1, “Format1” ) uses “Format1” to format the number n1 (C style formatting - sprintf). Example with field SQKM that contains areas in square kilometers with decimals. ...


9

Because the rotation is actually being managed by the labeling engine. When you define the placement by data (moving the label), there is no data for the rotation so it is zero. But you can define a expression for the rotation (Edit... option of the Data defined, Rotation submenu): line_interpolate_angle( $geometry, line_locate_point( ...


5

If you fix the last misplaced quote, the expression will display either A2 or A3 or A4 IF ("sensitivity" = 'A3', 'A3:' || ceil ($length), '') || IF ("sensitivity" = 'A4', 'A4:' || ceil ($length), '') || IF ("sensitivity" = 'A2','A2: ' || ceil ($length),' ') You could also rewrite it. Instead of displaying nothing if the condition is not met, you nest the ...


5

This approach checks the last 'word' in your string to see if it matches one of the strings you want to eliminate: def FindLabel ([StreetName]): input_string = [StreetName] split_string = input_string.split() if split_string[-1] in ["NB", "SB", "EB", "WB"]: return " ".join(split_string[:-1]) else: return input_string


4

I don't know much about Arcmap syntax for label expressions, but using Python, you could do something like: def FindLabel ([StreetName]): import re input_string = [StreetName] # Regular expression that look for strings ending with a space character # followed by either NB, SB, EB or WB, and replace this part by an empty string return re....


4

Don't wish for your imaginary line, make it real. As in, digitize a line whereever you need it. Then run lineintersections for your alignment-line and the contourlines, then join attributes by location so your newly produced pointlayer knows the elevation of the contourline it is on. For your desired output then make your points invisible, and tell them ...


0

I find that this problem occurs in cases where you have selected "Store Data in Project", and you have modified the label using the "Change label" button on the tool bar. So one can either go back to the old way where you do not "store data in project"; or if you are storing your data in the project, and you need to modify a label, make the change by ...


8

I think this long-term bugbear should have been addressed with the "overrun distance" setting in QGIS version 3.10. See extensive discussion at https://github.com/qgis/QGIS/issues/15846 and the links there. The issue is that when you're trying to curve labels, when you zoom out the labelling engine runs out of possible wrap-around locations where to place ...


3

Try setting "scale dependent visibility" on. Perhaps they are set to draw only at a certain scale. Please check under the rendering tab in the labeling dialog box.


3

Sure, it is possible. I am not sure that this is exactly what you want, but maybe it will help you move in the right direction. You can (1) set up some labeling rules in the Layer Properties, then you will (2) use the Print Composer to set up your export at the proper scale. 1) Labeling rules I added a vector lines layer of roads to QGIS. The layer ...


1

i am not really sure i understand your question, but it seems i had a similar problem: a large qgis project with different print layouts each representing a different print frame of a collection of 4 maps. layouts would overlap for about one inch, and i had to manually move the labels so that they would not be cut by any layout border. i have solved this ...


1

Let me share my home-brewed method for those like me who are not skilled enough for GRASS or Python scripts: duplicate the contour layer, you will use one layer for the unlabeled intermediate contours (eg. 50m, 150m, 250m and so on) which you will call "intermediate contours", and the other, new layer for the most important lines that you would like to ...


1

In addition to artwork21's answer, you can now also use the refFunctions plugin which does this job "on the fly". But of course this will cost some performance during rendering depending on the amount of features (This function is also limited to 100000 features). In your layer, you wish to label, create a rule based label. Use this expression as filter: ...


1

(Comments to my previous answer -- still valid -- have made clear user is most looking for ways to speed up the workflow of choosing features one by one in existing vector layers to fill in the label text field appropriately) I'll assume your layer already has a field FID which is a unique identifier, and you've added a field LabelText that you're now ...


1

The formulation of your question sounds like you're assuming you need to manually go through and put in all labels that you need. The normal use case of e.g. QGIS would be to have labels entered as attributes to a (vector) layer of roads, buildings, whatnot. Then QGIS would show them automatically, with styling you specify. You could move and/or edit their ...


2

The point of the "Around Point" placement is to allow the label engine some freedom to optimize the placement of the label within the defined radius. This can help avoid overlaps/truncations when changing scale, or when other labels are set to move around the polygon's visible extent. In application, I've found the performance of "Around Point" to be ...


1

I think it's the if [UNIT] <> " " that cause problem. By testing for " " you are looking for a space you should try with "" (empty string) or IS NULL depending on your field type (text or numeric, if it's a text field you may want to check that the "empty" cells are consistant).


4

You are using the wrong quotes. Try '' instead of "". E.g. if( floor("area") = 0, '',floor("area")||'m²') Double quotes " refer to fields. In your case to the field " " (whitepsace), which most likely does not exist. Single quotes ' refer to strings. If you want it to be just empty, there is no need to add a whitespace. Another suggestion / alternative: ...


Top 50 recent answers are included