You could cast your geometry
to geography
and ST_Project
it (in the azimuth you want). Doing so you can easily provide the distance in meters:
CREATE TEMPORARY TABLE test_table (name text, geo geometry(point,(32636)));
INSERT INTO test_table VALUES ('foo','SRID=32636;POINT(2076155.32235105 4828109.18280588)');
SELECT
ST_AsText(
ST_Transform(
ST_Project(
ST_Transform(geo,4326)::geography,10,radians(45.0))::geometry,
32636)
)
FROM test_table;
st_astext
------------------------------------------
POINT(2076150.11319696 4828116.26815917)
(1 Zeile)
You can check the distance using ST_Distance
:
SELECT
ST_Distance(
ST_Transform(geo,4326)::geography,
ST_Project(ST_Transform(geo,4326)::geography,10,radians(45.0))::geometry )
FROM test_table;
st_distance
-------------
10
NOTE: I'm using ST_Transform
to get from your projected SRS to a lon/lat SRS, so that we can cast it to geography
, otherwise we'd get an error:
SELECT geo::geography FROM test_table;
ERROR: Only lon/lat coordinate systems are supported in geography.
Further reading: Caculate point 50 miles away (North, 45% NE, 45% SW)