[postgis-devel] Canonical binary form AND WKB

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Mon Dec 20 03:11:05 PST 2004


> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net 
> [mailto:postgis-devel-bounces at postgis.refractions.net] On 
> Behalf Of strk at refractions.net
> Sent: 20 December 2004 10:39
> To: 'PostGIS Development Discussion'
> Subject: Re: [postgis-devel] Canonical binary form AND WKB
> 
> 
> I don't really feel comportable with all these formats.
> Having added a 'canonical binary' represent yet another 
> format which will need to be parsed in both XDR and NDR forms...
> 
> The cleanest thing to do would probably be supporting 
> something like the following:
> 
> 		-- OGC interfaces --
> 	    ascii WKT - GeomFromText / asText 
> 	   binary WKB - GeomFromWKB / asBinary
> 
> 		-- POSTGIS interfaces --
> 	   ascii EWKT - asEWKT / fromEWKT / geometry_in
> 	  binary EWKB - asEWKB / fromEWKB / geometry_send / 
> geometry_recv
> 	ascii HEXEWKB - geometry_out / geometry_in
> 
> Where EWKT and (HEX)EWKB should have a SRID added (currently 
> only ZM flags "extend" the OGC spec).
> 
> Does it sound cleaner ?
> 
> --strk;


Hi strk,

I was thinking about this over the weekend and came to a similar conclusion,
although I was considering using the native LWGEOM structure for speed when
dumping/reloading. However I don't believe the LWGEOM structure has a byte
that indicates the endian-ness of the data, where as EWK* forms do. Your
idea will allow dumps to be restored across different architectures, which
is obviously a "must have" feature, while helping simplify the code -
however, I think we will need to include code for byte-flipping in the EWK*
functions....


Kind regards,

Mark.

------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT 

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





More information about the postgis-devel mailing list