Guest User

Untitled

a guest
Nov 20th, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. select freguesia, count(taxi_stands.id) from taxi_stands, cont_aad_caop2017 where st_contains(geom,location) group by 1 order by 2 DESC;
  2.  
  3.  
  4. select freguesia, count(*) from taxi_services, cont_aad_caop2017 where st_contains(geom,final_point) group by 1 order by 2 DESC;
  5.  
  6. import psycopg2
  7. import turtle
  8.  
  9. conn=psycopg2.connect("dbname=guest user=guest password=guest")
  10. cur=conn.cursor()
  11.  
  12. centrox=-8.6223466370208
  13.  
  14. centroy=41.1603709427206
  15.  
  16. cur.execute("select st_x(st_transform(location,3763)),st_y(st_transform(location,3763)) from taxi_stands;")
  17. row=cur.fetchone()
  18.  
  19.  
  20. turtle.clear()
  21. while(row is not None):
  22. print(row)
  23. turtle.pendown()
  24. turtle.goto(row[0]-centrox,row[1]-centroy)
  25. turtle.penup()
  26. row=cur.fetchone()
  27.  
  28.  
  29. '''
  30. while row is not None:
  31. print(row)
  32. row=cur.fetchone()
  33. '''
  34. cur.close()
Add Comment
Please, Sign In to add comment