2011-03-18

QGIS 結合postgresql 進行sql查詢工作

QGIS本身查詢功能尚未完整
若需使更完整之SQL 語法
現階段需要配合postgresql 進行
以下說明相關步驟

1.安裝QGIS
2.安裝postgresql
同時安裝POSTGIS 套件

完成後 在QGIS 中安裝 POSTGIS manager 套件
將圖資載入postgis中 使用import shpfile to postgresql

以world.shp為例
當將圖資載入postgresql 後
開啟 POSTGIS manager 介面點選SQL windows
在sql query 中輸入 下列內容
select "Continent",sum( "area")/1000000 as area from "public"."world2"
group by "Continent"
即可獲得
各大洲 面積計算成果
在sql中輸入下列資訊即可獲得 各大洲總人口與總面積資訊
select "Continent",sum("Pop_1994") as people ,sum( "area")/1000000 as
area from "public"."world2" group by "Continent"

沒有留言:

張貼留言

QGIS Raster to Vector use Python console step2

資料處理步驟: 1.讀取 Raster 並計算 25 等級等值線級距 2.用 GDAL 產生等值線(Contour Lines) 3.Polygonize:Raster 轉等值面多邊形 4.將多邊形圖層載入 QGIS 5.為每個 polygon 計算其 VALUE 所屬級距(LE...