I am trying to do a simple query in PostGIS to get the difference of a line from the buffer of another line. The lines are from latLng coordinates but I want the buffer to be in kilometers.
In the image, I show what I am trying to get with ST_Difference.
The following query will not give me the correct answer
SELECT ST_Difference(ST_LineFromText('LINESTRING(-3.444 52.468, -1.165 52.468)'), ST_Buffer(ST_LineFromText('LINESTRING(-1.725 52.330, 0.604 52.330)'), 25000))
and I did not expect it to work, cause I somehow have to define a coordinate system and what this "25000" at the end, means. I tried a lot with ST_Transform and ST_SetSRID but nothing worked. Also, I would like a solution without altering the table or something.. Just a query that would work.