Commit 1a97be40 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

wkt raster

parent 88f706f2
...@@ -82,7 +82,7 @@ def rasterWkt(wkt, inputfile, outputfile): ...@@ -82,7 +82,7 @@ def rasterWkt(wkt, inputfile, outputfile):
driverTiff = gdal.GetDriverByName('GTiff') driverTiff = gdal.GetDriverByName('GTiff')
output = driverTiff.Create(outputfile, cols, rows, 3, gdal.GDT_Byte) output = driverTiff.Create(outputfile, cols, rows, 3, gdal.GDT_Byte)
polygonRaster = driverTiff.Create("polygonTmp.tiff", cols, rows, 1, gdal.GDT_Byte) polygonRaster = driverTiff.Create("polygonTmp.tif", cols, rows, 1, gdal.GDT_Byte)
#Set up polygon raster #Set up polygon raster
...@@ -114,7 +114,7 @@ def rasterWkt(wkt, inputfile, outputfile): ...@@ -114,7 +114,7 @@ def rasterWkt(wkt, inputfile, outputfile):
gdal.RasterizeLayer(polygonRaster, [1], layer, burn_values=[255]) gdal.RasterizeLayer(polygonRaster, [1], layer, burn_values=[255])
polygonRaster.GetRasterBand(1).FlushCache() polygonRaster.GetRasterBand(1).FlushCache()
Draw output image #Draw output image
np_polygon = polygonRaster.GetRasterBand(1).ReadAsArray(0,0,cols,rows) np_polygon = polygonRaster.GetRasterBand(1).ReadAsArray(0,0,cols,rows)
# np_polygon = getPolygonArray(intput, wkt) # np_polygon = getPolygonArray(intput, wkt)
for b in range(1, output.RasterCount+1): for b in range(1, output.RasterCount+1):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment