# Buffer in QGIS/R is 650-670 m wide instead of 500 m

I am trying to make a 500 m buffer for my polyline layer. Unexpectedly, I receive buffer varying from 650 to 670 m, depending on location. As many resources recommend to use UTM before making a buffer, I use UTM projection for zone 31N - EPSG:23031 - ED50 / UTM zone 31N (actually, the layer is already provided in this CRS).

Whole polyline layer is located in Catalunya (SE Spain). Even the buffers placed near in the very SE of Spain, which is right in the middle of the zone 31N (where no distortion should happen), are 650 m!

PS: I did this in QGIS and also in my script in R, receiving exactly the same result in both cases.

## EDIT: using QGIS measure line tool (View > Measure > Measure line)

• I tried to convert the layer to EPSG:32631 - WGS 84 / UTM zone 31N and do the buffer again, but it didn't help. – Tomas Jul 19 '13 at 16:24
• In what coordinate system are you measuring the buffer? If it's in a system where longitude lines are straight 'up', rather than converging towards a point, distortion is around 1/cos(42) in the Catalonia area. That's 670 versus 500. – mkennedy Jul 19 '13 at 17:05
• @mkennedy, the layer CRS is UTM zone 31N, so the buffer units are equivalent to layer CRS? UTM should be in meters, undistorted on the central meridian right? – Tomas Jul 19 '13 at 17:13
• That the ratio 500:650 is approximately the cosine of the latitude is compelling evidence that at some point a calculation is being carried out using Euclidean formulas applied to geographic coordinates. There are really only two possibilities: either the buffers are calculated incorrectly or your evidence of an incorrect calculation is wrong. You seem confident that all computations are being carried out in UTM coordinates, but exactly how have you determined that the buffer has a varying radius? Could you show us a map of your buffer instead of this (useless) generic map of UTM zones? – whuber Jul 19 '13 at 17:32
• I did some rough calculations of planar vs geodesic in the Cap de Creus area. If I calculated north-south lengths based on your buffers in geodesic or planar/2D in UTM 31N, it was around 500m. If I measured a north-south planar distance in "web Mercator", it was around 650 m. – mkennedy Jul 19 '13 at 20:24

I encountered a similar problem and so have logged a QGIS Application issue #9620 for Measure line tool reports incorrect units.

• super, thank you for this! We have some response from QGIS developers now! Seems fixed in 2.2. – Tomas Feb 24 '14 at 8:55

The actual distances are correct! See the picture below.

The Measure Line tool is showing wrong distance! It claims to return distance in meters, while it is in the project CRS units. The project CRS is the classic cylindrical projection (web mercator EPSG:3857).

The Measure Line tool is buggy. It has all the information to compute correct geodetic distance in meters, and it confuses the user to do so by claiming meters; while it does in the CRS units instead.

# EDIT:

Now it is finally possible to measure the correct geodetic distances! Just:

1. Go to Project properties -> CRS -> check "Enable on the fly CRS transformation"
2. Project properties -> General -> Measure tool -> Ellipsoid (for distance calculations) - check if there is reasonable value (like WGS 84 for example)
3. View -> Measure -> Measure line

Now it is working perfectly and I have quite old version! (2.8.2-Wien)

All projections distort either distances, shapes or, more generally, both.

So distance computations using anything but geodetic operations on degree coordinates will always introduce errors. Typically you can find a way to estimate the error and roughly correct the values. Or, in your case, go the other way and figure out how many projection-unit meters will approximate 500 real meters.

Unfortunately, I'm only familiar with the map for correcting Spherical Mercator so I can't help you with your particular UTM.

• Russell, thanks, but I cannot agree with you. There should be no distortions close to the meridian in the middle of the 31N zone, where the transverse mercator is passing. And the rest of the zone is within 3° from the central meridian, which gives distortion max `1/cos(3°) = 1.0014` only! 500 m -> 650 m cannot happen by distortion! There must be some other problem. – Tomas Jul 19 '13 at 16:50
• Distortion at the central meridian is 0.9996, the scale factor of the zone, but that doesn't explain the difference. – mkennedy Jul 19 '13 at 17:03