I have an existing table in postgres which contains a plain old posgresql polygon. I have added a new column using
SELECT AddGeometryColumn ('public','fences','geom',4326,'POLYGON',2);
I would like to populate this GIS column with the polygon data from the existing column.
The existing column is called poly and the data looks like the following:
"((-74.026142,40.636264),(-74.026142,40.636438),(-74.025818,40.636438),(-74.025818,40.636264),(-74.026142,40.636264))"
Is there a query I can run that will pull that poly field convert it to a postgis polygon and insert it into the new geom column?
ST_GeomFromText
. See alsoregexp_replace