[postgis-users] creating points from polygons, storing all attributes

Derek Watling derek at cmainfo.co.za
Thu Jul 4 04:54:30 PDT 2019


CREATE TABLE NewPointLayer AS SELECT *, ST_PointOnSurface(the_geom)::geometry(Point,32632) AS the_geom FROM OldPolygonLayer

From: postgis-users <postgis-users-bounces at lists.osgeo.org> On Behalf Of paul.malm at lfv.se
Sent: Thursday, 04 July 2019 13:47
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] creating points from polygons, storing all attributes

Hi,
I would like to create a point table from a polygon table. One point in each polygon
Query = CREATE TABLE NewPointLayer AS SELECT ST_PointOnSurface(the_geom)::geometry(Point,32632) AS the_geom FROM OldPolygonLayer

But how do I write the query to get all the attributes from OldPolygonLayer to the NewPointLayer?

Thanks in advance,
Paul


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190704/c166aa3a/attachment.html>


More information about the postgis-users mailing list