Skip to content

Instantly share code, notes, and snippets.

@kevinmcmahon
Last active December 15, 2019 23:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinmcmahon/1584721 to your computer and use it in GitHub Desktop.
Save kevinmcmahon/1584721 to your computer and use it in GitHub Desktop.
Create a PostgreSQL table to hold the Individual_Landmarks.csv data
CREATE TABLE landmarks
(
gid serial NOT NULL,
name character varying(50),
address character varying(50),
date_built character varying(10),
architect character varying(50),
landmark character varying(10),
latitude double precision,
longitude double precision,
the_geom geometry,
CONSTRAINT landmarks_pkey PRIMARY KEY (gid),
CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
CONSTRAINT enforce_geotype_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL),
CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 4326)
);
CREATE INDEX landmarks_the_geom_gist
ON landmarks
USING gist
(the_geom );
@atiwari87
Copy link

I think lat and long are missing from this file , add these two lines before line 10:
latitude double precision,
longitude double precision,

@annalisapg
Copy link

I agree with atiwari87: in fact, when importing data from csv file, postgres says these columns are missing

@kevinmcmahon
Copy link
Author

Thanks @atiwari87 & @annalisapg. This has been updated (finally! 😄 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment