Is there a way within QGIS to prevent text labels from overlapping icons used to label a point layer?
In the example map shown below, there are two layers:
- Roads layer which is labeled using the new labeling engine.
- A point layer which uses svg icons to show highway shields.
I have other use cases for this such as preventing overlapping of rail station icons. In this example, I could simply move the point, however, in other cases, such as a subway station, that is not a workable solution.
A possible solution which I am considering would involve:
- Adding a column to the point layer's dbf file.
- Filling the added column with either Null or a space.
- Enabling QGIS's [new style] labeling for the added column.
Is this the way to go or is there a better method?
QGIS info: I am using versions 1.7.4 and a recently compiled version of 1.8 on Mac OS 10.7.4. Linux and Windows versions are also available to me.
Progress Update: The method I described above works though two modifications to the process are required.
- Instead of using a space character or a Null, a non-breaking space has to be used. While testing I found, fields with Null are not rendered and fields with only a space(s) are converted to Null. (See this Wikipedia page for information on how to type a non-breaking space.)
- While setting the Layer Labeling Settings, on the Advanced tab, set the Placement to Over Point. Also set the Priority such that it is higher than any other labeled layers.
Depending on the size of the icon used, some experimentation may be required to get things to work as expected. Depending on the circumstance, it may be easier to use multiple characters rather than attempting to increase the font weight and/or size.
Tested with QGIS 1.7 and a recently compiled of 1.8 on Mac OS 10.7.4.