1
GDALはPythonでポリゴン化して空白のポリゴンを作成しますか?
PythonでPolygonize関数を使用すると問題が発生します。このためのクックブックの例はここにあります。 私のコードの関連部分は次のとおりです。 sourceRaster = gdal.Open('myraster.tif') band = sourceRaster.GetRasterBand(1) bandArray = band.ReadAsArray() outShapefile = "polygonized" driver = ogr.GetDriverByName("ESRI Shapefile") if os.path.exists(outShapefile+".shp"): driver.DeleteDataSource(outShapefile+".shp") outDatasource = driver.CreateDataSource(outShapefile+ ".shp") outLayer = outDatasource.CreateLayer("polygonized", srs=None) gdal.Polygonize( band, None, outLayer, -1, [], callback=None ) outDatasource.Destroy() sourceRaster = None 私はバンドに関連情報があることを知っています、ここにスニペットがありbandArrayます: array([[ 4., 4., 3., 3., 3., 2., 2., …