[gdal-dev] read DEM

Chaitanya kumar CH chaitanya.ch at gmail.com
Sat Apr 3 07:09:47 EDT 2010


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 <weixj2003ld at 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 <weixj2003ld at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100403/b0b16a68/attachment.html


More information about the gdal-dev mailing list