我需要使用python從「postgis」數據庫(postgresql)可視化空間數據(20多邊形)。我知道如何連接postgresql數據庫與Python,但我不知道如何可視化這些多邊形。這是我的大學的項目。我們需要使用例如matplotlib並在python中創建應用程序,它將從postgresql數據庫中可視化shapefile(.shp)。postgresql和python
我開始使用此代碼,但我不知道如何繼續:
import psycopg2
conn = psycopg2.connect("dbname='***' user='***' host='***' password='***'")
print 'Succesfully connected'
cur = conn.cursor()
cur.execute("""SELECT astext(the_geom) from buildings;""")
listpoly = cur.fetchall()
conn.close()
你可以寫更多關於matplot lib嗎?是否足以在python中可視化多邊形? – boofighter 2009-11-21 19:47:58