New answers tagged

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.


1

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


0

Had the same question while looking at the label expression editor wondering where else they might have hidden, I mean placed, the option: Labels tab -> Symbol -> Edit Symbol -> General tab has alignment settings


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]


0

I think you could do this using ArcPy but it will be far from trivial to do so. You would need to: Calculate the size of the legend Create a feature that represents that legend in map units Use that feature to erase a copy of the data for which labels need to be avoided Label the copy instead of the original data As an alternative you might also be able ...


5

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.


0

# assuming your final product is string concatenated with all the values formatted like stated value1 = 1 value2 = 1 flds = [['fieldstr1',value1],['fieldstr2',value2]] def make_label(flds): total_label = '' for row in flds: if row[1] > 0: label = '%s,%s' % (row[0],row[1]) total_label += label + ' ' return ...


0

Here's one way to do it. I haven't figured out how to do it in a loop to simplify it, unfortunately def findlabel ([VF_CL], [C_B], [VF_C_R], [VL_C_R_Unp], [MH_F_C], [MH_F_C_Unp], [Reset_MH_F], [Reset_MH_1], [RtoG], [RtoG_Unpav], [Voids], [Joints],[Drop]): if float([VF_CL]) > 0: Label = "VF CL, " + [VF_CL] + " " if float([C_B]) > 0: Label +=...


0

geonet.esri.com/thread/40373 has the working code here.


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 ...


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 ...


0

Try this: import arcpy import sys from arcpy import env env.overwriteOutput = 1 gp = arcgisscripting.create(9.3) attr_name = 'Attribute Name' fc_Mord = arcpy.GetParameterAsText(0) mxd = arcpy.mapping.MapDocument("CURRENT") #Map document reference def label(fc_Mord, field): for lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == fc_Mord: ...


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'; ...


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).


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 <...


0

In your label Expression enter the following: round([AREA]/10000, 2) This will convert your area from meters to hectares, and round it to two decimal places. If you want more or less decimal places, just modify the 2 to the number of decimals you want on your label.


-1

Possible solution: I created bookmark in layout view and exported it into shapefile. Computed coordinates of 5 points on the left edge using Excel and extent XMin. Labelled them:


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....


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

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


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 -, ...


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, ...


0

Okay so considering I have access to ArcMap, and this is a GIS forum, I found a temporary work around, its not ideal, but right now it puts labels on my map: I open the shapefile in ArcMap I Label the features (Obviously editing the label properties to my desire) I find a text size and zoom level that displays all of my labels effectively( no bunching, all ...


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....


0

If you convert symbology to annotation, you can store in map, or in database. If you decided that you do not like it, just go to layers and in data frame properties, go to annotation groups tab, and there you can simply delete your annotation group.


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 ...


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 ...


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>")


2

You can have a look at annotations (not grapic elements). When you export your labels to a file-geodatabase the label options becoming columns in the attribut-table of the annotation. There you can calculate the angle field to have your rotations/colors/offsets based on some formula. When you create your labels in the first place as label-classes for ...



Top 50 recent answers are included