New answers tagged

0

Have a look at EUDCEDIT. It's a "hidden" program that is included in most windows versions that can be used to edit and create fonts. I have used it do do exactly what you are trying to achieve. Once you create your font, it will appear under the name "EUDC" in your list of fonts available through the "Character Marker Symbol" type in the "Symbol Property ...


3

You've got a little tied up constructing your string def label(wah, field): for lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == wah: if lyr.supports("LABELCLASSES"): for lblClass in lyr.labelClasses: lblClass.expression = "<FNT size='8'>[{}]</FNT>".format(field) ...


2

I'm not sure where your single quotes came from in the expression. They aren't there in the hard-coded version, and they aren't needed. Change: lblClass.expression = "'["+field+"]'" to: lblClass.expression = "["+field+"]" Or, better yet: lblClass.expression = '[{0}]'.format(field) The string formatting is prettier (especially with longer string ...


1

Convert the font or image into an EMF vector graphic in graphic software such as Adobe Illustrator then use it as the picture marker symbol and it will be rendered as vector. You can also add any EMF vector (i.e. logo) to map layour as image and it will also render as vector. You can introduce 100% transparency to remove backround but only solid and 100% ...


3

Nice question! PyQGIS to the rescue! Follow these steps to get a new field (in your original layer) called label with the number of points that lie in the same location: Active (select) your layer in the QGIS ToC. Run this code snippet in the QGIS Python console: from PyQt4.QtCore import QVariant lyr = iface.activeLayer() # Create New Field ...


1

It looks like the road is too short for the text to fit on, or it's too curvy. Check here for a similar solved question. A solution could be to either abbreviate the label, or simplifying the line might help.


2

Your layer have to be in edit mode for enabling the tool. All the parameters in the Change Label box are data defined fields, so you need to have fields corresponding in your attibute table. After creating the new fields in the attribute table, go to the proprieties dialog, and setup the fields you want access. For exemple, for the X coordinate : The ...


3

If I understand, you want aggregate a layer by location. You will need SQL for that, so create a virtual layer (Qgis >= 2.14) with a query like : SELECT geometry, count(*) AS count FROM your_layer GROUP BY geometry You can now use the "count" field of the virtual layer as label. For adding the filter by the text field : SELECT geometry, count(*) ...


0

Perhaps try extracting the nodes and then duplicate the node layer; one for start labels, one for end labels. For your first (start) layer, label with the start column. Under 'Placement', on the 'Labels' tab, select the "Offset from point" radio button and select a quadrant you want all you start labels to appear in. You can then use "Offset X,Y" to ...


0

you can use Rule-based labeling shapefile point before the rule all the points they label. after the rule: using rules you can specify which labels to show, even using conditional statements


0

Have you tried to activate option « Show all labels for this layer (including colliding labels) » ? This option is in the layer properties dialog > tab Labels > Rendering.


4

You can do this with two "Rule-based Labelling" labels, with no filters. This lets you put multiple labels on a feature. The first rule labels the feature with the attribute you want at the start, the second rule with the end attribute. Initially your labels will appear in the centre of the line, so we need to fix that. Do that with "data defined" ...


3

Following the suggestion of @Joseph, I solved the question by this way: Assuming that there are already defined labels. Step 1: created two fields; xLabel and YLabel, decimal type, length 20, precision 4. Step 2: Layer Properties > Labels > Placement > Data defined, maped the X and Y fields in 'Attribute field' to match with the fields previously created ...


3

You could use the easy custom label plugin to move them where you want. See my blog post for a longer example of how this works.


1

Create a polygon centroid, and then move the centroids where you want.


0

Try setting the label placement to the "Cartographic" option (available in QGIS >= 2.14). That mode uses the font baseline/ascent for placement.


2

I suggest that you use a custom rule-based placement for each feature label. You do this by creating a label-placement rule associated a unique value that the feature contains (e.g a id, gid or any other field which is unique). Go to properties for the layer (right click layer and choose properties) and pick the 'Labels' tab. Choose rule-based labelling in ...


3

There are a couple of solutions that spring to mind. The first is to create a field in your data that you can use an expression to set the RGB value dependent on your data. Then use this as the expression for both the fill color and text color (accessed by the little 'Data defined' tab beside each color picker). Another alternative would be to use ...


2

For your case, that the current layer and the coverage layer don't share a similar field, you will need to use the following rule: within($geometry, @atlas_geometry) Some extras If the current layer and the coverage layer share a similar field, then you can use: "my_filed" = attribute(@atlasfeature, 'atlas_similar_field_name') Finally, if the layer you ...


0

Are you working with an old version of QGIS? Even though I dont know your answer, maybe you will find an answer here


1

The problem is with map scale. Too short line for those words.


0

Based on other answer here I did some tests and surprisingly for me find out that what you ask for should be default behavior of QGIS except of one small change: In the Labels settings under Placement switch to Horizontal (slow). That should do the trick.


0

Update: QGIS should have this as default behavior (see my second answer). But if for some reason you want to make sure or need some variation (perimeter, smallest area or something else) this is the way to go: Have a unique multipolygon ID column (MID) Convert multiparts to singleparts (Vector / Geometry Tools) Create area column Use Group Stats plugin to ...


