weixj2003ld, Did you try a different Y offset? May be the data really is zero in the first line. Please give the output of gdalinfo with this file.
On Sat, Apr 3, 2010 at 4:13 PM, weixj2003ld <weixj200...@163.com> wrote: > Thk u for your reply. > Yes,it is Erdas imagine format. > I use the following code to read the data of it,but I find that the value > of it is always 0,I do not know why. > > > float *pafScanline; > int nXSize=poBand->GetXSize(); > pafScanline=(float *)CPLMalloc(sizeof(float)*nXSize); > > poBand->RasterIO(GF_Read,0,0,nXSize,1,pafScanline,nXSize,1,GDT_Float32,0,0); > > Wei > > > > > The file you have is probably in Erdas Imagine format. > Try the command "gdalinfo -stats <dem_file.img>". This will show if you can > open it with GDAL. > > If you want to know how to read the data, refer to > http://www.gdal.org/gdal_tutorial.html > > 2010/4/3 weixj2003ld <weixj200...@163.com> > >> Hi, >> Now I have a dem file (.img),I want to read it with gdal,how to do?I find >> that gdal only read ascii dem,what is means? >> Thk u in advance. >> >> >> >> _______________________________________________ >> gdal-dev mailing list >> gdal-dev@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/gdal-dev >> > > > > -- > Best regards, > Chaitanya kumar CH. > /tʃaɪθənjə/ /kʊmɑr/ > +91-9848167848 > 17.2416N 80.1426E > > > > -- Best regards, Chaitanya kumar CH. /tʃaɪθənjə/ /kʊmɑr/ +91-9848167848 17.2416N 80.1426E
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev