Hi!

In response to Andy Lam Yin Cong e-mail about converting a multilinestring to a
polygon, I have created the following command to do the conversion:

ALTER TABLE my_table ADD COLUMN geo_txt TEXT
UPDATE my_table SET geo_txt = ST_AsText(ST_BuildArea(the_geom))
SELECT DropGeometryColumn('public', 'my_table', 'the_geom')
SELECT AddGeometryColumn('public', 'my_table', 'the_geom', 2037, 'POLYGON', 2)
UPDATE my_table SET the_geom = ST_GeomFromText(geo_txt, 2037)
ALTER TABLE my_table DROP COLUMN geo_txt


If there's a better way of doing this, let me know!

Francis
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to