4

When loading a dxf in QGIS, the line type files load in ok, however all text rotation values are lost when loaded into QGIS.

This is most obvious when you load in OStext.dxf (please see grab_Mar.22.jpg) this shows the same file open in AutoCAD and we can clearly see the selected “RICHMOND ROAD” with a rotation value of 314. When we look at the same record in QGIS (see attached grab2 Mar.22 13.43.jpg) we can see that the rotation value has changed to -0.80. So when I use that value to rotate the text, it doesn’t rotate to the correct place.

Why are the rotation values in the dxf files changing when we load into QGIS?

grab2 Mar. 22 13.43 grab_ Mar. 22

4

Answer of Carlos is good. Just some precision here.

Concerning angle calculation :

-0.8028514559 * 180 / pi() = -46

-46° is equivalent to +314° :

360 - 46 = 314

To setup your layer :

On your layer properties -> Labels -> Placement -> Data defined : click on "Rotation" button and select "Edit...", then use the formula given by Carlos like this:

"angle" * 360 / pi()

pi() is a qgis function returning pi number. "angle" is the field containing the value in radians.

This will give you the expecting result.

enter image description here

2

You must to use a expresion in rotation. You need convert radians to degrees. rotation = angle * 180 / pi()

  • thnks for the reply but i didnt get this pi()? whats its value – user23288 Mar 29 '16 at 9:50
  • pi()=3.14159265358979... You'll get this in "Matemathica" functions – Carlos López Quintanilla Mar 29 '16 at 10:17
  • Thanks for ur valuable time. i tried with the calculation but im not getting the value 314. Is there any way to apply the CRS to DXF file before converting to shapefile – user23288 Mar 30 '16 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.