I have a binary image. I convert this image to GeoTiff image by python funntion:
def exportGeotiff(filename, raster, row, col, xResolution, minLon, minLat, yResolution,geoReference):
format = "GTiff"driver = gdal.GetDriverByName( format )dst_ds = driver.Create(filename, col, row, 1, gdal.GDT_Byte )# top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolutiondst_ds.SetGeoTransform( [ minLon, xResolution, 0, minLat, 0, yResolution ] )# set the reference info srs = osr.SpatialReference()srs.SetWellKnownGeogCS(geoReference)dst_ds.SetProjection( srs.ExportToWkt() ) dst_ds.GetRasterBand(1).WriteArray(raster)When i view the result image on Qgis desktop the is one value pixel of image is 0. But when I read the result image and print the array value the are two value of pixel: 0 and 1 . Anyone can help me for this issue . Thanks
أكثر...
def exportGeotiff(filename, raster, row, col, xResolution, minLon, minLat, yResolution,geoReference):
format = "GTiff"driver = gdal.GetDriverByName( format )dst_ds = driver.Create(filename, col, row, 1, gdal.GDT_Byte )# top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolutiondst_ds.SetGeoTransform( [ minLon, xResolution, 0, minLat, 0, yResolution ] )# set the reference info srs = osr.SpatialReference()srs.SetWellKnownGeogCS(geoReference)dst_ds.SetProjection( srs.ExportToWkt() ) dst_ds.GetRasterBand(1).WriteArray(raster)When i view the result image on Qgis desktop the is one value pixel of image is 0. But when I read the result image and print the array value the are two value of pixel: 0 and 1 . Anyone can help me for this issue . Thanks
أكثر...