我想獲得積分,使用psychopg2
下面的代碼執行成功我multipolygons的所有頂點......多邊形頂點LAT在python/LON使用psycopg2
cur = conn.cursor()
cur.execute("""SELECT ST_DumpPoints(ST_AsText(geom)) from dry_overlay""")
rows = cur.fetchall()
print "\nShow me the databases:\n"
for row in rows:
print " ", row[0]
,但它產生的輸出,看起來像這樣:
("{1,1,1}",0101000000F3071C3FF0E04241C729FC3E2C735A41)
("{1,1,2}",01010000009C700A93FFDF4241DA0BBD6283725A41)
("{1,1,3}",01010000001BC9122701E04241C2D848ED2C735A41)
("{1,1,4}",0101000000325487970FE04241FF279CE92C735A41)
("{1,1,5}",0101000000B188A3F06FE042414A73142B2C735A41)
("{1,1,6}",0101000000F3071C3FF0E04241C729FC3E2C735A41)
("{1,1,1}",010100000019D5589E634D4341B7E69817C2875A41)
("{1,1,2}",010100000042AEF52E2E4D43418CD52A53C1875A41)
("{1,1,3}",01010000006D4CBA551F4D43411EBEF35CC1875A41)
("{1,1,4}",0101000000D92F2F601F4D43413AD9BADAB9875A41)
("{1,1,5}",0101000000AF1860920F4D43410E00CDDBB9875A41)
我知道第二個元素是WKT,但是如何將其轉換爲緯度/經度座標?我以爲ST_AsText()
會執行此功能