[postgis-users] Create Polygon from table columns
Hugues François
hugues.francois at irstea.fr
Mon Jun 30 23:54:09 PDT 2014
Hello,
I would have tried to achieve that in WKT using ST_GeomFromText(wkt,srid) : http://www.postgis.org/docs/ST_GeomFromText.html
You can look at examples to format correctly the WKT string.
But it could be easier to help you if you give us, at least the error message.
Hugues.
-----Message d'origine-----
De : postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at lists.osgeo.org] De la part de confugere
Envoyé : mardi 1 juillet 2014 08:40
À : postgis-users at lists.osgeo.org
Objet : [postgis-users] Create Polygon from table columns
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.
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list