[Mapserver-dev] Change in maptree.c

Frank Warmerdam warmerdam at pobox.com
Thu Jan 23 13:15:52 EST 2003


Julien-Samuel Lacroix wrote:
> /* --------------------------------------------------------------- */
> /* must check if the 2 first bytes equal 0 of max depth that cannot*/
> /* be more than 65535. If yes, we must swap all value. The problem */
> /* here is if there's no Depth (bite 5,6,7,8 in the file) all bytes*/
> /* will be set to 0. So, we will test with the number of shapes (byte*/
> /* 1,2,3,4) that cannot be more than 65535 too.                    */
> /* --------------------------------------------------------------- */
>      if((pabyBuf[4] == 0 && pabyBuf[5] == 0 &&
>          pabyBuf[6] == 0 && pabyBuf[7] == 0))
>      {
>        psTree->LSB_order = !(pabyBuf[0] == 0 && pabyBuf[1] == 0);
>      }
>      else
>      {
>        psTree->LSB_order = !(pabyBuf[4] == 0 && pabyBuf[5] == 0);
>      }
>      psTree->needswap = ((psTree->LSB_order) != (!bBigEndian));
> 
> 
> My questions are, Is this fix is compatible with other format of .qix 
> files?  Is this fix okay with you? Frank? Steve?
> 
> I saw the parser check for a SQT signature, must we apply it there too?

Julien,

Your fix looks good, but it should not be required for the SQT case.  The
SQT version of the format explicitly stores the byte order information
so it does not have to be guessed.

What isn't the new (SQT) format used all the time now for indexes?

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-dev mailing list