- file must be on same computer as postgres database
- file must be UTF-8, though might be a way to define this as something else in the psql command
CREATE TABLE enumeration(
"id" SERIAL PRIMARY KEY,
"enumerator" TEXT,
"hh_id" TEXT,
"respondent_last" TEXT,
"respondent_first" TEXT,
...
)
COPY enumeration("enumerator", "hh_id", "respondent_last", "respondent_first", ...) FROM '/path/to/file.csv' DELIMITER ',' CSV;
ALTER TABLE enumeration ADD COLUMN geom geometry(POINT,4326);
UPDATE enumeration SET geom = ST_SetSRID(ST_MakePoint(cast(gps_longitude as float),cast(gps_latitude as float)),4326);