Hot answers tagged

6

In your Label settings interface, click the Data defined overide button for the bold option: Then use an expression like: CASE WHEN "Style" LIKE '%2016%' THEN 1 ELSE 0 END The input for this setting is boolean (i.e. 1 or 0).


6

From the label settings window, there's another hidden spot where you can toggle all labels. At the top right, click the yellow four-direction arrow button and place a check beside Show all labels and features for all layers. Note that that will affect all layers, not just the one you're working with.


5

Switch to Python parser, click Advanced and enter the following code def FindLabel ( [FACILITYID] ): exValue = [FACILITYID] first = exValue[2:4] second = exValue[4:5] third = int(exValue[5:]) newLabel = "{0}-{1}~{2}".format(first, second, third) return newLabel This removes the first two characters, keeps the second two, adds a -, ...


4

You could collect all distinct values for your groups and aggregate them in the db and create a new table. You will get a new field with aggregated strings. And you actually use those for the labeling. CREATE TABLE AS... SELECT string_agg(field_with_distinct_values, '?') FROM table GROUP BY field_for_the_relate You then join this table in Qgis and use in ...


4

You can use string functions for the labelling the same way as for the field calculator. In your case when the data is uniform it should be easy. In the labeling options you go to the expression dialog (right beside the "label with" drop down menue) Then put into the expression window: substr("adr_les",12,16) That should show you only the text of your ...


3

def FindLabel ( [NAME_GEO] ): if [NAME_GEO]=="Tbilisi" : return "<BOL><FNT size ='14'>" + [NAME_GEO] + "</FNT></BOL>" elif [NAME_GEO] in ("soxumi", "baTumi") : return "<BOL><FNT size ='12'>" + [NAME_GEO] + "</FNT></BOL>" else: return [NAME_GEO]


3

The parentheses in your label "(" and ")" are text values that are added to your [AREA] value, so you can add any other text you want with it. "(" & [AREA] & " sqft)" will produce something like (1000 sqft) as your label.


3

Pretty elegant answer here led me to work up this python sample code which you can tweak to your advantage. It converts the field value to a list and then you can modify the list values as needed. MH54-201 def FindLabel ( [MH_No] ): l = list([MH_No]) l[4] = '~' return "".join(l) Returns MH54~201


2

In QGIS you can not add labels to diagrams. the technique I use: create the diagrams with the sheet google drive; Save as image; edit and save as svg with inkscape; in the table of the shapefile attributes add a field: 'path' (Text 254); populate the field with paths to images svg; I extract the centroid of the shapefile and use the style 'symbol SVG'; ...


2

If you want a less-populated map, you can take the STAMEN layers based on openstreetmap. Alternatively, you could take a snapshot of a lower zoom level with Save as Image, and add that as a raster layer. But you might get a very pixelated view. BTW I suggest to switch from the openlayers plugin to the QuickMap Services plugin. It works better with the ...


2

The OpenStreetMap Wiki is your friend: http://wiki.openstreetmap.org/wiki/Map_Features. You can also get a lot of good information from here: https://taginfo.openstreetmap.org/keys/addr:housenumber#combinations. You may need this: http://learnosm.org/en/osm-data/osmosis/ and this: https://wiki.openstreetmap.org/wiki/Key:addr This command line was not ...


2

I'm unsure what your calculation is trying to do, or what possible values are in your fields, but a few things to consider are: VBScript doesn't have elif but rather elseif You need to end if with an end if You probably want to separate your <> 0 out into separate if statements for when some have 0 and others don't (e.g. TOT_HH_1 = 0 but TOT_HH_5 <...


1

Yes. Insert a label, and for the label text insert an expression with the text: @project_path The @project_path variable is automatically filled with the current path of the project.


1

As raykendo pointed out, the require functions were not in the correct order. Once that was corrected the label was displayed.


1

Apart from using the full planet, you can download extracts in osm.pbf format from Geofabrik for certain regions. They contain all data within the region, while the shapefiles only contain some most-wanted topics. You can load the data into a Postgis database with osm2pgsql, or in a spatialite database with ogr2ogr. For use in QGIS, you can also try the ...


1

as @radouxju has said, you can link the different tags together: lblClass.expression = '"{}" + [OBJECTID] + "{}"'.format("<FNT size = '10'><CLR red='255' green='255' blue='255'>","</CLR></FNT>") which should output something like <FNT size = '10'><CLR red='255' green='255' blue='255'>[OBJECTID]</CLR></FNT>


1

you just need to open and close your color tags in the expression lblClass.expression = '"{}" + [OBJECTID] + "{}"'.format("<CLR red = '255' green = '255' blue = '255'><FNT size = '10'>","</FNT></CLR>")


1

I had a fix posted on the ESRI forum by Jeff Matson which I'll put here. Basically I shouldn't be creating a new LabelEngineLayerProperties object. I can get it by querying the AnnotateLayerPropertiesCollection. There should be no need to clear and re-add it Here is the working code: public void add_halo(IGeoFeatureLayer fl) { fl....


1

You may not need KML for the whole world just to get labels turned on. Have you tried selecting a different base imagery layer? It's the second icon from the upper-right on the toolbar. var imagery = Cesium.createDefaultImageryProviderViewModels(); var viewer = new Cesium.Viewer('cesiumContainer', { imageryProviderViewModels: imagery, ...


1

Try using this function: i use it all the time it works great. Also you need to indent after your if layer.supports("LABELCLASSES"): def label(layer): for lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == layer: if lyr.supports("LABELCLASSES"): for lblClass in lyr.labelClasses: lblClass....


1

Activate the labels again in the feature properties. They were deactivated when you converted them into annotations. To delete the annotations it need to be clear what you have? If you have graphics elements then you go to "Edit" - "select all elements" and press delete. When you have an annotation-layer in a database you just delete the layer via the ...



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