Re: [gdal-dev] numpy array to raster

2012-02-01 Thread questions anon
Thanks for responding Anton, I have been playing with the datatype but so far it hasn't fixed the problem. Also I do have access to ArcGIS to check the output. I will keep trying, this is where I am at currently: from osgeo import gdal from osgeo import gdal_array from osgeo import osr myarray=my

Re: [gdal-dev] numpy array to raster

2012-02-01 Thread Anton Korosov
Probably the problem is with data type. You obviously have data of float type and you give GDT_Byte to the gdal.GetDriverByName('GTiff').Create(). Either try to create array with Byte data or give GDT_Float32. In the latter case the produced geotiff will have 32 bits fo each pixel. It is not sup

Re: [gdal-dev] numpy array to raster

2012-01-31 Thread questions anon
no I quickly checked that! myarray is: [[ 16.15035553 16.14380074 16.15581551 ..., 18.06388149 18.08930645 18.08825245] [ 16.2154911 16.21180592 16.23977184 ..., 18.1085537 18.12040272 18.12342682] [ 16.32851467 16.29202938 16.28964043 ..., 18.16753635 18.14905453 18.166329

Re: [gdal-dev] numpy array to raster

2012-01-31 Thread Kyle Shannon
Is 'myarray' full of zeros? /** * * Kyle Shannon * ksshan...@gmail.com * */ On Tue, Jan 31, 2012 at 19:20, questions anon wrote: > thanks Frank, following your instructions with: > > src_ds=gdal_array.OpenArray(myarray) > dst_ds = > gdal.GetDriverByName('GTiff').Create('E:/test/rasterise/

Re: [gdal-dev] numpy array to raster

2012-01-31 Thread questions anon
thanks Frank, following your instructions with: src_ds=gdal_array.OpenArray(myarray) dst_ds = gdal.GetDriverByName('GTiff').Create('E:/test/rasterise/mynewraster.tif',ncols, nrows, 1 ,gdal.GDT_Byte) dst_ds.SetGeoTransform(geotransform) dst_ds.GetRasterBand(1).WriteArray(myarray) I do not receive a

Re: [gdal-dev] numpy array to raster

2012-01-31 Thread Frank Warmerdam
On Tue, Jan 31, 2012 at 4:38 PM, questions anon wrote: > 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 projecti

[gdal-dev] numpy array to raster

2012-01-31 Thread questions anon
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