Phil, I too have struggled with this, but have a workable solution to use map units and a display a reasonable legend, until independent setting of legend line thickness is supported. You are using 1.7.4, so you can utilize this workaround, as it leverages the new symbology options.
Let's assume your map is in UTM (map units of meter) and you want your 'Roads' layer classified by type with a different symbol thickness in map units for relative display purposes (i.e. not real-world accuracy):
Road > Width
Highway > 20 m
Secondary > 10 m
Gravel > 5 m
For your Roads layer, you will need to make a new column in your data source of type real, with an appropriate size and precision for your use, lets call it 'ledgscale'. Edit your data and input the road width (in meters, as above) in the ledgscale column. There are many tools in QGIS for auto-updating your data relative to the road type column (Field Calculator, SQL, etc.).
The ledgscale column will scale your road type symbol's base width in map units.
Open the layer properties dialog for the Roads layer and go to Style, then choose to use New Symbology. Choose Categorized for symbol method, and set the Column to whatever your road type column is. Before clicking the Classify button, change the default symbol. Set the symbol's Unit to Map Units and the width to 1 (i.e. 1 meter, in this case). This will be used as a basis for the size in the legend later, and for scaling to your desired map units width for map features.
Click Classify to generate your road type symbols. Click the Advanced button and choose ledgscale under the Size scale field sub menu. This will scale your base symbol width by the ledgscale integer for each feature:
Highway -> (symbol width of n map units) * (ledgscale of 20) = output of legend at (n * 0.3 mm) and map feature at n * 20 map units width
or
Highway -> (1 meter) * 20 = legend of 0.3 mm and map feature of 20 meters
The 0.3 mm seems to be the default size for legend line widths (and other composer lines, like frames). This seems to be similar to the default of 0.26 mm for symbol lines.
You can do this technique with the other symbol methods, i.e. Single, Graduated, and Rule-Based. Rule-Based is the most flexible, albeit complicated.
Caveats: Changing the symbol's width beyond/below 1 (say to increase/decrease the size of the line in the legend) will affect that symbol's width on the map as well. You will also have to adjust the ledgscale number for all features that use that symbol.
This wacky workaround is how I have found to make it work, but coding QGIS to support fully independent control over legend line size is the correct solution.
References:
http://lists.osgeo.org/pipermail/qgis-developer/2010-February/009019.html
http://hub.qgis.org/issues/2979
Best Answer
EDIT I edited the question because the OP specified that he is working with point shapefiles (the approach will be similar to the original one, though).
I propose an approach which only recurs to a geometry generator and a custom function.
Context
Let's assume to start from this point vector layer representing the stones:
The layer stores the class ids in the
"CLASS_ID"
field.Solution
Go to
Layer Properties | Style
and then:Categorized
renderer;"CLASS_ID"
field (or whatever you want for your situation), without the further clicking on theClassify
button;Change
button for theSymbol
option.From the
Symbol selector
dialog, choose aGeometry generator
as symbol layer type andPoint / MultiPoint
as geometry type. Then click on theFunction Editor
tab:Then, click on
New file
and typeshow
as the name of the new function:You will see that a new function has been created and it is listed on the left side of the dialog. Now, click on the name of the function and replace the default
@qgsfunction
with the following code (don't delete the libraries imported by default):Once you have done this, click on the
Load
button and you will be able to see the function from theCustom
Menu of theExpression
dialog.Now, type this expression (see the image below as reference):
You have just run a function which is saying, in an imaginary way:
The only thing you need to change is the research value for the displaying, which in your case should be 0.002 if you are using a Projected CRS. Therefore, leave the other function parameters as provided.
If you want to set SVG symbols for the stones, go to Simple fill and select the proper option:
Finally, go back to the
Style
main dialog and click on theClassify
button (at last!) for setting the changes.You will see that some stones are not rendered (in the following image I also reported a buffer layer of 10 meters for the sake of clearness):