Tuesday, March 28, 2006

Generating Labels for Streets and other Linear Features

The last posting on creating Intersections for Street Segments is closely related to another topic that deserves a posting of its own. Typically, TIGER data (used to make intersection in the previous post) is just the linear graphics for the streets segment with no labeling. To make the street segments data usable, it needs to have labels. Labeling data automatically is not a trivial task, but GTData includes two utilities for generating labels for any linear data from associated its attribute values. This linear data is usually street segments, but it can be anything from Gas Mains to Primary Conductors.

A typical street network may look like the following. When zoomed out past a certain point, labels do not really matter as they probably won’t be readable anyway:



As you zoom in, Labels can be used to make the streets identifiable as shown below. However, labeling every street at this level can quickly clutter up the view and some mechanism must be used to filter out some of the labels.



When zooming in closer, all streets segments can be labeled as shown below:



The GTIntersect utility used to create intersections from Shapefiles (see previous post) has a special mode for creating labels. It can be used to generate the labels seen in the above screenshots. Another utility, called GTLabelGtg is also provided to give the equivalent functionality only using .GTG files (GTViewer’s native graphics file format) instead of Shapefiles as its source data.

The labeling utilities both have two modes of operation. They can generate labels of a fixed size and only create the label if there is enough space to fit the label on the street segments. This mode is ideal for producing labels when zoomed out where many of the labels need to be filtered out or they will cause visual clutter. The second mode uses variable sized labels that will be scaled to fit in the space available on the street segment. In this mode, a maximum size is specified, but a label will be generated for every street segment and will be scaled down if it does not fit in the available space. This mode is ideal for generating labels for close up viewing. The screenshot below shows better details of how the variable scaling will appear in more extreme circumstances:



While the GTData utilities provides an excellent means of generating labels for street data (as well as other linear data), it is not the only approach available. Safe Software’s FME can also be used to generate street labels with the Labeller tool.



In this example, the Concatenator was used to make a string that included the Street Direction, Street Name, and Street Type. This new string was then used as the source attribute for the Labeller. The Labeller provides a variety of settings for specifying the label size and overlap prevention. More complex implementation of labeling could also be implemented with FME, but this Labeller is the simplest way to get labels on the page. The following screenshot show the same set of data with the labels produces by FME:




Labeling of streets may only be necessary if you are using TIGER data or something similar that does not have the man hours invested in it to contain aesthetically placed labels. While the automated labeling approaches offered by GTData and FME do not provide as “pretty” of a result human place labels, it does fill in a gap that is essential for having usable data. Also, keep in mind, that street labels are not the only thing labeling can be used for. Any attribute or combination of attributes on linear data can be used for creating labels, so you could place pressure and size information along a gas main, phase or circuit id along a conductor. Be creative.

No comments: