0

What would be the expression coding for if the address is 14802. But if the whole address cannot fit inside the building dimessions, then it should be truncated to the last two digits - 02. I am trying to do this ...

enter image description here

As seen in my map, I am trying to take down the congestion of the map with the numbers and trying to still be able to label each building for a firedepartment map.

Any ideas?

2
  • 2
    Most Answers attempted have asked whether you could edit your Question to provide more details about any restrictions that may apply to suggestions that they have offered or may offer in the future.
    – PolyGeo
    May 19 '14 at 23:34
  • index your house numbers - small scale example counties.britishlegion.org.uk/media/3669716/…
    – Mapperz
    May 20 '14 at 3:12
3

While they are both excellent suggestions, the question was on how to shorten labels.

Label expressions work all the time and I'm assuming that you don't want to shorten all of them, just the ones for small properties. Some investigation will bring you to an arbitrary number on what is small, I will call this value "small" but you will need to substitute a value for it.

As Python parser (might not work as the indexing of the string is in [] so ArcMap might get confused and go looking for a field called -2:):

def FindLabel ( [ADDRESS],[SHAPE_AREA] ):
  if len([ADDRESS]) > 2 and [SHAPE_AREA] <= small:
    return [ADDRESS][-2:]
  else:
    return [ADDRESS]

As VB parser:

fuction FindLabel( [ADDRESS],[SHAPE_AREA] )
  if len([ADDRESS]) > 2 and [SHAPE_AREA] <= small
    FindLabel = right([ADDRESS],2)
  else
    FindLabel = [ADDRESS]
  end if
end function
2
  • 1
    +1 for a creative solution. I see a potential problem with small buildings in non-crowded areas, or very linear buildings which might have a large area but still be smaller than the label (potential examples of both in the image), but it does accomplish the goal just with expressions and no data modification.
    – Chris W
    May 17 '14 at 0:14
  • 1
    Yes, I totally agree @ChrisW, this is an answer to the question not a solution to the problem... that's not semantics. The solution to the problem involves more than just the script, the user should investigate multiple tactics, including the answer you put forward, to neaten up the labels. May 17 '14 at 0:40
3

You wouldn't be able to do this with an expression using the labeling field alone, as that just defines what the label is - it doesn't know anything about how it fits.

One way to solve it utilizing a label expression would be to edit your address data to have an attribute like 'too big' and then do label classes for 'regular' and 'too big'. This could take a lot of manual editing though.

Using the Maplex labeling engine gives you some options for truncating or abbreviating labels, but I don't think any would help with your specific situation as they're all aimed at changing entire words or truncating (cutting from the end and not the beginning).

3

All of the above answers are definitely viable solutions to labeling expressions. However, sometimes a label is too long to fit in a specified area and in this case I think a FULL address would probably be mandatory. When this happens you have a number of options, all of which have been mentioned in this thread or in your previous threads.

Things I would try for a mapbook, printed on paper:

  1. Increase your scale. This may result in an increase in a number of pages of the mapbook, which can be tedious to flip through, or the pages may not end "logically" (in the middle of the street as opposed to at the end of an intersection). However, if you pick a scale where all your labels are visible, this is most certainly a plus.

      -
  2. As other users have mentioned, if your road data is set up with a FROM and TO which indicates the address # beginning and ending at a street this may be helpful to include as a label - however I don't see this as a viable solution for Emergency Response.
  3. Instead of using building outlines, could you use a parcel layer instead? This may give you more room to fit your labels as parcel lines are typically larger than the actual building
  4. Insets. If you are indeed, creating a mapbook this may require a little fine tuning depending on how many pages you have that do not show the labels properly. What I would do is:

    • Increase the scale so that all labels are mostly shown in the best
      way possible

    • If for example 5/25 pages have a few areas where labels aren't showing, either resize the font or use annotations. OR create a small inset on these five pages with a blow up of the congested areas.

7
  • Instead of down voting, why not comment about how this isn't a viable solution?
    – GISHuman
    May 16 '14 at 19:53
  • 1
    Not the downvoter, but I'll offer some input. First, you're right a comment would be helpful. Second, the downsides I see to this as an answer are 1) it doesn't directly address the (real) question about label expressions, and 2) it's very short/stated as a question. Credit must be given there's a general 'ideas?' tacked to the end and yours is a viable alternative approach. With some expansion I don't think it would be a 'downvotable' answer, but as written it's more appropriate as a comment on the question. Also, FYI, that approach has been suggested in some of OP's previous questions.
    – Chris W
    May 17 '14 at 0:04
  • 1
    While an inset might solve the problem you have to have some "real estate" on the product to put it - or consign it to another page. If this is a web mapping application then insets are just not possible; some product specifications don't allow insets. May 17 '14 at 0:44
  • I think there are two issues with this Answer. Mainly its brevity because for both Questions and Answers anything less than about a paragraph gets flagged up in the review queue as being low quality. However, I also think Answers are best framed as statements rather than questions. For example, "I would approach this by creating a map inset of the more congested areas with a tradeoff being ... (perhaps as per @MichaelMiles-Stimson Comment)".
    – PolyGeo
    May 17 '14 at 2:12
  • Thanks. I should have written it as a comment and provided more documentation. I would be prepared to provide a more detailed answer if the OP provided more info about web mapping applications or if this is a map book/paper product.
    – GISHuman
    May 18 '14 at 3:02
2

Another strategy for dense labeling is Key numbering. ArcMap introduced this in version 10.1. I've never used it so not sure what the ramifications of this approach are, but worth a look?

2
  • Another good alternative, which OP has tried before. The challenges here are where would you put the key (no available whitespace); and that it operates on unplaced labels (or rather, as a last resort to place labels) whereas the labels here are placed but hard to read. Definitely another possible piece of the solution puzzle though.
    – Chris W
    May 17 '14 at 20:10
  • I think key numbering would be difficult to place if OP is using data driven pages (which I suspect they are). I've had a lot of difficulty configuring where to play key numbers in congested areas in 10.1
    – GISHuman
    May 19 '14 at 20:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.