'ST_Buffer distance units

Hello I used the ST_Buffer to set a 5 kilometre buffer with this code:

CREATE TABLE Buf_5km_Schiff as
SELECT ST_Buffer(geom, 0.05) 
FROM public."Input_Schifffahrtswege";

It works but im not sure why I need to set 0.05 for 5 kilometres. I tried 5 and 5000 at first but it did not work.

Btw. I used the EPSG 4258 Coordinate System.

Thx in advance!



Solution 1:[1]

EPSG:4258 is in degrees. You will have to transform to some metric projection to use the buffer setting you are expecting. You could try EPSG:3857 by wrapping your geometry column into ST_Transform(geom, 3857) and then calling ST_Buffer but note that 3857 will give you a approximation but there will be more suitable projections to improve the result.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Timothy Dalton