Tag Info

New answers tagged

2

You can use the geometry config option of ol.style.Style and use a function to create a point at every vertex (http://openlayers.org/en/v3.5.0/apidoc/ol.style.html#GeometryFunction) See also this blog post for some related information: http://boundlessgeo.com/2015/04/geometry-based-styling-openlayers-3/


1

The code presented in your question doesn't match what is asked for in the question. "I'm trying to label certain features using a specific field (osm_name_58_en). However, when this field is null, I want to label the feature with (som_english_32_name). If both are null then I want to label with the (amenity) field." This sentence implies that you only ...


2

The Correct form of your code is : def FindLabel ( [amenity], [osm_english_32_name], [osm_name_58_en] ): if not ([osm_name_58_en] is None): return [osm_name_58_en] elif not([osm_english_32_name] is None): return [osm_english_32_name] + '\n' + [amenity] else: return [amenity] The semicolon in the last line is removed. ...


4

For brevity's sake: def FindLabel ([field]): val = [field] return ''.join([j for i, j in enumerate(val) if j != '0' or i == 1]) Step through the string and toss away all 0's unless it's in the middle position (index of 1), then join what's left.


2

Just for good measure, here's a way to use python string methods. This would work with strings of variable length, though I know that wasn't a consideration in this case: def FindLabel(value): if value.endswith("0"): value = value[:-1] # slice all but the last character if it's a 0 return value.lstrip("0") # take off any leading zeros


3

Here's a little more concise way of doing it. Basically convert it to a list and replace list[0] and list[2] with '' if the value is 0 def FindLabel([field]): value = [field] l_value = [x for x in value] # turns string to list no_zero_positions = [0,2] # where you don't want zeros for p in no_zero_positions: if l_value[p] ...


6

Use Python as the parser, and check the Advanced box. Then just replace yourFieldName with the name of the field you want to label. def FindLabel([yourFieldName]): value = [yourFieldName] first = False third = False if value[0] == "0": first = True if value[2] == "0": third = True if first == True and third == ...


5

This is definitely possible. I just did a test, and I was able to get it to work by using float() around the Acres variable. So, this worked fine for me: def FindLabel([PARCEL_NUM], [PROP_ADDRE], [Acres]): if float([Acres]) >= 10.0: return [PARCEL_NUM][-8:] + '\n' + [PROP_ADDRE] else: return [PARCEL_NUM][-8:]


1

Took me a few tries and some digging to realize but, as per the ArcGIS Help: Note: To label a subset of features based on a field value, create the SQL query in the label class instead of through the label expression. So try creating a label class for those features greater than or equal to 10 acres(SQL) then use the expression to format the label. ...


1

I just found it myself - it's under layer properties -> General -> Data source encoding.


1

In Arc 10.3 you can access the Maplex Labeling Engine which gives you much more control over labels. In the image below showing a layer properties you can select: define classes of features and label each class differently You can then set a scale range for each grouping, so for example you'd set the range to 1:500,000 to 1:10,000 and put you vb script to ...


2

You can use a conditional expression as you label: CASE WHEN "MyCitynameColumn" = 'New York' THEN MyCitynameColumn END You can have more than one Case and combine with a Else statement: Syntax CASE WHEN condition THEN result [ ...n ] [ ELSE result ] END [ ] marks optional components If you have a lot of small areas, resulting in ...


2

Use an expression like '\n\n\n' || name || ' ' It adds some empty lines in the beginning and extra spaces to the end which are respected by the QGIS labeling engine when it computes collisions. It's a horrible hack but i works kind of


0

In QGIS, if the dataset is saved in the right encoding and the labels are set to your desired font, the labels should be displayed correctly. I'm not so certain about the effect on the attribute table if the characters are not available in the font the attribut table uses. If you continue to have issues, please share a small sample of your data for test ...


1

I'm not sure what app. you used to create the kml from the excel file but in simplistic terms you will need to embed a name tag within a Placemark tag to show label for each point, see example xml below (label in this example is "Untitled Placemark"): <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" ...


1

With some manual work and a Spatial Analyst extension. I assume you have access to Spatial Analyst since you are able to generate contours from DEM? I use a different approach - I show only major contours in areas with slope more that say 30 degrees but it will work the same for thinning contours with some tweaks. Create a slope raster and generalize if ...


1

I've asked some question in a comment above but what you can try right away is resetting the ArcMap template: Close all instances of arc map Locate and rename the Normal.mxt in ESRI\DesktopXX.X\ArcMap\Templates\Normal.mxt start ArcMap and turn on the labelling toolbar.



Top 50 recent answers are included