• Ivy Seo

Geometry point - postgis



// add geom column
cmd.CommandText = "alter table m7_data_table add column geom geometry(point,4326)";
 cmd.ExecuteNonQuery();
// update geom column -- combine lon and lat
cmd.CommandText = "UPDATE m7_data_table SET geom = ST_SetSRID(ST_Makepoint(Lat,Lon),4326) where geom isnull";
cmd.ExecuteNonQuery();


** to use geometry:

> CREATE EXTENSION IF NOT EXISTS postgis;";