Skip to main content
remove ref to documentation for addgeometrycolumn (not used in this answer)
Source Link
anneb
  • 1.5k
  • 12
  • 13

Newer versions of PostGIS allow the following, slightly more common, syntax:

ALTER TABLE your_table ADD COLUMN geom geometry(Point, 4326);

Then use ST_SetSrid and ST_MakePoint to populate the column:

UPDATE your_table SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);

See documentation here:

Newer versions of PostGIS allow the following, slightly more common, syntax:

ALTER TABLE your_table ADD COLUMN geom geometry(Point, 4326);

Then use ST_SetSrid and ST_MakePoint to populate the column:

UPDATE your_table SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);

See documentation here:

Newer versions of PostGIS allow the following, slightly more common, syntax:

ALTER TABLE your_table ADD COLUMN geom geometry(Point, 4326);

Then use ST_SetSrid and ST_MakePoint to populate the column:

UPDATE your_table SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);

See documentation here:

Newer versions of PostGIS allow the following, slightly more common, syntax:

alterALTER tableTABLE your_table addADD columnCOLUMN geom geometry(Point, 4326);

Then use st_SetSridST_SetSrid and st_MakePointST_MakePoint to populate the column:

updateUPDATE your_table setSET geom=st_SetSridgeom = ST_SetSRID(st_MakePointST_MakePoint(longitude, latitude), 4326);

See documentation here:

Newer versions of PostGIS allow the following, slightly more common, syntax:

alter table your_table add column geom geometry(Point, 4326);

Then use st_SetSrid and st_MakePoint to populate the column:

update your_table set geom=st_SetSrid(st_MakePoint(longitude, latitude), 4326);

Newer versions of PostGIS allow the following, slightly more common, syntax:

ALTER TABLE your_table ADD COLUMN geom geometry(Point, 4326);

Then use ST_SetSrid and ST_MakePoint to populate the column:

UPDATE your_table SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);

See documentation here:

Source Link
anneb
  • 1.5k
  • 12
  • 13

Newer versions of PostGIS allow the following, slightly more common, syntax:

alter table your_table add column geom geometry(Point, 4326);

Then use st_SetSrid and st_MakePoint to populate the column:

update your_table set geom=st_SetSrid(st_MakePoint(longitude, latitude), 4326);