PostGIS – How to Convert 1 Meter to Degrees at Specific Location

coordinate systempostgis

Given a point in EPSG:4326 I need to know how many degrees (approx) 1 meter is at this location using PostGIS. Feels like http://postgis.net/docs/manual-2.1/ST_Line_Interpolate_Point.html is useful here but I cannot figure it out.

Another way to phrase this question is: What is one point (X) here that would give me 1 meter back when running the following query?

  ST_Distance(
   'SRID=4326;POINT(Input point)'::geography,
   'SRID=4326;POINT(X)'::geography) AS geography_distance
   ;

I would happily accept a point in any direction.

Here is the same question but using "FME's Tester"
Converting 1 meter to decimal degrees using FME

Best Answer

You can execute the following query, you can modify coordinates in CTE start_coords :

WITH start_coords AS (SELECT 5 AS long, 40 AS lat),
start_point AS (SELECT *, ST_MakePoint(long, lat)::geography AS geog FROM start_coords)

SELECT
    sp.lat,
    sp.long,
    ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long, sp.lat + 1)::geography
    ) AS one_deg_lat_north,  -- in meters
    1 / ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long, sp.lat + 1)::geography
    ) AS one_meter_lat_north,  -- in degrees
    ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long, sp.lat - 1)::geography
    ) AS one_deg_lat_south,  -- in meters
    1 / ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long, sp.lat - 1)::geography
    ) AS one_meter_lat_south,  -- in degrees
    ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long + 1, sp.lat)::geography
    ) AS one_deg_long_east,  -- in meters
    1 / ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long + 1, sp.lat)::geography
    ) AS one_meter_long_east,  -- in degrees
    ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long - 1, sp.lat)::geography
    ) AS one_deg_long_west,  -- in meters
    1 / ST_Distance(
        sp.geog,
        ST_MakePoint(sp.long - 1, sp.lat)::geography
    ) AS one_meter_long_west  -- in degrees
FROM start_point sp
;