Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select freguesia, count(taxi_stands.id) from taxi_stands, cont_aad_caop2017 where st_contains(geom,location) group by 1 order by 2 DESC;
- select freguesia, count(*) from taxi_services, cont_aad_caop2017 where st_contains(geom,final_point) group by 1 order by 2 DESC;
- import psycopg2
- import turtle
- conn=psycopg2.connect("dbname=guest user=guest password=guest")
- cur=conn.cursor()
- centrox=-8.6223466370208
- centroy=41.1603709427206
- cur.execute("select st_x(st_transform(location,3763)),st_y(st_transform(location,3763)) from taxi_stands;")
- row=cur.fetchone()
- turtle.clear()
- while(row is not None):
- print(row)
- turtle.pendown()
- turtle.goto(row[0]-centrox,row[1]-centroy)
- turtle.penup()
- row=cur.fetchone()
- '''
- while row is not None:
- print(row)
- row=cur.fetchone()
- '''
- cur.close()
Add Comment
Please, Sign In to add comment