[mapserver-users] shptree bug and RFI

Frank Warmerdam warmerdam at pobox.com
Tue Jan 22 11:52:05 EST 2002


Folks,

DM Solutions Group was encountering a bug with how the byte order of .qix
files was detected but only in a small fraction of files.  In BugZilla I
wrote:

> I have applied a fix to maptree.c.  The logic to establish if a .qix file
> was MSB or LSB was to inspect the first byte and check if it was zero.  The
> assumption was that if it was zero it was the high order byte of the shape 
> count (and hence MSB). but of course even on LSB system the low order byte
> is 0 in about 1 in 256 times. 
>
> I modified the maptree open code to look at the first two bytes of the 
> "maximum depth" value in the header.  If this is zero it is assumed to be
> MSB otherwise LSB.  This is based on the assumption that maximum depth is
> always between 1 and 65535.  Given that typical values are in the range of
> 4-15 I think it is OK. 

Also, because I had some trouble figuring out how shptree, and the related
utilities work, I wrote up a few notes on them, and posted it on the wiki.  
I would appreciate it if Steve Lime, or Carl Anderson would add a little 
information about the old vs. new index format and any hints for usage. 

  http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?ShpTree

I have also created a general utilities node in the Wiki with links to this
and some other utilities.  I encourage others to add more detailed notes on
the utilities in the Wiki as the online documentation for them is generally
sparse at this time. 

  http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?UtilityInfo

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




More information about the mapserver-users mailing list