I need to output my numpy array as a raster so that someone else can access the data in ArcGIS. So basically the steps I need are: read numpy array into gdal convert to raster use latitude and longitude and array size to set projection
I am really struggling with gdal because I can't seem to find enough documentation about each step to understand what it is doing. Here are some of the steps I think I need: myarray=myarray #the extent and shape of my array xmin,ymin,xmax,ymax=[139.8,-39.2,150.0,-33.6] ncols,nrows=[193,106] xres=(xmax-xmin)/float(ncols) yres=(ymax-ymin)/float(nrows) geotransform=(xmin,xres,0,ymax,0, -yres) from osgeo import gdal from osgeo import gdal_array src_ds=gdal_array.OpenArray(myarray) dst_ds = gdal.GetDriverByName('GTiff').Create('E:/test/rasterise/mynewraster.tif',ncols, nrows, 1 ,gdal.GDT_Byte) dst_rb = dst_ds.GetRasterBand(0) dst_ds.SetGeoTransform(geotransform) output = gdal.RasterizeLayer(dst_ds)
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev