我需要使用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