Commit 5a638f51 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

wkt raster

parent d041db99
......@@ -51,13 +51,12 @@ def getPolygonArray(image, wkt):
layer = data_source.CreateLayer("wkt", srs, ogr.wkbPolygon)
geometry = ogr.CreateGeometryFromWkt(wkt)
feature = ogr.Feature(layer.GetLayerDefn())
feature.SetStyleString("PEN(c:#FF0000,w:5px);")
# feature.SetStyleString("PEN(c:#FF0000,w:5px);")
feature.SetGeometry(geometry)
layer.CreateFeature(feature)
# layer = data_source.GetLayer()
gdal.RasterizeLayer(polygonRaster, [1], layer, burn_values=[255])
# gdal.RasterizeLayer(polygonRaster, [1], layer, burn_values=[255])
polygonRaster.GetRasterBand(1).FlushCache()
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