[postgis-users] WKB and WKT

chodgson@refractions.net chodgson@refractions.net
Wed Jun 4 14:57:01 2003


Regardless of how you talk to PostGIS, either in WKT or WKB, it stores the data 
internally as a blob of binary data. Transferring the data out of the database 
and to a client (or vice versa) is clearly much faster in WKB as it is much 
smaller for the same geometry. Mapserver reads data from PostGIS using WKB for 
just this reason.

The benefit of the WKT format is that it is "human readable" (I guess). It is 
much easier to generate/parse WKT with whatever language you like (and it is 
especially easier to debug the code that does this) than with WKB.

But the performance of the PostGIS database itself will be the same, regardless 
of how you get the data into or out of the system.

Chris

Quoting "Christina Biakowski (CCGIS)" <christina.biakowski@ccgis.de>:

> Hello,
> the advantages/disadvantages of the different formats for storing geometries
> are not quite clear to me.
> I have started with Postgis (associated with UMN Mapserver) recently and up
> to now I am using the WKT format. What about the advantages of the different
> formats? I guess WKB needs less disk space and might be better in
> performance? Does the WKB format work with the implemented OpenGis-functions
> and UMN Mapserver?
> 
> Thanks a lot in advance!
> 
> Best regards,
> Christina
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>