0

I had the same problem - QGIS was placing labels on some of the multi-polygon features inside / over the smallest polygon, while I wanted it to be centered between the two. Try this: Vector > Geoprocessing Tools > Convex Hull Select the layer you are interested in labeling. You can select individual features, or all features. Select "Create convex hulls ...


3

You can show both diagrams and labels at the same time by enabling: Labels > Rendering > Show all labels for this layer (including colliding labels) If labels and/or diagrams overlap, you may need to adjust the Rendering and Placement settings.


1

Try this. Rename your kmz to zip. Open the zip and rename the kml to txt (or just use open with). With your kml open in notepad or some other text editor look for the part of the html that says "LabelStyle" and change the "scale" number (Mine said 0 and I changed it to 0.666667) delete the entry for anything else (mine had color set to a string of 0's). ...


0

A bypass route of displaying 'Label' in Google Earth using Quantum GIS(QGIS) is possible. At first import the .kml file into QGIS & save it as .kml data during saving procedure mention 'Name' of the field you want to display as label from 'NameField' under 'Datasource Options'....


5

Just figured it out. In the layer properties, go to the "Labels" tab, and set the Method to "Define classes of features and label each class differently". I set two different classes ("Default" and "2"), each with a different style and scale range. the label now changes its style according to scale range.


0

The solution below might not be a perfect solution to your problem, but it will be a workaround to solve the issue that you have. If the number of points (cities) that you don't want to show within the bleed are few, you can exclude them using Query Builder, as follows Right-click the target layer (city point layer) -> go to layer properties Go to General ...


2

This was an issue in QGIS 2.2 http://hub.qgis.org/issues/9792 and should be fixed now.


0

Firstly, there's no entity.properties on a constructed Cesium.Entity. If you're looking for raw data that you injected into your CZML somehow, you'll have to grab that data out before turning the CZML into real Entities. Beyond that, your main problem seems to be this line: entity.label = label; Should be a LabelGraphics instance, like this: ...


2

I had the same problem and what worked my problem was to choose the option "Free (slow)" in the menu "Placement", inside the labels settings. This way, the labels are not horizontal anymore, but they are all there.


0

Ghetto method would be to add two copies of the shapefile, add a different label system for each, and then turn the dissolve on one up to 100%.


7

You can use the label expression builder to create a label that incorporates any field of the feature. See the link provided or search labeling tag for examples


1

You can use the grid decoration under the view tab to create a semi-dynamic graticule annotation, that, while constant in its scale, updates when you pan the map. In the following example I've set the grid interval to 1000 meters. There's not much in the design department, but it works.


1

It seems that it depends on the font you're using. Try alternating among the following options: Bold: layer.setCustomProperty("labeling/namedStyle", "Bold") Italic: layer.setCustomProperty("labeling/namedStyle", "Italic") Bold and Italic: layer.setCustomProperty("labeling/namedStyle", "Bold Italic") If neither Bold or Italic are selected in your ...


1

right click on the layer -> go to properties->go to labels -> tick 'label this layer with'-> click on the epsilon sign (expression dialog) and based on the example below type in your expression: 'data1: '||$rownum || ' data2: '|| $id ||'\n' ||'data2: '||$currentfeature || ' data3: '|| $scale where the $text is the name of a column hope it helps. Here ...


5

Turn on the 3D Graphics toolbar, adjust some of the default text graphics properties before you add a label so that it is added large enough to see/find. Select the 3D Text tool Use the 3D Text tool to click on the feature you want to label, and type in the label you wish to display. Adjust the label properties for orientation and size. I've created ...


1

This should do the trick: def FindLabel ( [field1], [field2] ): if long([field2]) >= 1: return [field1] + "\n" + "(" + [field2] + ")" else: return [field1]


2

If I understand you, You need this


9

If 'Scaleable Vector Graphics' (.SVG) symbol is also an option, then yes you can use it for labeling objects (polygon in your case). Right click on the layer and navigate to Properties > Labels > Background. From the Shape dropdown select SVG and browse for the appropriate symbol as shown in the screen shot. As a result it will draw graphic symbols in the ...


1

I answer me myself. I don't like, but I only found this solution: I have used conditional function in label expression. "if" has 3 arguments (condition, label if true, label if not) This is the correct code from PyQt4.QtGui import QColor layer = iface.activeLayer() palyr = QgsPalLayerSettings() palyr.readFromLayer(layer) palyr.enabled = True ...


6

You need to set the "show label" expression (under Rendering) to "name" is not null and the label to "name".


2

For me in a simple: mc = self.iface.mapCanvas() lr = mc.labelingResults() extent = mc.extent() labellayer.startEditing() for lrl in lr.labelsWithinRect(extent): if lrl.layerID == labellayer.id(): angle = 90 - QgsPoint(lrl.cornerPoints[0]).azimuth(QgsPoint(lrl.cornerPoints[1])) fieldIdx = labellayerpr.fields().indexFromName('xpos') ...



Top 50 recent answers are included