New answers tagged

2

If you are trying to move the label and line by a fixed distance (a 50m-case below); Then the Geometry Generator expression for the Label would be: project($geometry, 50, radians(45)) And the associated leader Line would be: make_line($geometry, project($geometry, 50, radians(45))) Perhaps you want more control over the offset distance, then prepare a ...


0

Yet another addition: It is possible to store a CASE statement like this: CASE WHEN @map_scale < 100000 THEN 18 WHEN @map_scale < 1000000 THEN 16 WHEN @map_scale < 10000000 THEN 14 ELSE 12 END in a project variable, e.g. my_font_size, and then use the expression EVAL(@my_font_size) as a data defined override for a font size ...


0

I used VB to make this work. for lyr in arcpy.mapping.ListLayers(mxd, "Comps"): print lyr.name if lyr.supports("SHOWLABELS"): print lyr.name + " supports label classes" for lblClass in lyr.labelClasses: print lblClass.className lblClass.expression = lblClass.expression = '"{}" & "Comp #: " & [AccountNo]...


0

Welcome to the wonderful world of labeling 2Knees! You create the text for the text values for fields either editing the attributes of the newly created feature (your point for sleep stop). Your newly created feature has to still be selected otherwise the attributes editing panel will be blank. Another way is to open the feature class attribute table and ...


4

For me, what you want works with the expression @geometry_part_num . In the layer-styling, I set the style to be rendered by geometry-generator with the expression nodes_to_points( $geometry). As a marker, I select Font-marker and at the selection of the symbol, I select data-driven override with the expression @geometry_part_num


1

You could extract the vertices of the line as point using the extract nodes tool. And the point to your project. Add a new attribute to the table with a sequence of numbers. Label those points using the sequence.


1

Here's a completely different solution that doesn't bother with the Cluster Renderer. Duplicate the layer by right-clicking on the layer name in the layer panel > duplicate. This creates a second layer that links to the same source data. We're going to define different symbology for each copy of the layer, and set up scale-based visibility so that at each ...


0

Similar to suggestion in comments, this expression will do a job: import datetime from datetime import datetime BC=datetime(1899,1,1) lyr ="BORES";dLabels={};fidKeys={} with arcpy.da.SearchCursor(lyr,["OBJECTID","SHAPE@XY","MUID"]) as cursor: for FD,shp,LABEL in cursor: XY=shp; fidKeys[int(FD)]=XY latest=dLabels.get(XY,BC);dLabels[XY]=max(latest,...


0

Try the SuperLabeling plugin: Add your label by mouse click only. Some other similar plugins already exist, which create a memory layer or other layer making somehow difficult to integrate data. This plugin creates label data in the existed files in a minimum manner. You don't even need to type any thing, just mouse clicking can make be helpful to ...


2

I am not sure if this is the issue, but when exporting to KML make sure to write the field name that represent the labels in the NameField as you can see below. Here is the result If you write another field name, it will be loaded automatically into GoogleEarth Here is the result


3

Not sure if there is a simple way of doing this through the interface but we could accomplish this with a bit of Python. The code below stores the value and colour of the raster's symbology properties and rounds the value to 2 decimal places (you can change the value if you want) which it stores as the new label. Then it reapplies the updated properties So ...


0

I was able to use a few examples elsewhere, and came up with this working solution. All I want to do now is bold and underline the UNITID. I'm posting the code here for anyone else who wants an easy solution. def FindLabel ( [UNITID], [QTY1], [SIZE1], [QTY2], [SIZE2], [QTY3], [SIZE3], [QTY4], [SIZE4] ): if [UNITID] and [QTY1] and [SIZE1] and [...


0

I found a solution, using a condition on the size of the diagram: if the entity is out of the coverage, I put the diagram size to zero: if( attribute($atlasfeature, 'atlas_field_name' ) = current_field_name , siez_field_name , 0)


2

Using atan would give better results than atan2: let rotation = -Math.atan((last[1] - first[1])/(last[0] - first[0])); You could also switch to a more recent version of OpenLayers and use the placement: 'line', option in ol.style.Text (introduced in version 4) which avoids having to set rotation


2

I think using the "Meters at scale" unit type in the size section of the label properties should let you achieve what you're after. This setting automaticaly adjust the label size as you zoom in and out. You'll have to first set the "meters at scale" unit then play with the size value till your label are the same length of your line (if you need to set ...


1

You probably have null values in one or more fields (not to be confused with a the literal string value of "Null") which are getting passed through as None, a special Python type which can't be concatenated to strings in that way. You're only currently checking for empty strings, but a more generic way to check for either would be to do simply if [field], ...


1

No, you didn't miss anything. That is not a feature supported by QGIS. You need to set the labels opacity separately in the labels menu. You can try opening a feature request, if you think this would be a useful implementation. Right now it is only possible to receive the symbols color by expression, but not its alpha channel. Maybe it is possible using ...


2

You have labelEdifici defined as a function but feature is never being passed to it. If you make it a constant you can set the text value in the style function where feature is passed var labelEdifici = new ol.style.Text({ textAlign: 'center', textBaseline: 'middle', font: '12px Verdana', fill: new ol.style.Fill({color: 'black'}), ...


Top 50 recent answers are included