[gdal-dev] Working with NED elevation data - part 2

Stephen Woodbridge woodbri at swoodbridge.com
Mon Aug 23 16:30:04 EDT 2010


On 8/23/2010 3:05 PM, Even Rouault wrote:
> Le lundi 23 août 2010 05:28:17, Stephen Woodbridge a écrit :
>> Even,
>>
>> It seems the adding:
>>
>> #include<cpl_conv.h>
>>
>> resolves the segv issue.
>
> Strange, I think there's no particular good reason why it worked with GTiff and
> not VRT. I assume you compile on a 64bit platform and that without header the
> return type was assumed to be of integer type, thus leading to pointer
> trucation.

Yes, good point, this was on a 64bit platform. and I did get a compiler 
warning about incompatible types which was not obvious as to why from 
reading the docs.

I suspect the the tiff worked because it was much smaller coverage than 
the vrt file so the line buffer would have to have been significant 
larger for the vrt file like causing the truncation, or something similar.

-Steve

>>
>> I would recommend changing the example in:
>>
>> http://www.gdal.org/gdal_tutorial.html
>>
>> To include that in the section "Reading Raster Data" because the example
>> C code uses CPLMalloc(). It would also be very helpful to add:
>>
>> ...
>> CPLFree(pafScanline);
>
> Done



More information about the gdal-dev mailing list