Dear Community,
I would like to create a polygon from
a table containing landsat 8 corner coordinates in wgs84
CORNER_UL_LAT_PRODUCT DOUBLE PRECISION
CORNER_UL_LON_PRODUCT DOUBLE PRECISION
CORNER_UR_LAT_PRODUCT DOUBLE PRECISION
CORNER_UR_LON_PRODUCT DOUBLE PRECISION
CORNER_LL_LAT_PRODUCT DOUBLE PRECISION
CORNER_LL_LON_PRODUCT DOUBLE PRECISION
CORNER_LR_LAT_PRODUCT DOUBLE PRECISION
CORNER_LR_LON_PRODUCT DOUBLE PRECISION
i tried various things and my last effort looked like the following:
UPDATE “sat_l8_mtl”
SET geomz = ST_SetSRID
(ST_MakePolygon(
ST_MakeLine(
ST_MakePoint(“CORNER_UL_LAT_PRODUCT” “CORNER_UL_LON_PRODUCT”),
ST_MakePoint(“CORNER_LL_LAT_PRODUCT” “CORNER_LL_LON_PRODUCT”),
ST_MakePoint(“CORNER_LR_LAT_PRODUCT” “CORNER_LR_LON_PRODUCT”), ST_MakePoint(“CORNER_UR_LAT_PRODUCT” “CORNER_UR_LON_PRODUCT”),
ST_MakePoint(“CORNER_UL_LAT_PRODUCT” “CORNER_UL_LON_PRODUCT”)
)),4326);
Maybe someone can help me out.
Greetings