[postgis-users] Create Polygon from table columns

confugere aginau at googlemail.com
Mon Jun 30 23:40:27 PDT 2014


 This post has NOT been accepted by the mailing list yet.
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 



--
View this message in context: http://postgis.17.x6.nabble.com/Create-Polygon-from-table-columns-tp5006584.html
Sent from the PostGIS - User mailing list archive at Nabble.com.


More information about the postgis-users mailing list