[postgis-users] Attribute table with coordinates

Regina Obe lr at pcorp.us
Thu May 11 05:52:26 PDT 2023

You should add a PostGIS geometry or geography column as follows

ALTER TABLE name_of_your_table ADD COLUMN geog geography(POINT,4326);

UPDATE name_of_your_table SET geog = ST_SetSRID(ST_Point(X, Y),4326)::geography;

CREATE INDEX ix_name_of_your_table_geog ON name_of_your_table USING gist(geog);

Then you should see this table appear as a layer option in QGIS

> -----Original Message-----
> From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf
> Of Gabriele de Filippo
> Sent: Thursday, May 11, 2023 2:57 AM
> To: postgis-users at lists.osgeo.org
> Subject: [postgis-users] Attribute table with coordinates
> I have a attribute table with X, Y coordinates in a  Postgres database.
> I’m able to read this database and table in Qgis using Postgis extension, but I
> don’t know how use the table such a layer.
> I would use the table such as I use a CSV file in Qgis. Is it possible?
> Thank you
> Gabriele
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users

More information about the postgis-users mailing list