gis 向量切片讀取 GIS向量切片演算法

2021-10-13 11:32:18 字數 1580 閱讀 5363

structtilestructure

public classvectortiletool

listtiles;publicvectortiletool()

}public bool seprateshplayer(string sourcepath, string resultfolder, intlevel)

osgeo.gdal.gdal.setconfigoption("shape_encoding", "");

osgeo.ogr.ogr.registerall();

osgeo.ogr.driver dr= osgeo.ogr.ogr.getdriverbyname("esri shapefile");if (dr == null)

//建立資料夾

directory.createdirectory(resultfolder + "\\json\\");//針對本專案,劃分第16級,根據地理範圍求出瓦片

int y0 = convert.toint32((90 - layerex.maxy) * math.pow(2, level)/180.0);int x0 = convert.toint32((180 + layerex.minx) * math.pow(2, level)/180.0);int y1 = convert.toint32((90 - layerex.miny) * math.pow(2, level) / 180.0);int x1 = convert.toint32((180 + layerex.maxx) * math.pow(2, level) / 180.0);//20160621 zxq 建立層行列配置檔案

string filepath = resultfolder + "\\json\\" + "\\tile.txt";

filestream fs= newfilestream(filepath, filemode.createnew);

streamwriter sw= newstreamwriter(fs);//寫入層行列

sw.write(level.tostring());

sw.write(",");

sw.write(x0.tostring());

sw.write(",");

sw.write(x1.tostring());

sw.write(",");

sw.write(y0.tostring());

sw.write(",");

sw.write(y1.tostring());

sw.write(",");

sw.write("json");

sw.flush();

sw.close();

fs.close();

tiles= new list();for (int x =x0;x<=x1;x++)

層第行第列瓦塊空shapefile資料", level, x, y);

osgeo.ogr.feature feat;//讀取shp檔案

while ((feat = layer.getnextfeature()) != null)

個要素入shp", id);

}return true;

GIS演算法 柵格與向量轉換

為了將柵格資料分析的結果,通過向量繪圖裝置輸出 資料壓縮的需要 將大量的面狀柵格資料轉換為由少量資料表示的多邊形邊界 主要目的 將自動掃瞄器獲取的柵格資料加入向量形式的資料庫 多邊形邊界提取 採用高通濾波將柵格影象二值化或以特殊值標識邊界點 拓撲關係生成 對於向量表示的邊界弧段資料,判斷其與原圖上各...

GIS演算法 向量(陣列基礎 程式設計基礎)

在程式設計中的應用 有向線段 有一條線段的端點是有先後次序之分的,這條線段即有向線段 directed segment 向量 有限線段p1p2的起點p1在座標原點,把它稱為向量p2 二維向量p x1,y1 q x2,y2 向量加法 p q x1 x2,y1 y2 向量減法 p q x1 x2,y1 ...

切向量,普通向量,漸變

首先,說明稱切向量垂直梯度曲線,這是梯度方向的法向向量方向 設曲線x x t y y t z z t 是曲面u x,y,z c上的一條曲線 c為常數。u x,y,z c表示等高線 因為該曲線在曲面上,所以x x t y y t z z t 滿足方程u x,y,z c,即u x t y t z t c...