Commit 809a6571 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

wkt raster

parent 5cb902ca
...@@ -71,7 +71,12 @@ def getPolygonArray(image, wkt_geom): ...@@ -71,7 +71,12 @@ def getPolygonArray(image, wkt_geom):
#Burn Polygon #Burn Polygon
gdal.RasterizeLayer(polygonRaster, [1], rast_mem_lyr, burn_values=[255]) err = gdal.RasterizeLayer(polygonRaster, [1], rast_mem_lyr, burn_values=[255])
if err != 0:
print(err)
gdaltest.post_reason( 'got non-zero result code from RasterizeLayer' )
return 'fail'
polygonRaster.GetRasterBand(1).FlushCache() polygonRaster.GetRasterBand(1).FlushCache()
np_polygon = polygonRaster.GetRasterBand(1).ReadAsArray(0,0,cols,rows) np_polygon = polygonRaster.GetRasterBand(1).ReadAsArray(0,0,cols,rows)
......
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