Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import psycopg2
  2.  
  3. conn = psycopg2.connect(dbname = 'gis02', host= '127.0.0.1', user = 'gis2user',password= '123456')
  4. cur = conn.cursor()
  5.  
  6. pointA={}
  7. pointA['lat']=-7.83753572095
  8. pointA['lon']=110.354612964
  9.  
  10. myquery = 'SELECT ST_AsText(ST_MakePoint(%s, %s)) ;'
  11. pointA['geom']= cur.execute(myquery %(pointA['lat'], pointA['lon'])).fetchone()
  12.  
  13. AttributeError: 'NoneType' object has no attribute 'fetchone'
  14.  
  15. POINT(-7.83753572095 110.354612964)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement