0

I was trying to extract latitudes and longitudes from QgsGeomtery. But I noticed that no all digits we being printed.

Can anybody identify why and how can I resolve this problem?

For example is this was the actual point 231233.22123413317891095, then output is 231233.2212341331.

This is the code used.

for part in geom.parts():
    for vertices in part.vertices():
        print(vertices.x(), vertices.y())
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • 2
    Everything beyond the third digit is unnecessary and unrealistic accuracy. – Erik Nov 23 '21 at 11:54
  • But in terms of lat longs it makes alot of difference. – Haris Harris Nov 23 '21 at 11:56
  • 5
    That's not longitude or latitude, it's likely metres and I can guarantee you that your data is not accurate to < femtometre (10^-15). Just print to your desired precision print(f"{vertices.x():.9f}") – user2856 Nov 23 '21 at 11:58
  • 4
    Even in lat/long the 10th digit does not make a big difference https://xkcd.com/2170/. – user30184 Nov 23 '21 at 12:08
  • 1
    Please check this thread for more details: https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude – Taras Nov 23 '21 at 12:12

0 Answers0