Archive for March, 2010

Street name length vs street length

Posted in Maps, MAPublisher with tags , , on March 22, 2010 by hansvandermaarel

An all too common problem: a short street with a long name needs to be labelled. When you’re doing this manually, this generally calls for a lot of abbreviation, splitting across multiple lines, a smaller font or even just numbering. In short, it’s a hassle.

When you’re using an automated labelling process, such as Label Pro within MAPublisher or Maplex within ArcGIS you can often get better results if you can tell the software to treat these streets a bit more strict. For example one thing I like to do is tell Label Pro to use a condensed font, allow it to reduce text size more often and use arrows if at all possible.

But how can you find those streets? Well, I came up with an easy formula to calculate whether or not the street would be long enough to place the entire street name. Obviously this depends on the scale you’re mapping at as well as the font style and size. So first of all place a lowercase a in the font style and size you want to use for your street names, and measure its width in map units. Let’s assume for this example that my lowercase a is 12 meters wide in map units. The formula to calculate the ratio is then going to be [number of characters in street name] / ( [length of street] / [width of lowercase a] )

Formula for calculating text/street ratio

This yields a number, if it’s smaller than 1 you have enough space for the street name. If it’s 1 you’ve got exactly enough space and if it’s larger than 1 you’re in trouble. I tried this on an OpenStreetmap dataset of central Mechelen in Belgium and the ratios went from 0.1 to almost 20 (the 14 meter long “Oscar Van Kesbeeckstraat”).

Moving on, I decided to split my streets in 2 layers. Streets with a ratio less than 1.25 would be labelled with a standard font (Frutiger 55 Roman), streets with a ratio more than 1.25 would be labelled with a condensed variant of that font (Frutiger 57 Condensed) and got a few extra rules regarding size reduction and multi-lining.

End result of Label Pro labelling

The result looks quite promising. Still not perfect of course, but based on my previous workflow (which did not use this calculation but instead had me go through the unplaced text manually to try and fit them in) it once again saved me a significant amount of time.

So give this a shot next time you’re auto-labelling a street map. It’s worth a try and it’s almost guaranteed to save you time.