Having trouble creating geom columns and inserting geometry lat lng values into postgres table
- Is my syntax correct in creating the point geometry fields? st_makepoint is the point constructor. when I create the column should I be using that?
- or should I be using the st_makepoint when inserting into the column?
*python 2.7
conn = psycopg2.connect("connected")
cur.execute('''CREATE TABLE example(pgeom geometry(POINT, 4326),
dgeom geometry(POINT, 4326));''')
for x in csvfile:
extracting info...
1geom = lng1+lat1 #int values
2geom = lng2+lng2 #int values
query = '''insert into example(geom1, geom2) values (%s,%s);'''
data = (1geom, 2geom)
cur.execute(query, data)
conn.commit()
cur
.