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

Johan de Koning johan.de.koning at geodan.nl
Sun May 8 22:40:53 PDT 2005


Hello,

Still having some problems with the WKB (Well Known Binary) format. I don't
understand how the coordinates of the points are stored. I understand the
start of the WKB (for example) 

01030000800100000005000000...

The 01 is for the Endean bit. 0300080 stands for a Polygon (the 8 is what i
believe the third dimension). 01000000 is that the polygon has one ring.
05000000 are the five points which are in this ring.

Then for the coordinates of the points. If the x,y,z are all 0 the value is
of course

0000000000000000	(x)
0000000000000000	(y)
0000000000000000	(z)

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? 

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.

Thanx for your help.

Johan de Koning

-----Oorspronkelijk bericht-----
Van: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] Namens Bart van den
Eijnden
Verzonden: woensdag 4 mei 2005 21:32
Aan: PostGIS Users Discussion
Onderwerp: Re: [postgis-users] Code for reading WKB C++

Johan,

QGIS probably has some code for this.

www.qgis.org

Best regards,
Bart

On Wed, 04 May 2005 14:38:53 +0200, Johan de Koning  
<johan.de.koning at geodan.nl> wrote:

> Hello,
>
> Anybody knows if there is some code which extracts the different part of  
> a Well Known Binary Format. I want to use the WKB data of the polygons  
> stored in postgis in my c++ program. I looked at the gdal/ogr libary but  
> this is much to complex and big to use. I want to use WKB with polygons  
> which are using the z coordinate.
>
> Bye
>
> Johan de Koning
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users







More information about the postgis-users mailing list