[Gdal-dev] Anything changed on reading Geo-Information from G eoTiff?

Winkler, Roland RWinkler at DEFiNiENS.com
Wed Nov 19 06:09:09 EST 2003


I debugged now GDALReadWorldFile() and I finally I found whats wrong with
this .tfw file. The .tfw has after the 6.line containing the last
coordintate another line containing something at the first position. If I
remove this line everything works fine and I get the correct coordinates. I
don't know if this .twf file is simply shitty, but on the other hand the
older version of gdal could read it correctly 

The problem isn't the atof in GDALReadWorldFile(), it's the CPLReadLine
which already reads this coordintates without the "-". For this 5.line the
file pointer in *CPLFGets is positioned after the "-" an therefore it isn't
read. If you place there any number this will be skipped, because the
filepointer isn't corrrect. While reading the first time the file into the
pszBuffer I saw the value -83 was read for this last position. Maybe it is
really a problem on the different linefeeds on Linux that you can't
reproduce.

Was anything changed on the reading from a stream recently?

Just tell me if you need more informations. For me it's ok now, because with
the edited file the image works, so I didn't examine what happend in detail
with the file pointer positions. 

best regards
roland

> -----Original Message-----
> From: Winkler, Roland [mailto:RWinkler at definiens.com] 
> Sent: Dienstag, 18. November 2003 18:04
> To: 'gdal-dev at remotesensing.org'
> Subject: RE: [Gdal-dev] Anything changed on reading 
> Geo-Information from G eoTiff?
> 
> 
> I just tested my .tfw with an arbitrary tif image and
> I still have the described problems. I don't believe that I have 
> something in my environment, because three people experienced 
> the problem on there machines before I got aware of this. I'm 
> working with MS Visual C++ 6.0 on XP and but this shouldn't 
> be a problem. Maybe it's the build. I took a 
> csv snapshot some time ago.
> 
> I will debug into gdal/gcore/gdal_misc.cpp tomorrow  
> and have a closer look. 
> 
> regards
> Roland
> 
> > -----Original Message-----
> > From: Frank Warmerdam [mailto:warmerdam at pobox.com]
> > Sent: Dienstag, 18. November 2003 17:39
> > To: gdal-dev at remotesensing.org
> > Subject: Re: [Gdal-dev] Anything changed on reading 
> > Geo-Information from G eoTiff?
> > 
> > 
> > Winkler, Roland wrote:
> > > I attched the output of gdalinfo and also the .tfw file of
> > the tiff.
> > > Unfortunately I don't know the "listgeo"-tool.
> > > 
> > > I could also provide the image, but it's 75MB after
> > compressing still
> > > 20MB, pretty to much for putting it into bugzilla. After 
> creating a
> > > subset with erdas or even with the older gdal version this 
> > problem is
> > > vanished.
> > > 
> > > If you are still interested in the image I could put it on our
> > > ftp-server or burn it on a CD and send this CD via mail.
> > 
> > Roland,
> > 
> > That's pretty funky.  The x offset sign in your gdalinfo
> > output does indeed seem to be wrong for no apparent reason.  
> > I created a simple little tiff file and tried it with your 
> > .tfw file and gdalinfo and I got correct (negative x offset) 
> > output, so the problem would appear to be related to either 
> > your specific version of GDAL (that is CVS "head" seems 
> > fine), or something in your environment (I tested on Linux 
> > with the default "C" lang environment).
> > 
> > If you are able to debug into your build of GDAL try stepping into
> > GDALReadWorldFile() (in gdal/gcore/gdal_misc.cpp) and see
> > what is going wrong. It is as if the atof() there is going 
> > wrong, or perhaps for some reason the
> > CSLLoad() is cutting off a character in the x offset line.
> > 
> > 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    | Geospatial 
> > Programmer for Rent
> > 
> > 
> > _______________________________________________
> > Gdal-dev mailing list
> > Gdal-dev at remotesensing.org
> > http://remotesensing.org/mailman/listinfo/gdal> -dev
> > 
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at remotesensing.org 
> http://remotesensing.org/mailman/listinfo/gdal> -dev
> 



More information about the Gdal-dev mailing list