0
I’m doing a file conversion shapefile for crawl, using a Python script and the GDAL library.
For this I use two functions:
The function
gdal.rasterizeOptions
(put the output options of my die in raster).Function
gdal.Rasterize
(function that will Rasterize my shapefile effectively).
However, my code does not run. Does anyone know if I am passing the wrong function parameters?
from osgeo
import gdal
from osgeo import ogr
dado_saida = 'C:\Lilian\_fabio\criando-aplicacao-conversao\python\pre\saida.tif'
dado_entrada = 'C:\Lilian\_fabio\criando-aplicacao-conversao\python\pre\grid_pontos_1.shp'
data = ogr.Open(dado_entrada)
rasterizeOptions=gdal.RasterizeOptions(options=[], format='Gtiff',creationOptions = None, noData=None,initValues = None, outputBounds = None, outputSRS = None,width = None, height = None, xRes= 1, yRes= 1, targetAlignedPixels = False,bands = None, inverse = False, allTouched=True,burnValues = None, attribute='Z', useZ = False, layers = None,SQLStatement='select Z, * from saida',SQLDialect = None, where = None, callback=None, callback_data=None)
gdal.Rasterize(dado_entrada, dado_saida, options=rasterizeOptions)
important detail: avoid using
\
to separate directories, even in windows - why several combinations of\
one more character can generate a different character. For example\n
internally becomes a single character with code 16 decimal.– jsbueno
(in Python you can normally use the
/
to separate directories, even if in windows)– jsbueno