Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Previous step result in a table without geometry. So now add a column called geom with datatype geometry .(via the Query window and the green execute button)

alter table locations add column geom geometry(POINT,4326)

We know that the data is in WGS84 (which has the specific code 4326, see spatialreference.org which gives the full description of the WGS84 projection), so a point geometry with spatial reference id (SRID) 4326 is created.. This step results in the creation of a column called geom.

Update the table with the following query

update locations set geom = st_setsrid(st_point(longitude,latitude),4326)

Pressing the green execute button updates the column geom with a geometry based on the columns longitude and latitude.

This layer can be added to QGIS, please check this in the Workshop PostgreSQL/PostGIS/QGIS.