[gdal-dev] Strategies for non-standard ascii format drivers

Frank Warmerdam warmerdam at pobox.com
Tue Feb 5 21:25:26 EST 2008


Reed Copsey, Jr. wrote:
> 1) Pre-parse the entire file to get the line starting locations (ie: 
> fill in panLineOffset[] in advance).  This has the advantage of allowing 
> the files to be very large, since it's not loading large amounts of data 
> into memory, but would, for practical purposes, mean reading the entire 
> file twice.  I can think of some tricks that could be done to reduce the 
> number of reads if the entire raster isn't requested, but it would still 
> probably require reading most of the file 2x.
> 
> 2) Read the file into memory and store the image in memory.  This really 
> restricts the size of file that could be read in, since it'd require the 
> entire image to be held in memory.
> 
> 3) Read in the file upside down as it is now, and try to adjust the 
> georeferencing to match and handle the flipping.  This might be the most 
> elegant approach, since it'd make the driver more "standard" like the 
> other drivers.

Reed,

Option (3) would likely be the simpliest and most efficient.  The only
downside is that at least a few applications are going to be confused
by images that appear to be in bottom to top orientation (ie
geotransform[5] is positive instead of the usual negative).

Option (1) is what I would do if I were trying to resolve the problem.
But if you do option (1) please be sure only to do the file scan when
actual image data is requested.  No point in the open operation being
very expensive.

Lastly, if you are going to do work on these drivers, please do it against
the code in trunk, not the 1.5.0 release.  There have been a bunch of tweaks
and I don't want this getting lost in a patch.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list