[postgis-users] Code for reading WKB C++

Markus Schaber schabi at logix-tt.com
Mon May 9 01:16:44 PDT 2005


Hi, Johan,

Johan de Koning wrote:

> I split here the value to give a better view. When the coordinates are
> (0,1,0) the values are 
> 
> 0000000000000000	(x)
> 000000000000F03F	(y)
> 0000000000000000	(z)
> 
> But I don't see any relation for the y value with the number 1. I looked at
> the example code for the bitwise operations but could not get this value
> converted. Should I convert it to binary first or decimal? 

You should look at the IEEE double precision floating point
specification. The values are in this format. On most platforms, the
native "Double" format should be the same (8 bytes).

> Can anybody give me some explanation about how the WKB coordinates are
> stored. Or a website with more information. The OGC has something written in
> the SQL specification but nothing about the storage of the coordinates.

Actually, the OGC "Simple features for SQL" spec includes the WKB spec,
but they simply say that the ordinates are to be stored in IEEE floating
point format.

Hth,
Markus




More information about the postgis-users mailing list