2

I just started working with QGIS, and I'm having a problem with my labels. I have figured out how to manually move labels for the points on my map.

I have edited the attribute table to include x, y, and rotation with the decimal number option.

I can move labels around freely (which is absolutely necessary because my points are quite close together).

The problem occurs when I save the attribute table. As soon as I save, the labels start shifting. I figured that my numbers had been truncated, which turned out to be the case, so I gave the x, y, and rotation fields the max length possible (20) to remedy the situation. It helped some, but my labels continue to snap to different locations. As soon as I hit save, the labels move, but the coordinates stay the same.

Can anyone help?

5
  • What file format and data type are you using for the label coordinates? Could it be that you're trying to store the values in an integer column?
    – ndawson
    Jul 9, 2015 at 23:38
  • @ndawson, I was initially working from a csv file, but saved it as a shape file so that I could edit it and manually move labels. So it is a shape file now. When I created the x, y, and rotation fields, I saved them as the decimal number (real) type rather than the whole number (integer) type. I hope this properly answers your question. The labels will move just fine, but they snap around to different locations when I try to save them.
    – Lauren
    Jul 10, 2015 at 0:40
  • OK. What precision do you have on the fields?
    – ndawson
    Jul 10, 2015 at 1:49
  • I tried both 0 and 1. 1 seemed to truncate all the coordinates?, so I currently have it at 0.
    – Lauren
    Jul 10, 2015 at 12:57
  • I just went back and tried to resolve my issue again, and you were on the money with the precision being off (duh). For some reason, either my computer or the software was being quirky and it was only letting me enter 1 or 0 for the precision field, so I thought those were my only two options. Turns out I can actually go higher! I set both the width and precision to 10 and the issue was fixed!
    – Lauren
    Jul 14, 2015 at 12:46

1 Answer 1

1

All I had to do was set the precision to match the width of my decimal number fields.

1
  • The precision value desribes how many digits are saved behind the period. So zero means integer values. It dates way back to old FORTRAN programming eml.berkeley.edu/sst/fmttop.html and has little to do with single or double precision real number storage.
    – AndreJ
    Jun 24, 2016 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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