[postgis-users] Problem with PostGIS 1.0.0 RC1
m.cave-ayland at webbased.co.uk
Sat Jan 22 06:11:38 PST 2005
> -----Original Message-----
> From: strk at refractions.net [mailto:strk at refractions.net]
> Sent: 22 January 2005 13:25
> To: Mark Cave-Ayland
> Cc: 'PostGIS Users Discussion'
> Subject: Re: [postgis-users] Problem with PostGIS 1.0.0 RC1
> Since postgis 1.0 GeomFromWKB wants a bytea.
> If you want to input a geometry using an hex-ewkb you can use
> canonical input, as in:
> Maybe we should revert GeomFromWKB back to accept 'GEOMETRY',
> as it was before (cheating). What do you think ?
I see. I agree with you that GeometryFromWKB() should accept a binary
argument, but I can also see how inputting a text string could be useful.
Could we do this using the type system? For example, could we create a new
type called postgis_binary and then change GeomFromWKB to accept
postgis_binary instead of bytea? We then write two implicit casts: a bytea
to postgis_binary cast and a text to postgis_binary cast. In the case of the
bytea to postgis_binary cast, we simply return the binary data unaltered.
For the text to postgis_binary cast, we parse the hex string into binary and
return that. Hopefully this would allow GeometryFromWKB() to work with both
bytea and hex string data.... What do you think?
South West Technology Centre
Tamar Science Park
T: +44 (0)1752 791021
F: +44 (0)1752 791023
More information about the postgis-users