[postgis-users] where has the wkb type gone?

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Tue Aug 23 02:03:52 PDT 2005


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Richard Taylor
> Sent: 22 August 2005 22:11
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] where has the wkb type gone?
> 
> 
> Hi
> 
> I am converting a Python library from a rather old version of postgis to
the 
> latest release. The library relies upon the oid of the columns returned
from 
> a select query to know whether the data is in WKT or WKB. The type oid
used 
> to be 'wkb' for a WKB return and 'geometry' for a WKT return.  At some
point 
> during the development of postgis the 'wkb' type has been removed. 
> 
> Is there anyway in the latest release that I can work out whether the
format 
> of the return from a select query is in WKT or WKB?
> 
> Regards
> 
> Richard


Hi Richard,

Could you try and give us a better idea of the API your Python library uses
to obtain results and the types of query that it issues?

With the latest 1.0.x series of PostGIS, the assumption is that the
PostgreSQL "native" type (i.e. what you see when you do "SELECT geom_column
FROM geom_table") is an internal representation and could change. It is up
to the client to ask the database which format is required by wrapping the
geom_column with either AsText()/AsBinary() for OGC-compliant output or
AsEWKT()/AsEWKB() for PostGIS "Extended" formats which also includes
information such as Z/M coordinates and SRID information.


Kind regards,

Mark.

------------------------
WebBased Ltd
17 Research Way
Tamar Science Park
Plymouth
PL6 8BT 

T: +44 (0)1752 797131
F: +44 (0)1752 791023
W: http://www.webbased.co.uk





More information about the postgis-users mailing list