qgis – How to Change Units Project-Wide from ‘Millimeter’ to ‘Map Units’ in QGIS

map-unitqgis

All my units in my project are in millimeter. But I would like to switch all units to map units at once without clicking every single signature. I also would like to have the possibility to directly switch between units for the whole project.

Is there a way?

enter image description here

Best Answer

If you want to change everything to map units you can open the project in a text editor and do a find and replace:

Find:

v="MM"

Replace with:

v="MapUnit"

If it's just for one layer. Find the section in the project file that controls that layer. Easiest with the layer name.

Search for:

<layername>your_layer_name</layername>

Just above it will be a maplayer tag:

<maplayer simplifyAlgorithm="0" minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" readOnly="0" geometry="Point" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="0" scaleBasedLabelVisibilityFlag="0"\>

Which will end with an end tag:

</maplayer>

So replace all the references within those tags.

Related Question