On Wed, 21 Jun 2006, Andreas Ekstrand wrote:
Hi!
I am running a tarball checkout from 26th April and I'm having troubles
loading certain ESRI shape files in Windows (I guess not much has happened to
the ESRIShape plugin since then). In Linux it all works fine. For example,
Countries.shp which can be found at the following URL fails in Windows:
http://ioc.unesco.org/Oceanteacher/OceanTeacher2/07_Examples/MapGIS/ShapeFiles/UTGlobal/
I have tracked down the failure to line 38 in ESRIShape.cpp:
if( (nbytes = ::read( fd, &val, sizeof(T))) <= 0 )
return false;
It seems like ::read fails at point number 73 in the first polygon in
Countries.shp in Windows but not in Linux.
You're reading the file in text mode, when it should be treated as binary.
Microsoft's open() function defaults to reading as text. To read as binary,
you should add _O_BINARY to the open() call in ESRIShapeParser.cpp, line
20. (But this probably needs to be protected by a #ifdef WIN32 block.)
--
____ __ Eric Sokolowsky (GST) NASA Goddard Space Flight Center
/ __/__/_/__ Visualization Programmer Scientific Visualization Studio
/ __/ _/ / _/ 301.286.3751 Mailstop 610.3 Bldg 28 Rm E102
/___/_//_/__/ [EMAIL PROTECTED] Greenbelt, MD 20771
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/